Skip to content

Commit

Permalink
updated grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
helixbass committed Oct 8, 2018
1 parent 51f566f commit fc2c48f
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 19 deletions.
1 change: 1 addition & 0 deletions lib/coffeescript/grammar.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions lib/coffeescript/nodes.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 24 additions & 18 deletions lib/coffeescript/parser.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/grammar.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ grammar =
# The list of arguments to a function call.
Arguments: [
o 'CALL_START CALL_END', -> []
o 'CALL_START ArgList OptComma CALL_END', -> $2
o 'CALL_START ArgList OptComma CALL_END', -> $2.implicit = $1.generated; $2
]

# A reference to the *this* current object.
Expand Down
13 changes: 13 additions & 0 deletions src/nodes.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,7 @@ exports.Call = class Call extends Base
constructor: (@variable, @args = [], @soak, @token) ->
super()

@implicit = @args.implicit
@isNew = no
if @variable instanceof Value and @variable.isNotCallable()
@variable.error "literal is not a function"
Expand Down Expand Up @@ -1426,6 +1427,18 @@ exports.Call = class Call extends Base
fragments.push @makeCode(' />')
fragments

astType: ->
if @isNew
'NewExpression'
else
'CallExpression'

astProperties: ->
callee: @variable.toAst()
arguments: arg.toAst() for arg in @args
optional: !!@soak
implicit: !!@implicit

#### Super

# Takes care of converting `super()` calls into calls against the prototype's
Expand Down

0 comments on commit fc2c48f

Please sign in to comment.