From 498e8124f61191140411794ca10605530b447c62 Mon Sep 17 00:00:00 2001 From: Jason Davies Date: Sat, 13 Nov 2010 10:37:55 +0000 Subject: [PATCH] Fix spelling --- examples/underscore.coffee | 2 +- src/coffee-script.coffee | 4 ++-- src/grammar.coffee | 2 +- src/helpers.coffee | 2 +- src/lexer.coffee | 6 +++--- src/nodes.coffee | 7 ++++--- src/optparse.coffee | 2 +- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/examples/underscore.coffee b/examples/underscore.coffee index aaccadcd..406803b9 100644 --- a/examples/underscore.coffee +++ b/examples/underscore.coffee @@ -317,7 +317,7 @@ _.zip = -> # If the browser doesn't supply us with **indexOf** (I'm looking at you, MSIE), -# we need this function. Return the position of the first occurence of an +# we need this function. Return the position of the first occurrence of an # item in an array, or -1 if the item is not included in the array. _.indexOf = (array, item) -> return array.indexOf item if nativeIndexOf and array.indexOf is nativeIndexOf diff --git a/src/coffee-script.coffee b/src/coffee-script.coffee index ff312c74..dd38bdc8 100755 --- a/src/coffee-script.coffee +++ b/src/coffee-script.coffee @@ -1,7 +1,7 @@ # CoffeeScript can be used both on the server, as a command-line compiler based # on Node.js/V8, or to run CoffeeScripts directly in the browser. This module -# contains the main entry functions for tokenzing, parsing, and compiling source -# CoffeeScript into JavaScript. +# contains the main entry functions for tokenizing, parsing, and compiling +# source CoffeeScript into JavaScript. # # If included on a webpage, it will automatically sniff out, compile, and # execute all scripts present in `text/coffeescript` tags. diff --git a/src/grammar.coffee b/src/grammar.coffee index 759daa29..e1adfaad 100644 --- a/src/grammar.coffee +++ b/src/grammar.coffee @@ -62,7 +62,7 @@ grammar = o 'Block TERMINATOR' ] - # Any list of statements and expressions, seperated by line breaks or semicolons. + # Any list of statements and expressions, separated by line breaks or semicolons. Body: [ o 'Line', -> Expressions.wrap [$1] o 'Body TERMINATOR Line', -> $1.push $3 diff --git a/src/helpers.coffee b/src/helpers.coffee index 5bfd6074..f17a019a 100644 --- a/src/helpers.coffee +++ b/src/helpers.coffee @@ -15,7 +15,7 @@ exports.ends = (string, literal, back) -> exports.compact = (array) -> item for item in array when item -# Count the number of occurences of a character in a string. +# Count the number of occurrences of a character in a string. exports.count = (string, letter) -> num = pos = 0 num++ while pos = 1 + string.indexOf letter, pos diff --git a/src/lexer.coffee b/src/lexer.coffee index dbf365e4..bc46e982 100644 --- a/src/lexer.coffee +++ b/src/lexer.coffee @@ -15,7 +15,7 @@ # The Lexer Class # --------------- -# The Lexer class reads a stream of CoffeeScript and divvys it up into tagged +# The Lexer class reads a stream of CoffeeScript and divvies it up into tagged # tokens. Some potential ambiguity in the grammar has been avoided by # pushing some extra smarts into the Lexer. exports.Lexer = class Lexer @@ -304,7 +304,7 @@ exports.Lexer = class Lexer @tokens.pop() if @value() is '\\' this - # We treat all other single characters as a token. Eg.: `( ) , . !` + # We treat all other single characters as a token. E.g.: `( ) , . !` # Multi-character operators are also literal tokens, so that Jison can assign # the proper order of operations. There are some symbols that we tag specially # here. `;` and newlines are both treated as a `TERMINATOR`, we distinguish @@ -628,7 +628,7 @@ SHIFT = ['<<', '>>', '>>>'] # Comparison tokens. COMPARE = ['==', '!=', '<', '>', '<=', '>='] -# Mathmatical tokens. +# Mathematical tokens. MATH = ['*', '/', '%'] # Relational tokens that are negatable with `not` prefix. diff --git a/src/nodes.coffee b/src/nodes.coffee index 922e4844..ab2da2da 100644 --- a/src/nodes.coffee +++ b/src/nodes.coffee @@ -77,7 +77,7 @@ exports.Base = class Base # Construct a node that returns the current node's result. # Note that this is overridden for smarter behavior for - # many statement nodes (eg If, For)... + # many statement nodes (e.g. If, For)... makeReturn: -> new Return this @@ -371,7 +371,7 @@ exports.Value = class Value extends Base [base.push(name), new Value(bref or base.base, [nref or name])] # We compile a value to JavaScript by compiling and joining each property. - # Things get much more insteresting if the chain of properties has *soak* + # Things get much more interesting if the chain of properties has *soak* # operators `?.` interspersed. Then we have to take care not to accidentally # evaluate anything twice when building the soak chain. compileNode: (o) -> @@ -433,7 +433,8 @@ exports.Call = class Call extends Base @isNew = true this - # Grab the reference to the superclass' implementation of the current method. + # Grab the reference to the superclass's implementation of the current + # method. superReference: (o) -> {method} = o.scope throw SyntaxError 'cannot call super outside of a function.' unless method diff --git a/src/optparse.coffee b/src/optparse.coffee index a760936e..3f486783 100644 --- a/src/optparse.coffee +++ b/src/optparse.coffee @@ -18,7 +18,7 @@ exports.OptionParser = class OptionParser # Parse the list of arguments, populating an `options` object with all of the # specified options, and returning it. `options.arguments` will be an array - # containing the remaning non-option arguments. This is a simpler API than + # containing the remaining non-option arguments. This is a simpler API than # many option parsers that allow you to attach callback actions for every # flag. Instead, you're responsible for interpreting the options object. parse: (args) ->