Fix misspellings in GN reference

Change-Id: If752363b90772f07b70a16c369583b03948a05a7
Reviewed-on: https://chromium-review.googlesource.com/738094
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#533370}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: f7f761c756aff8bf4b993eb2dc37f934a5775f53
diff --git a/tools/gn/args.h b/tools/gn/args.h
index cbac794..ee45085 100644
--- a/tools/gn/args.h
+++ b/tools/gn/args.h
@@ -79,9 +79,9 @@
   // arguments. If there are, this returns false and sets the error.
   bool VerifyAllOverridesUsed(Err* err) const;
 
-  // Returns information about all arguements, both defaults and overrides.
+  // Returns information about all arguments, both defaults and overrides.
   // This is used for the help system which is not performance critical. Use a
-  // map instead of a hash map so the arguements are sorted alphabetically.
+  // map instead of a hash map so the arguments are sorted alphabetically.
   ValueWithOverrideMap GetAllArguments() const;
 
   // Returns the set of build files that may affect the build arguments, please
diff --git a/tools/gn/command_args.cc b/tools/gn/command_args.cc
index c53497a..bb40a6e 100644
--- a/tools/gn/command_args.cc
+++ b/tools/gn/command_args.cc
@@ -64,7 +64,7 @@
 }
 
 // Assumes DoesLineBeginWithComment(), this strips the # character from the
