diff --git a/docs/v1/annotated-source/coffee-script.html b/docs/v1/annotated-source/coffee-script.html index 99a4d22ab0..634839ba53 100644 --- a/docs/v1/annotated-source/coffee-script.html +++ b/docs/v1/annotated-source/coffee-script.html @@ -941,6 +941,7 @@

coffee-script.coffee

answer = compile sources[filename], filename: filename sourceMap: yes + literate: helpers.isLiterate filename answer.sourceMap else null diff --git a/docs/v1/annotated-source/lexer.html b/docs/v1/annotated-source/lexer.html index b0cebbb9b2..1a34a1871b 100644 --- a/docs/v1/annotated-source/lexer.html +++ b/docs/v1/annotated-source/lexer.html @@ -710,10 +710,10 @@

Tokenizers

@token 'CALL_START', '(', 0, 0 @mergeInterpolationTokens tokens, {delimiter: '"', double: yes}, @formatHeregex if flags - @token ',', ',', index, 0 - @token 'STRING', '"' + flags + '"', index, flags.length - @token ')', ')', end, 0 - @token 'REGEX_END', ')', end, 0 + @token ',', ',', index - 1, 0 + @token 'STRING', '"' + flags + '"', index - 1, flags.length + @token ')', ')', end - 1, 0 + @token 'REGEX_END', ')', end - 1, 0 end diff --git a/docs/v1/annotated-source/nodes.html b/docs/v1/annotated-source/nodes.html index 2b60c5a455..22f350c244 100644 --- a/docs/v1/annotated-source/nodes.html +++ b/docs/v1/annotated-source/nodes.html @@ -1404,6 +1404,33 @@

Call

+

When setting the location, we sometimes need to update the start location to +account for a newly-discovered new operator to the left of us. This +expands the range on the left, but not the right.

+ + + +
  updateLocationDataIfMissing: (locationData) ->
