CoffeeScript-in-CoffeeScript is compiling function calls

This commit is contained in:
Jeremy Ashkenas
2010-02-08 22:55:56 -05:00
parent 0b5b6113ee
commit 210d673ef0
4 changed files with 164 additions and 16 deletions

View File

@@ -81,7 +81,7 @@
],
// Assignment within an object literal (can be quoted).
AssignObj: [o("IDENTIFIER ASSIGN Expression", function() {
return new AssignNode(new ValueNode(yytext), $3, 'object');
return new AssignNode(new ValueNode(new LiteralNode(yytext)), $3, 'object');
}), o("STRING ASSIGN Expression", function() {
return new AssignNode(new ValueNode(new LiteralNode(yytext)), $3, 'object');
}), o("NUMBER ASSIGN Expression", function() {
@@ -189,7 +189,7 @@
],
// A Parameter (or ParamSplat) in a function definition.
Param: [o("PARAM", function() {
return yytext;
return new LiteralNode(yytext);
}), o("PARAM . . .", function() {
return new SplatNode(yytext);
})
@@ -201,7 +201,7 @@
],
// Expressions that can be treated as values.
Value: [o("IDENTIFIER", function() {
return new ValueNode(yytext);
return new ValueNode(new LiteralNode(yytext));
}), o("Literal", function() {
return new ValueNode($1);
}), o("Array", function() {
@@ -220,11 +220,11 @@
],
// Accessing into an object or array, through dot or index notation.
Accessor: [o("PROPERTY_ACCESS IDENTIFIER", function() {
return new AccessorNode(yytext);
return new AccessorNode(new LiteralNode(yytext));
}), o("PROTOTYPE_ACCESS IDENTIFIER", function() {
return new AccessorNode(yytext, 'prototype');
return new AccessorNode(new LiteralNode(yytext), 'prototype');
}), o("SOAK_ACCESS IDENTIFIER", function() {
return new AccessorNode(yytext, 'soak');
return new AccessorNode(new LiteralNode(yytext), 'soak');
}), o("Index"), o("Slice", function() {
return new SliceNode($1);
})
@@ -308,7 +308,7 @@
ArgList: [o("", function() {
return [];
}), o("Expression", function() {
return val;
return [$1];
}), o("INDENT Expression", function() {
return [$2];
}), o("ArgList , Expression", function() {