%type <method_> GeneratorMethod
%type <statement_> HoistableDeclaration
%type <identifier_> Identifier
+%type <identifier_> IdentifierNoOf
%type <identifier_> IdentifierType
+%type <identifier_> IdentifierTypeNoOf
%type <word_> IdentifierName
%type <variable_> IdentifierReference
%type <statement_> IfStatement
LexPushYieldOff: { driver.yield_.push(false); };
LexPopYield: { driver.yield_.pop(); };
-LexOf
- : { CYMAP(_of__, _of_); }
- ;
-
LexSetRegExp
- : LexOf
+ :
;
LexNewLine
;
Word
- : Identifier { $$ = $1; }
+ : IdentifierNoOf { $$ = $1; }
| "auto" { $$ = CYNew CYWord("auto"); }
| "break" { $$ = CYNew CYWord("break"); }
| "case" { $$ = CYNew CYWord("case"); }
| "catch" { $$ = CYNew CYWord("catch"); }
- | "class" { $$ = CYNew CYWord("class"); }
+ | "class" LexOf { $$ = CYNew CYWord("class"); }
| ";class" { $$ = CYNew CYWord("class"); }
| "const" { $$ = CYNew CYWord("const"); }
| "continue" { $$ = CYNew CYWord("continue"); }
| "extends" { $$ = CYNew CYWord("extends"); }
| "false" { $$ = CYNew CYWord("false"); }
| "finally" { $$ = CYNew CYWord("finally"); }
- | "function" { $$ = CYNew CYWord("function"); }
+ | "function" LexOf { $$ = CYNew CYWord("function"); }
| "if" { $$ = CYNew CYWord("if"); }
| "import" { $$ = CYNew CYWord("import"); }
| "!in" { $$ = CYNew CYWord("in"); }
+ | "!of" { $$ = CYNew CYWord("of"); }
| "new" LexSetRegExp { $$ = CYNew CYWord("new"); }
| "null" { $$ = CYNew CYWord("null"); }
| "return" { $$ = CYNew CYWord("return"); }
;
BindingIdentifier
- : Identifier { $$ = $1; }
+ : IdentifierNoOf { $$ = $1; }
+ | "!of" { $$ = CYNew CYIdentifier("of"); }
| "yield" { $$ = CYNew CYIdentifier("yield"); }
;
| "yield" { $$ = CYNew CYIdentifier("yield"); }
;
-IdentifierType
+IdentifierTypeNoOf
: Identifier_ { $$ = $1; }
| "abstract" { $$ = CYNew CYIdentifier("abstract"); }
| "await" { $$ = CYNew CYIdentifier("await"); }
| "let" { $$ = CYNew CYIdentifier("let"); }
| "!let" LexBind { $$ = CYNew CYIdentifier("let"); }
| "native" { $$ = CYNew CYIdentifier("native"); }
- | "!of" { $$ = CYNew CYIdentifier("of"); }
| "package" { $$ = CYNew CYIdentifier("package"); }
| "private" { $$ = CYNew CYIdentifier("private"); }
| "protected" { $$ = CYNew CYIdentifier("protected"); }
@end
;
-Identifier
- : IdentifierType
+IdentifierType
+ : IdentifierTypeNoOf { $$ = $1; }
+ | "of" { $$ = CYNew CYIdentifier("of"); }
+ ;
+
+IdentifierNoOf
+ : IdentifierTypeNoOf
| "char" { $$ = CYNew CYIdentifier("char"); }
| "int" { $$ = CYNew CYIdentifier("int"); }
| "long" { $$ = CYNew CYIdentifier("long"); }
| "YES" { $$ = CYNew CYIdentifier("YES"); }
@end
;
+
+Identifier
+ : IdentifierNoOf { $$ = $1; }
+ | "of" { $$ = CYNew CYIdentifier("of"); }
+ ;
/* }}} */
/* 12.2 Primary Expression {{{ */
PrimaryExpression
: { CYMAP(_let__, _let_); }
;
+LexOf
+ : { CYMAP(_of__, _of_); }
+ ;
+
LexBind
: { CYMAP(OpenBrace_let, OpenBrace); CYMAP(OpenBracket_let, OpenBracket); } LexOf
;
/* 14.1 Function Definitions {{{ */
FunctionDeclaration
- : ";function" BindingIdentifier "(" FormalParameters ")" BRACE LexPushSuperOff FunctionBody "}" LexPopSuper { $$ = CYNew CYFunctionStatement($2, $4, $8); }
+ : ";function" LexOf BindingIdentifier "(" FormalParameters ")" BRACE LexPushSuperOff FunctionBody "}" LexPopSuper { $$ = CYNew CYFunctionStatement($3, $5, $9); }
;
FunctionExpression
- : "function" BindingIdentifierOpt "(" FormalParameters ")" BRACE LexPushSuperOff FunctionBody "}" LexPopSuper { $$ = CYNew CYFunctionExpression($2, $4, $8); }
+ : "function" LexOf BindingIdentifierOpt "(" FormalParameters ")" BRACE LexPushSuperOff FunctionBody "}" LexPopSuper { $$ = CYNew CYFunctionExpression($3, $5, $9); }
;
StrictFormalParameters
;
GeneratorDeclaration
- : ";function" "*" BindingIdentifier "(" FormalParameters ")" BRACE GeneratorBody "}" { CYNOT(@$); /* $$ = CYNew CYGeneratorStatement($3, $5, $8); */ }
+ : ";function" LexOf "*" LexOf BindingIdentifier "(" FormalParameters ")" BRACE GeneratorBody "}" { CYNOT(@$); /* $$ = CYNew CYGeneratorStatement($3, $5, $8); */ }
;
GeneratorExpression
- : "function" "*" BindingIdentifierOpt "(" FormalParameters ")" BRACE GeneratorBody "}" { CYNOT(@$); /* $$ = CYNew CYGeneratorExpression($3, $5, $8); */ }
+ : "function" LexOf "*" LexOf BindingIdentifierOpt "(" FormalParameters ")" BRACE GeneratorBody "}" { CYNOT(@$); /* $$ = CYNew CYGeneratorExpression($3, $5, $8); */ }
;
GeneratorBody
/* }}} */
/* 14.5 Class Definitions {{{ */
ClassDeclaration
- : ";class" BindingIdentifier ClassTail { $$ = CYNew CYClassStatement($2, $3); }
+ : ";class" LexOf BindingIdentifier ClassTail { $$ = CYNew CYClassStatement($3, $4); }
;
ClassExpression
- : "class" BindingIdentifierOpt ClassTail { $$ = CYNew CYClassExpression($2, $3); }
+ : "class" LexOf BindingIdentifierOpt ClassTail { $$ = CYNew CYClassExpression($3, $4); }
;
ClassTail
;
MessageParameter
- : Word ":" TypeOpt Identifier { $3->identifier_ = $4; $$ = CYNew CYMessageParameter($1, $3); }
+ : Word ":" TypeOpt BindingIdentifier { $3->identifier_ = $4; $$ = CYNew CYMessageParameter($1, $3); }
;
MessageParameterList
;
RubyProcParameterList
- : Identifier RubyProcParameterList_ { $$ = CYNew CYFunctionParameter(CYNew CYDeclaration($1), $2); }
+ : BindingIdentifier RubyProcParameterList_ { $$ = CYNew CYFunctionParameter(CYNew CYDeclaration($1), $2); }
| { $$ = NULL; }
;