+    if @locationData and @needsUpdatedStartLocation
+      @locationData.first_line = locationData.first_line
+      @locationData.first_column = locationData.first_column
+      base = @variable?.base or @variable
+      if base.needsUpdatedStartLocation
+        @variable.locationData.first_line = locationData.first_line
+        @variable.locationData.first_column = locationData.first_column
+        base.updateLocationDataIfMissing locationData
+      delete @needsUpdatedStartLocation
+    super
+ + + + +
  • +
    + +
    + +

    Tag this invocation as creating a new instance.

    @@ -1414,16 +1441,17 @@

    Call

    base.newInstance() else @isNew = true + @needsUpdatedStartLocation = true this
  • -
  • +
  • - +

    Soaked chained invocations unfold into if/else ternary structures.

    @@ -1463,11 +1491,11 @@

    Call

  • -
  • +
  • - +

    Compile a vanilla function call.

    @@ -1499,11 +1527,11 @@

    Call

  • -
  • +
  • - +

    If you call a function with a splat, it’s converted into a JavaScript .apply() call to allow an array of arguments to be passed. @@ -1551,11 +1579,11 @@

    Call

  • -
  • +
  • - +

    Super

    @@ -1564,11 +1592,11 @@

    Super

  • -
  • +
  • - +

    Takes care of converting super() calls into calls against the prototype’s function of the same name.

    @@ -1582,11 +1610,11 @@

    Super

  • -
  • +
  • - +

    Allow to recognize a bare super call without parentheses and arguments.

    @@ -1597,11 +1625,11 @@

    Super

  • -
  • +
  • - +

    Grab the reference to the superclass’s implementation of the current method.

    @@ -1634,11 +1662,11 @@

    Super

  • -
  • +
  • - +

    The appropriate this value for a super call.

    @@ -1651,11 +1679,11 @@

    Super

  • -
  • +
  • - +

    RegexWithInterpolations

    @@ -1664,11 +1692,11 @@

    RegexWithInterpolations

  • -
  • +
  • - +

    Regexes with interpolations are in fact just a variation of a Call (a RegExp() call to be precise) with a StringWithInterpolations inside.

    @@ -1682,11 +1710,11 @@

    RegexWithInterpolations

  • -
  • +
  • - +

    TaggedTemplateCall

    @@ -1703,11 +1731,11 @@

    TaggedTemplateCall

  • -
  • +
  • - +

    Tell StringWithInterpolations whether to compile as ES2015 or not; will be removed in CoffeeScript 2.

    @@ -1719,11 +1747,11 @@

    TaggedTemplateCall

  • -
  • +
  • - +

    Extends

    @@ -1732,11 +1760,11 @@

    Extends

  • -
  • +
  • - +

    Node to extend an object’s prototype with an ancestor object. After goog.inherits from the @@ -1752,11 +1780,11 @@

    Extends

  • -
  • +
  • - +

    Hooks one constructor into another’s prototype chain.

    @@ -1768,11 +1796,11 @@

    Extends

  • -
  • +
  • - +

    Access

    @@ -1781,11 +1809,11 @@

    Access

  • -
  • +
  • - +

    A . access into a property of a value, or the :: shorthand for an access into the object’s prototype.

    @@ -1814,11 +1842,11 @@

    Access

  • -
  • +
  • - +

    Index

    @@ -1827,11 +1855,11 @@

    Index

  • -
  • +
  • - +

    A [ ... ] indexed access into an array or object.

    @@ -1851,11 +1879,11 @@

    Index

  • -
  • +
  • - +

    Range

    @@ -1864,11 +1892,11 @@

    Range

  • -
  • +
  • - +

    A range literal. Ranges can be used to extract portions (slices) of arrays, to specify a range for comprehensions, or as a value, to be expanded into the @@ -1887,11 +1915,11 @@

    Range

  • -
  • +
  • - +

    Compiles the range’s source variables – where it starts and where it ends. But only if they need to be cached to avoid double evaluation.

    @@ -1911,11 +1939,11 @@

    Range

  • -
  • +
  • - +

    When compiled normally, the range returns the contents of the for loop needed to iterate over the values in the range. Used by comprehensions.

    @@ -1929,11 +1957,11 @@

    Range

  • -
  • +
  • - +

    Set up endpoints.

    @@ -1951,11 +1979,11 @@

    Range

  • -
  • +
  • - +

    Generate the condition.

    @@ -1973,11 +2001,11 @@

    Range

  • -
  • +
  • - +

    Generate the step.

    @@ -2002,11 +2030,11 @@

    Range

  • -
  • +
  • - +

    The final loop body.

    @@ -2017,11 +2045,11 @@

    Range

  • -
  • +
  • - +

    When used as a value, expand the range into the equivalent array.

    @@ -2052,11 +2080,11 @@

    Range

  • -
  • +
  • - +

    Slice

    @@ -2065,11 +2093,11 @@

    Slice

  • -
  • +
  • - +

    An array slice literal. Unlike JavaScript’s Array#slice, the second parameter specifies the index of the end of the slice, just as the first parameter @@ -2087,11 +2115,11 @@

    Slice

  • -
  • +
  • - +

    We have to be careful when trying to slice through the end of the array, 9e9 is used because not all implementations respect undefined or 1/0. @@ -2106,11 +2134,11 @@

    Slice

  • -
  • +
  • - +

    TODO: jwalton - move this into the ‘if’?

    @@ -2132,11 +2160,11 @@

    Slice

  • -
  • +
  • - +

    Obj

    @@ -2145,11 +2173,11 @@

    Obj

  • -
  • +
  • - +

    An object literal, nothing fancy.

    @@ -2222,11 +2250,11 @@

    Obj

  • -
  • +
  • - +

    Arr

    @@ -2235,11 +2263,11 @@

    Arr

  • -
  • +
  • - +

    An array literal.

    @@ -2278,11 +2306,11 @@

    Arr

  • -
  • +
  • - +

    Class

    @@ -2291,11 +2319,11 @@

    Class

  • -
  • +
  • - +

    The CoffeeScript class definition. Initialize a Class with its name, an optional superclass, and a @@ -2315,11 +2343,11 @@

    Class

  • -
  • +
  • - +

    Figure out the appropriate name for the constructor function of this class.

    @@ -2343,11 +2371,11 @@

    Class

  • -
  • +
  • - +

    For all this-references and bound functions in the class definition, this is the Class being constructed.

    @@ -2365,11 +2393,11 @@

    Class

  • -
  • +
  • - +

    Ensure that all functions bound to the instance are proxied in the constructor.

    @@ -2385,11 +2413,11 @@

    Class

  • -
  • +
  • - +

    Merge the properties from a top-level object as prototypal properties on the class.

    @@ -2428,11 +2456,11 @@

    Class

  • -
  • +
  • - +

    Walk the body of the class, looking for prototype properties to be converted and tagging static assignments.

    @@ -2456,11 +2484,11 @@

    Class

  • -
  • +
  • - +

    use strict (and other directives) must be the first expression statement(s) of a function body. This method ensures the prologue is correctly positioned @@ -2478,11 +2506,11 @@

    Class

  • -
  • +
  • - +

    Make sure that a constructor is defined for the class, and properly configured.

    @@ -2505,11 +2533,11 @@

    Class

  • -
  • +
  • - +

    Instead of generating the JavaScript string directly, we build up the equivalent syntax tree and compile that, in pieces. You can see the @@ -2552,11 +2580,11 @@

    Class

  • -
  • +
  • - +

    Import and Export

    @@ -2628,11 +2656,11 @@

    Import and Export

  • -
  • +
  • - +

    Prevent exporting an anonymous class; all exported members must be named

    @@ -2644,11 +2672,11 @@

    Import and Export

  • -
  • +
  • - +

    When the ES2015 class keyword is supported, don’t add a var here

    @@ -2702,11 +2730,11 @@

    Import and Export

  • -
  • +
  • - +

    The name of the variable entering the local scope

    @@ -2717,7 +2745,7 @@

    Import and Export

    children: ['original', 'alias'] compileNode: (o) -> - o.scope.add @identifier, @moduleDeclarationType + o.scope.find @identifier, @moduleDeclarationType code = [] code.push @makeCode @original.value code.push @makeCode " as #{@alias.value}" if @alias? @@ -2732,11 +2760,11 @@

    Import and Export

  • -
  • +
  • - +

    Per the spec, symbols can’t be imported multiple times (e.g. import { foo, foo } from 'lib' is invalid)

    @@ -2760,11 +2788,11 @@

    Import and Export

  • -
  • +
  • - +

    Assign

    @@ -2773,11 +2801,11 @@

    Assign

  • -
  • +
  • - +

    The Assign is used to assign a local variable to value, or to set the property of an object – including within object literals.

    @@ -2807,11 +2835,11 @@

    Assign

  • -
  • +
  • - +

    Compile an assignment, delegating to compilePatternMatch or compileSplice if appropriate. Keep track of the name of the base object @@ -2846,11 +2874,11 @@

    Assign

  • -
  • +
  • - +

    moduleDeclaration can be 'import' or 'export'

    @@ -2881,11 +2909,11 @@

    Assign

  • -
  • +
  • - +

    Brief implementation of recursive pattern matching, when assigning array or object literals to a value. Peeks at their properties to assign inner names.

    @@ -2908,11 +2936,11 @@

    Assign

  • -
  • +
  • - +

    Pick the property straight off the value when there’s just one to pick (no need to cache the value into a variable).

    @@ -2925,11 +2953,11 @@

    Assign

  • -
  • +
  • - +

    A regular object pattern-match.

    @@ -2948,11 +2976,11 @@

    Assign

  • -
  • +
  • - +

    A shorthand {a, b, @c} = val pattern-match.

    @@ -2967,11 +2995,11 @@

    Assign

  • -
  • +
  • - +

    A regular array pattern-match.

    @@ -2993,11 +3021,11 @@

    Assign

  • -
  • +
  • - +

    Make vvar into a simple variable if it isn’t already.

    @@ -3039,11 +3067,11 @@

    Assign

  • -
  • +
  • - +

    A regular object pattern-match.

    @@ -3062,11 +3090,11 @@

    Assign

  • -
  • +
  • - +

    A shorthand {a, b, @c} = val pattern-match.

    @@ -3081,11 +3109,11 @@

    Assign

  • -
  • +
  • - +

    A regular array pattern-match.

    @@ -3107,11 +3135,11 @@

    Assign

  • -
  • +
  • - +

    When compiling a conditional assignment, take care to ensure that the operands are only evaluated once, even though we have to reference them @@ -3125,11 +3153,11 @@

    Assign

  • -
  • +
  • - +

    Disallow conditional assignment of undefined variables.

    @@ -3148,11 +3176,11 @@

    Assign

  • -
  • +
  • - +

    Convert special math assignment operators like a **= b to the equivalent extended form a = a ** b and then compiles that.

    @@ -3166,11 +3194,11 @@

    Assign

  • -
  • +
  • - +

    Compile the assignment from an array splice literal, using JavaScript’s Array#splice method.

    @@ -3200,11 +3228,11 @@

    Assign

  • -
  • +
  • - +

    Code

    @@ -3213,11 +3241,11 @@

    Code

  • -
  • +
  • - +

    A function definition. This is the only node that creates a new Scope. When for the purposes of walking the contents of a function body, the Code @@ -3244,11 +3272,11 @@

    Code

  • -
  • +
  • - +

    Compilation creates a new scope unless explicitly asked to share with the outer scope. Handles splat parameters in the parameter list by peeking at @@ -3266,11 +3294,11 @@

    Code

  • -
  • +
  • - +

    Handle bound functions early.

    @@ -3342,11 +3370,11 @@

    Code

  • -
  • +
  • - +

    Short-circuit traverseChildren method to prevent it from crossing scope boundaries unless crossScope is true.

    @@ -3359,11 +3387,11 @@

    Code

  • -
  • +
  • - +

    Param

    @@ -3372,11 +3400,11 @@

    Param

  • -
  • +
  • - +

    A parameter in a function definition. Beyond a typical JavaScript parameter, these parameters can also attach themselves to the context of the function, @@ -3417,11 +3445,11 @@

    Param

  • -
  • +
  • - +

    Iterates the name or names of a Param. In a sense, a destructured parameter represents multiple JS parameters. This @@ -3438,11 +3466,11 @@

    Param

  • -
  • +
  • - +