-// beginning and normalizes preceeding whitespace.
+// beginning and normalizes preceding whitespace.
 std::string StripHashFromLine(const base::StringPiece& line) {
   // Replace the # sign and everything before it with 3 spaces, so that a
   // normal comment that has a space after the # will be indented 4 spaces
@@ -361,7 +361,7 @@
 
       The output will list the declaration location, current value for the
       build, default value (if different than the current value), and comment
-      preceeding the declaration.
+      preceding the declaration.
 
       If --short is specified, only the names and current values will be
       printed.
diff --git a/tools/gn/command_check.cc b/tools/gn/command_check.cc
index 9581c4c..4efcd45 100644
--- a/tools/gn/command_check.cc
+++ b/tools/gn/command_check.cc
@@ -120,7 +120,7 @@
       included by other targets. Anything in the sources will be considered
       private and will not be includable regardless of dependency paths.
 
-    - Ouptuts from actions are treated like public sources on that target.
+    - Outputs from actions are treated like public sources on that target.
 
     - A target can include headers from a target that depends on it if the
       other target is annotated accordingly. See "gn help
diff --git a/tools/gn/command_format.cc b/tools/gn/command_format.cc
index fb376d9..c44f637 100644
--- a/tools/gn/command_format.cc
+++ b/tools/gn/command_format.cc
@@ -38,7 +38,7 @@
 
   The contents of some lists ('sources', 'deps', etc.) will be sorted to a
   canonical order. To suppress this, you can add a comment of the form "#
-  NOSORT" immediately preceeding the assignment. e.g.
+  NOSORT" immediately preceding the assignment. e.g.
 
   # NOSORT
   sources = [
diff --git a/tools/gn/docs/reference.md b/tools/gn/docs/reference.md
index 3f931fb..a462d5d 100644
--- a/tools/gn/docs/reference.md
+++ b/tools/gn/docs/reference.md
@@ -249,7 +249,7 @@
 
       The output will list the declaration location, current value for the
       build, default value (if different than the current value), and comment
-      preceeding the declaration.
+      preceding the declaration.
 
       If --short is specified, only the names and current values will be
       printed.
@@ -353,7 +353,7 @@
       included by other targets. Anything in the sources will be considered
       private and will not be includable regardless of dependency paths.
 
-    - Ouptuts from actions are treated like public sources on that target.
+    - Outputs from actions are treated like public sources on that target.
 
     - A target can include headers from a target that depends on it if the
       other target is annotated accordingly. See "gn help
@@ -571,7 +571,7 @@
 
   The contents of some lists ('sources', 'deps', etc.) will be sorted to a
   canonical order. To suppress this, you can add a comment of the form "#
-  NOSORT" immediately preceeding the assignment. e.g.
+  NOSORT" immediately preceding the assignment. e.g.
 
   # NOSORT
   sources = [
@@ -2108,7 +2108,7 @@
 ```
   value = getenv(env_var_name)
 
-  Returns the value of the given enironment variable. If the value is not
+  Returns the value of the given environment variable. If the value is not
   found, it will try to look up the variable with the "opposite" case (based on
   the case of the first letter of the variable), but is otherwise
   case-sensitive.
@@ -3067,7 +3067,7 @@
         prefixed by the "lib_switch".
 
         As a special case to support Mac, libraries with names ending in
-        ".framework" will be added to the {{libs}} with "-framework" preceeding
+        ".framework" will be added to the {{libs}} with "-framework" preceding
         it, and the lib prefix will be ignored.
 
         Example: "-lfoo -lbar"
@@ -3094,7 +3094,7 @@
         Example: ".so"
 
     {{solibs}}
-        Extra libraries from shared library dependencide not specified in the
+        Extra libraries from shared library dependencies not specified in the
         {{inputs}}. This is the list of link_output files from shared libraries
         (if the solink tool specifies a "link_output" variable separate from
         the "depend_output").
@@ -3120,7 +3120,7 @@
 
   The compile_xcassets tool will be called with one or more source (each an
   asset catalog) that needs to be compiled to a single output. The following
-  substitutions are avaiable:
+  substitutions are available:
 
     {{inputs}}
         Expands to the list of .xcassets to use as input to compile the asset
@@ -3216,7 +3216,7 @@
   When a target has a dependency on a target using different toolchain (see "gn
   help labels" for how to specify this), GN will start a build using that
   secondary toolchain to resolve the target. GN will load the build config file
-  with the build arguements overridden as specified in the toolchain_args.
+  with the build arguments overridden as specified in the toolchain_args.
   Because the default toolchain is already known, calls to
   set_default_toolchain() are ignored.
 
@@ -3341,7 +3341,7 @@
   that depend on this file.
 
   One use for write_file is to write a list of inputs to an script that might
-  be too long for the command line. However, it is preferrable to use response
+  be too long for the command line. However, it is preferable to use response
   files for this purpose. See "gn help response_file_contents".
 
   TODO(brettw) we probably need an optional third argument to control list
@@ -3721,7 +3721,7 @@
      those configs appear in the list.
   5. all_dependent_configs pulled from dependencies, in the order of
      the "deps" list. This is done recursively. If a config appears
-     more than once, only the first occurance will be used.
+     more than once, only the first occurence will be used.
   6. public_configs pulled from dependencies, in the order of the
      "deps" list. If a dependency is public, they will be applied
      recursively.
@@ -3827,7 +3827,7 @@
      those configs appear in the list.
   5. all_dependent_configs pulled from dependencies, in the order of
      the "deps" list. This is done recursively. If a config appears
-     more than once, only the first occurance will be used.
+     more than once, only the first occurence will be used.
   6. public_configs pulled from dependencies, in the order of the
      "deps" list. If a dependency is public, they will be applied
      recursively.
@@ -3862,7 +3862,7 @@
      those configs appear in the list.
   5. all_dependent_configs pulled from dependencies, in the order of
      the "deps" list. This is done recursively. If a config appears
-     more than once, only the first occurance will be used.
+     more than once, only the first occurence will be used.
   6. public_configs pulled from dependencies, in the order of the
      "deps" list. If a dependency is public, they will be applied
      recursively.
@@ -4040,7 +4040,7 @@
      those configs appear in the list.
   5. all_dependent_configs pulled from dependencies, in the order of
      the "deps" list. This is done recursively. If a config appears
-     more than once, only the first occurance will be used.
+     more than once, only the first occurence will be used.
   6. public_configs pulled from dependencies, in the order of the
      "deps" list. If a dependency is public, they will be applied
      recursively.
@@ -4073,7 +4073,7 @@
      those configs appear in the list.
   5. all_dependent_configs pulled from dependencies, in the order of
      the "deps" list. This is done recursively. If a config appears
-     more than once, only the first occurance will be used.
+     more than once, only the first occurence will be used.
   6. public_configs pulled from dependencies, in the order of the
      "deps" list. If a dependency is public, they will be applied
      recursively.
@@ -4106,7 +4106,7 @@
      those configs appear in the list.
   5. all_dependent_configs pulled from dependencies, in the order of
      the "deps" list. This is done recursively. If a config appears
-     more than once, only the first occurance will be used.
+     more than once, only the first occurence will be used.
   6. public_configs pulled from dependencies, in the order of the
      "deps" list. If a dependency is public, they will be applied
      recursively.
@@ -4139,7 +4139,7 @@
      those configs appear in the list.
   5. all_dependent_configs pulled from dependencies, in the order of
      the "deps" list. This is done recursively. If a config appears
-     more than once, only the first occurance will be used.
+     more than once, only the first occurence will be used.
   6. public_configs pulled from dependencies, in the order of the
      "deps" list. If a dependency is public, they will be applied
      recursively.
@@ -4172,7 +4172,7 @@
      those configs appear in the list.
   5. all_dependent_configs pulled from dependencies, in the order of
      the "deps" list. This is done recursively. If a config appears
-     more than once, only the first occurance will be used.
+     more than once, only the first occurence will be used.
   6. public_configs pulled from dependencies, in the order of the
      "deps" list. If a dependency is public, they will be applied
      recursively.
@@ -4334,7 +4334,7 @@
      those configs appear in the list.
   5. all_dependent_configs pulled from dependencies, in the order of
      the "deps" list. This is done recursively. If a config appears
-     more than once, only the first occurance will be used.
+     more than once, only the first occurence will be used.
   6. public_configs pulled from dependencies, in the order of the
      "deps" list. If a dependency is public, they will be applied
      recursively.
@@ -4443,7 +4443,7 @@
      those configs appear in the list.
   5. all_dependent_configs pulled from dependencies, in the order of
      the "deps" list. This is done recursively. If a config appears
-     more than once, only the first occurance will be used.
+     more than once, only the first occurence will be used.
   6. public_configs pulled from dependencies, in the order of the
      "deps" list. If a dependency is public, they will be applied
      recursively.
@@ -4499,7 +4499,7 @@
   A list of target labels.
 
   Specifies private dependencies of a target. Private dependencies are
-  propagated up the dependency tree and linked to dependant targets, but do not
+  propagated up the dependency tree and linked to dependent targets, but do not
   grant the ability to include headers from the dependency. Public configs are
   not forwarded.
 ```
@@ -4514,7 +4514,7 @@
   Executables, shared libraries, and complete static libraries will link all
   propagated targets and stop propagation. Actions and copy steps also stop
   propagation, allowing them to take a library as an input but not force
-  dependants to link to it.
+  dependents to link to it.
 
   Propagation of all_dependent_configs and public_configs happens independently
   of target type. all_dependent_configs are always propagated across all types
@@ -4547,7 +4547,7 @@
      those configs appear in the list.
   5. all_dependent_configs pulled from dependencies, in the order of
      the "deps" list. This is done recursively. If a config appears
-     more than once, only the first occurance will be used.
+     more than once, only the first occurence will be used.
   6. public_configs pulled from dependencies, in the order of the
      "deps" list. If a dependency is public, they will be applied
      recursively.
@@ -4655,7 +4655,7 @@
      those configs appear in the list.
   5. all_dependent_configs pulled from dependencies, in the order of
      the "deps" list. This is done recursively. If a config appears
-     more than once, only the first occurance will be used.
+     more than once, only the first occurence will be used.
   6. public_configs pulled from dependencies, in the order of the
      "deps" list. If a dependency is public, they will be applied
      recursively.
@@ -4688,7 +4688,7 @@
      those configs appear in the list.
   5. all_dependent_configs pulled from dependencies, in the order of
      the "deps" list. This is done recursively. If a config appears
-     more than once, only the first occurance will be used.
+     more than once, only the first occurence will be used.
   6. public_configs pulled from dependencies, in the order of the
      "deps" list. If a dependency is public, they will be applied
      recursively.
@@ -4757,7 +4757,7 @@
      those configs appear in the list.
   5. all_dependent_configs pulled from dependencies, in the order of
      the "deps" list. This is done recursively. If a config appears
-     more than once, only the first occurance will be used.
+     more than once, only the first occurence will be used.
   6. public_configs pulled from dependencies, in the order of the
      "deps" list. If a dependency is public, they will be applied
      recursively.
@@ -5091,7 +5091,7 @@
      those configs appear in the list.
   5. all_dependent_configs pulled from dependencies, in the order of
      the "deps" list. This is done recursively. If a config appears
-     more than once, only the first occurance will be used.
+     more than once, only the first occurence will be used.
   6. public_configs pulled from dependencies, in the order of the
      "deps" list. If a dependency is public, they will be applied
      recursively.
@@ -5208,7 +5208,7 @@
 
   As a special case, a file ending in ".def" will be treated as a Windows
   module definition file. It will be appended to the link line with a
-  preceeding "/DEF:" string. There must be at most one .def file in a target
+  preceding "/DEF:" string. There must be at most one .def file in a target
   and they do not cross dependency boundaries (so specifying a .def file in a
   static library or source set will have no effect on the executable or shared
   library they're linked into).
@@ -5566,7 +5566,7 @@
       ... target parameter definitions ...
     }
 
-  There is also a generic "target" function for programatically defined types
+  There is also a generic "target" function for programmatically defined types
   (see "gn help target"). You can define new types using templates (see "gn
   help template"). A template defines some custom code that expands to one or
   more other targets.
diff --git a/tools/gn/escape_unittest.cc b/tools/gn/escape_unittest.cc
index fc7692d..8d7ba8a 100644
--- a/tools/gn/escape_unittest.cc
+++ b/tools/gn/escape_unittest.cc
@@ -35,7 +35,7 @@
   // Backslashes at the end of the string get escaped.
   EXPECT_EQ("\"foo$ bar\\\\\\\\\"", EscapeString("foo bar\\\\", opts, nullptr));
 
-  // Backslashes preceeding quotes are escaped, and the quote is escaped.
+  // Backslashes preceding quotes are escaped, and the quote is escaped.
   EXPECT_EQ("\"foo\\\\\\\"$ bar\"", EscapeString("foo\\\" bar", opts, nullptr));
 }
 
diff --git a/tools/gn/function_toolchain.cc b/tools/gn/function_toolchain.cc
index 230f77f..19eaea8 100644
--- a/tools/gn/function_toolchain.cc
+++ b/tools/gn/function_toolchain.cc
@@ -324,7 +324,7 @@
   When a target has a dependency on a target using different toolchain (see "gn
   help labels" for how to specify this), GN will start a build using that
   secondary toolchain to resolve the target. GN will load the build config file
-  with the build arguements overridden as specified in the toolchain_args.
+  with the build arguments overridden as specified in the toolchain_args.
   Because the default toolchain is already known, calls to
   set_default_toolchain() are ignored.
 
@@ -843,7 +843,7 @@
         prefixed by the "lib_switch".
 
         As a special case to support Mac, libraries with names ending in
-        ".framework" will be added to the {{libs}} with "-framework" preceeding
+        ".framework" will be added to the {{libs}} with "-framework" preceding
         it, and the lib prefix will be ignored.
 
         Example: "-lfoo -lbar"
@@ -870,7 +870,7 @@
         Example: ".so"
 
     {{solibs}}
-        Extra libraries from shared library dependencide not specified in the
+        Extra libraries from shared library dependencies not specified in the
         {{inputs}}. This is the list of link_output files from shared libraries
         (if the solink tool specifies a "link_output" variable separate from
         the "depend_output").
@@ -897,7 +897,7 @@
 
   The compile_xcassets tool will be called with one or more source (each an
   asset catalog) that needs to be compiled to a single output. The following
-  substitutions are avaiable:
+  substitutions are available:
 
     {{inputs}}
         Expands to the list of .xcassets to use as input to compile the asset
diff --git a/tools/gn/function_write_file.cc b/tools/gn/function_write_file.cc
index 0e2dd06..bfa79b6 100644
--- a/tools/gn/function_write_file.cc
+++ b/tools/gn/function_write_file.cc
@@ -35,7 +35,7 @@
   that depend on this file.
 
   One use for write_file is to write a list of inputs to an script that might
-  be too long for the command line. However, it is preferrable to use response
+  be too long for the command line. However, it is preferable to use response
   files for this purpose. See "gn help response_file_contents".
 
   TODO(brettw) we probably need an optional third argument to control list
diff --git a/tools/gn/functions.cc b/tools/gn/functions.cc
index 38b3020..fa968c9 100644
--- a/tools/gn/functions.cc
+++ b/tools/gn/functions.cc
@@ -554,7 +554,7 @@
 
   value = getenv(env_var_name)
 
-  Returns the value of the given enironment variable. If the value is not
+  Returns the value of the given environment variable. If the value is not
   found, it will try to look up the variable with the "opposite" case (based on
   the case of the first letter of the variable), but is otherwise
   case-sensitive.
diff --git a/tools/gn/setup.h b/tools/gn/setup.h
index 68f86c7..08bb11b 100644
--- a/tools/gn/setup.h
+++ b/tools/gn/setup.h
@@ -44,7 +44,7 @@
   // is malformed.
   //
   // With force_create = false, setup will fail if the build directory doesn't
-  // alreay exist with an args file in it. With force_create set to true, the
+  // already exist with an args file in it. With force_create set to true, the
   // directory will be created if necessary. Commands explicitly doing
   // generation should set this to true to create it, but querying commands
   // should set it to false to prevent creating oddly-named directories in case
@@ -88,7 +88,7 @@
   const SourceFile& GetDotFile() const { return dotfile_input_file_->name(); }
 
   // Name of the file in the root build directory that contains the build
-  // arguements.
+  // arguments.
   static const char kBuildArgFileName[];
 
  private:
diff --git a/tools/gn/target.cc b/tools/gn/target.cc
index 7c810b5..b8939bb 100644
--- a/tools/gn/target.cc
+++ b/tools/gn/target.cc
@@ -235,7 +235,7 @@
       ... target parameter definitions ...
     }
 
-  There is also a generic "target" function for programatically defined types
+  There is also a generic "target" function for programmatically defined types
   (see "gn help target"). You can define new types using templates (see "gn
   help template"). A template defines some custom code that expands to one or
   more other targets.
diff --git a/tools/gn/tokenizer.cc b/tools/gn/tokenizer.cc
index 96b32dc..306f626 100644
--- a/tools/gn/tokenizer.cc
+++ b/tools/gn/tokenizer.cc
@@ -356,7 +356,7 @@
     return false;
 
   // Check for escaping. \" is not a string terminator, but \\" is. Count
-  // the number of preceeding backslashes.
+  // the number of preceding backslashes.
   int num_backslashes = 0;
   for (int i = static_cast<int>(cur_) - 1; i >= 0 && input_[i] == '\\'; i--)
     num_backslashes++;
diff --git a/tools/gn/variables.cc b/tools/gn/variables.cc
index c44ad2c..80c6b36 100644
--- a/tools/gn/variables.cc
+++ b/tools/gn/variables.cc
@@ -383,23 +383,23 @@
 
 // Target variables ------------------------------------------------------------
 
-#define COMMON_ORDERING_HELP \
-    "\n" \
-    "Ordering of flags and values\n" \
-    "\n" \
-    "  1. Those set on the current target (not in a config).\n" \
-    "  2. Those set on the \"configs\" on the target in order that the\n" \
-    "     configs appear in the list.\n" \
-    "  3. Those set on the \"all_dependent_configs\" on the target in order\n" \
-    "     that the configs appear in the list.\n" \
-    "  4. Those set on the \"public_configs\" on the target in order that\n" \
-    "     those configs appear in the list.\n" \
-    "  5. all_dependent_configs pulled from dependencies, in the order of\n" \
-    "     the \"deps\" list. This is done recursively. If a config appears\n" \
-    "     more than once, only the first occurance will be used.\n" \
-    "  6. public_configs pulled from dependencies, in the order of the\n" \
-    "     \"deps\" list. If a dependency is public, they will be applied\n" \
-    "     recursively.\n"
+#define COMMON_ORDERING_HELP                                                 \
+  "\n"                                                                       \
+  "Ordering of flags and values\n"                                           \
+  "\n"                                                                       \
+  "  1. Those set on the current target (not in a config).\n"                \
+  "  2. Those set on the \"configs\" on the target in order that the\n"      \
+  "     configs appear in the list.\n"                                       \
+  "  3. Those set on the \"all_dependent_configs\" on the target in order\n" \
+  "     that the configs appear in the list.\n"                              \
+  "  4. Those set on the \"public_configs\" on the target in order that\n"   \
+  "     those configs appear in the list.\n"                                 \
+  "  5. all_dependent_configs pulled from dependencies, in the order of\n"   \
+  "     the \"deps\" list. This is done recursively. If a config appears\n"  \
+  "     more than once, only the first occurence will be used.\n"            \
+  "  6. public_configs pulled from dependencies, in the order of the\n"      \
+  "     \"deps\" list. If a dependency is public, they will be applied\n"    \
+  "     recursively.\n"
 
 const char kAllDependentConfigs[] = "all_dependent_configs";
 const char kAllDependentConfigs_HelpShort[] =
@@ -1074,7 +1074,7 @@
   A list of target labels.
 
   Specifies private dependencies of a target. Private dependencies are
-  propagated up the dependency tree and linked to dependant targets, but do not
+  propagated up the dependency tree and linked to dependent targets, but do not
   grant the ability to include headers from the dependency. Public configs are
   not forwarded.
 
@@ -1087,7 +1087,7 @@
   Executables, shared libraries, and complete static libraries will link all
   propagated targets and stop propagation. Actions and copy steps also stop
   propagation, allowing them to take a library as an input but not force
-  dependants to link to it.
+  dependents to link to it.
 
   Propagation of all_dependent_configs and public_configs happens independently
   of target type. all_dependent_configs are always propagated across all types
@@ -1759,7 +1759,7 @@
 
   As a special case, a file ending in ".def" will be treated as a Windows
   module definition file. It will be appended to the link line with a
-  preceeding "/DEF:" string. There must be at most one .def file in a target
+  preceding "/DEF:" string. There must be at most one .def file in a target
   and they do not cross dependency boundaries (so specifying a .def file in a
   static library or source set will have no effect on the executable or shared
   library they're linked into).