LexPushYieldOff: { driver.yield_.push(false); };
LexPopYield: { driver.yield_.pop(); };
-LexSetRegExp
- :
- ;
-
LexNewLine
: { CYMPT(@$); driver.next_ = true; }
;
| "continue" { $$ = CYNew CYWord("continue"); }
| "debugger" { $$ = CYNew CYWord("debugger"); }
| "default" { $$ = CYNew CYWord("default"); }
- | "delete" LexSetRegExp { $$ = CYNew CYWord("delete"); }
+ | "delete" { $$ = CYNew CYWord("delete"); }
| "do" { $$ = CYNew CYWord("do"); }
| "else" { $$ = CYNew CYWord("else"); }
| "enum" { $$ = CYNew CYWord("enum"); }
| "import" { $$ = CYNew CYWord("import"); }
| "!in" { $$ = CYNew CYWord("in"); }
| "!of" { $$ = CYNew CYWord("of"); }
- | "new" LexSetRegExp { $$ = CYNew CYWord("new"); }
+ | "new" { $$ = CYNew CYWord("new"); }
| "null" { $$ = CYNew CYWord("null"); }
| "return" { $$ = CYNew CYWord("return"); }
| "super" { $$ = CYNew CYWord("super"); }
| "throw" { $$ = CYNew CYWord("throw"); }
| "true" { $$ = CYNew CYWord("true"); }
| "try" { $$ = CYNew CYWord("try"); }
- | "typeof" LexSetRegExp { $$ = CYNew CYWord("typeof"); }
+ | "typeof" { $$ = CYNew CYWord("typeof"); }
| "var" { $$ = CYNew CYWord("var"); }
- | "void" LexSetRegExp { $$ = CYNew CYWord("void"); }
+ | "void" { $$ = CYNew CYWord("void"); }
| "while" { $$ = CYNew CYWord("while"); }
| "with" { $$ = CYNew CYWord("with"); }
| "yield" { $$ = CYNew CYIdentifier("yield"); }
- | Yield LexSetRegExp NewLineOpt { $$ = CYNew CYIdentifier("yield"); }
+ | Yield NewLineOpt { $$ = CYNew CYIdentifier("yield"); }
;
@begin ObjectiveC
CoverParenthesizedExpressionAndArrowParameterList
: "(" Expression[expression] ")" { $$ = CYNew CYParenthetical($expression); }
- | "(" LexSetRegExp ")" { $$ = NULL; }
- | "(" LexSetRegExp "..." BindingIdentifier ")" { CYNOT(@$); }
- | "(" Expression "," LexSetRegExp "..." BindingIdentifier ")" { CYNOT(@$); }
+ | "(" ")" { $$ = NULL; }
+ | "(" "..." BindingIdentifier ")" { CYNOT(@$); }
+ | "(" Expression "," "..." BindingIdentifier ")" { CYNOT(@$); }
;
/* }}} */
/* 12.2.4 Literals {{{ */
ElementList
: AssignmentExpressionOpt[value] "," ElementListOpt[next] { $$ = CYNew CYElementValue($value, $next); }
- | LexSetRegExp "..." AssignmentExpression[values] { $$ = CYNew CYElementSpread($values); }
+ | "..." AssignmentExpression[values] { $$ = CYNew CYElementSpread($values); }
| AssignmentExpression[value] { $$ = CYNew CYElementValue($value, NULL); }
;
ElementListOpt
: ElementList[pass] { $$ = $pass; }
- | LexSetRegExp { $$ = NULL; }
+ | { $$ = NULL; }
;
/* }}} */
/* 12.2.6 Object Initializer {{{ */
;
PropertyDefinitionListOpt
- : LexSetRegExp PropertyDefinitionList[properties] { $$ = $properties; }
- | LexSetRegExp { $$ = NULL; }
+ : PropertyDefinitionList[properties] { $$ = $properties; }
+ | { $$ = NULL; }
;
PropertyDefinition
;
MemberExpression
- : LexSetRegExp PrimaryExpression[pass] { $$ = $pass; }
+ : PrimaryExpression[pass] { $$ = $pass; }
| MemberExpression[object] { driver.context_ = $object; } MemberAccess[member] { $member->SetLeft($object); $$ = $member; }
| SuperProperty[pass] { $$ = $pass; }
| MetaProperty { CYNOT(@$); }
- | LexSetRegExp "new" MemberExpression[constructor] Arguments[arguments] { $$ = CYNew cy::Syntax::New($constructor, $arguments); }
+ | "new" MemberExpression[constructor] Arguments[arguments] { $$ = CYNew cy::Syntax::New($constructor, $arguments); }
;
SuperProperty
- : LexSetRegExp "super"[super] { if (!driver.super_.top()) CYERR(@super, "invalid super"); } "[" Expression[property] "]" { $$ = CYNew CYSuperAccess($property); }
- | LexSetRegExp "super"[super] { if (!driver.super_.top()) CYERR(@super, "invalid super"); } "." IdentifierName[property] { $$ = CYNew CYSuperAccess(CYNew CYString($property)); }
+ : "super"[super] { if (!driver.super_.top()) CYERR(@super, "invalid super"); } "[" Expression[property] "]" { $$ = CYNew CYSuperAccess($property); }
+ | "super"[super] { if (!driver.super_.top()) CYERR(@super, "invalid super"); } "." IdentifierName[property] { $$ = CYNew CYSuperAccess(CYNew CYString($property)); }
;
MetaProperty
;
NewTarget
- : LexSetRegExp "new" LexSetRegExp "." "target"
+ : "new" "." "target"
;
NewExpression
: MemberExpression[pass] { $$ = $pass; }
- | LexSetRegExp "new" NewExpression[expression] { $$ = CYNew cy::Syntax::New($expression, NULL); }
+ | "new" NewExpression[expression] { $$ = CYNew cy::Syntax::New($expression, NULL); }
;
CallExpression_
;
SuperCall
- : LexSetRegExp "super"[super] { if (!driver.super_.top()) CYERR(@super, "invalid super"); } Arguments[arguments] { $$ = CYNew CYSuperCall($arguments); }
+ : "super"[super] { if (!driver.super_.top()) CYERR(@super, "invalid super"); } Arguments[arguments] { $$ = CYNew CYSuperCall($arguments); }
;
Arguments
ArgumentList
: AssignmentExpression[value] ArgumentList_[next] { $$ = CYNew CYArgument(NULL, $value, $next); }
- | LexSetRegExp "..." AssignmentExpression { CYNOT(@$); }
+ | "..." AssignmentExpression { CYNOT(@$); }
;
ArgumentListOpt
: ArgumentList[pass] { $$ = $pass; }
- | LexSetRegExp { $$ = NULL; }
+ | { $$ = NULL; }
;
AccessExpression
LeftHandSideExpression
: AccessExpression[pass] LexCrement { $$ = $pass; }
- | LexSetRegExp IndirectExpression[pass] { $$ = $pass; }
+ | IndirectExpression[pass] { $$ = $pass; }
;
/* }}} */
/* 12.4 Postfix Expressions {{{ */
UnaryExpression
: PostfixExpression[expression] LexOpenBrace { $$ = $expression; }
- | LexSetRegExp UnaryExpression_[pass] { $$ = $pass; }
+ | UnaryExpression_[pass] { $$ = $pass; }
;
/* }}} */
/* 12.6 Multiplicative Operators {{{ */
AssignmentExpression
: ConditionalExpression[pass] { $$ = $pass; }
- | LexSetRegExp YieldExpression[pass] { $$ = $pass; }
+ | YieldExpression[pass] { $$ = $pass; }
| ArrowFunction[pass] { $$ = $pass; }
| LeftHandSideAssignment[assignment] AssignmentExpression[rhs] { $assignment->SetRight($rhs); $$ = $assignment; }
;
AssignmentExpressionOpt
: AssignmentExpression[pass] { $$ = $pass; }
- | LexSetRegExp { $$ = NULL; }
+ | { $$ = NULL; }
;
/* }}} */
/* 12.15 Comma Operator ( , ) {{{ */
ExpressionOpt
: Expression[pass] { $$ = $pass; }
- | LexSetRegExp { $$ = NULL; }
+ | { $$ = NULL; }
;
/* }}} */
;
Statement_
- : LexSetRegExp Statement__[pass] { $$ = $pass; }
+ : Statement__[pass] { $$ = $pass; }
| ExpressionStatement[pass] { $$ = $pass; }
;
;
Declaration_
- : LexLet LexSetRegExp Declaration__[pass] { $$ = $pass; }
+ : LexLet Declaration__[pass] { $$ = $pass; }
| LexicalDeclaration[pass] { $$ = $pass; }
;
StatementListOpt
: StatementList[pass] { $$ = $pass; }
- | LexSetStatement LexLet LexSetRegExp { $$ = NULL; }
+ | LexSetStatement LexLet { $$ = NULL; }
;
StatementListItem
;
LetOrConst
- : LexLet LexSetRegExp "!let" LexBind { $$ = false; }
- | LexLet LexSetRegExp "const" { $$ = true; }
+ : LexLet "!let" LexBind { $$ = false; }
+ | LexLet "const" { $$ = true; }
;
BindingList_
: "do" Statement[code] "while" "(" Expression[test] ")" TerminatorOpt { $$ = CYNew CYDoWhile($test, $code); }
| "while" "(" Expression[test] ")" Statement[code] { $$ = CYNew CYWhile($test, $code); }
| "for" "(" LexPushInOn ForStatementInitializer[initializer] LexPopIn ExpressionOpt[test] ";" ExpressionOpt[increment] ")" Statement[code] { $$ = CYNew CYFor($initializer, $test, $increment, $code); }
- | "for" "(" LexPushInOn LexLet LexSetRegExp Var_ LexBind BindingIdentifier[identifier] Initializer[initializer] "!in" LexPopIn Expression[iterable] ")" Statement[code] { $$ = CYNew CYForInitialized(CYNew CYBinding($identifier, $initializer), $iterable, $code); }
+ | "for" "(" LexPushInOn LexLet Var_ LexBind BindingIdentifier[identifier] Initializer[initializer] "!in" LexPopIn Expression[iterable] ")" Statement[code] { $$ = CYNew CYForInitialized(CYNew CYBinding($identifier, $initializer), $iterable, $code); }
| "for" "(" LexPushInOn ForInStatementInitializer[initializer] "!in" LexPopIn Expression[iterable] ")" Statement[code] { $$ = CYNew CYForIn($initializer, $iterable, $code); }
| "for" "(" LexPushInOn ForInStatementInitializer[initializer] "of" LexPopIn AssignmentExpression[iterable] ")" Statement[code] { $$ = CYNew CYForOf($initializer, $iterable, $code); }
;
ForStatementInitializer
- : LexLet LexSetRegExp EmptyStatement[pass] { $$ = $pass; }
+ : LexLet EmptyStatement[pass] { $$ = $pass; }
| LexLet ExpressionStatement_[initializer] ";" { $$ = $initializer; }
- | LexLet LexSetRegExp VariableStatement_[initializer] ";" { $$ = $initializer; }
+ | LexLet VariableStatement_[initializer] ";" { $$ = $initializer; }
| LexicalDeclaration_[initializer] ";" { $$ = $initializer; }
;
ForInStatementInitializer
: LexLet AccessExpression[pass] LexCrement { $$ = $pass; }
- | LexLet LexSetRegExp IndirectExpression[pass] { $$ = $pass; }
- | LexLet LexSetRegExp Var_ LexBind ForBinding[binding] { $$ = CYNew CYForVariable($binding); }
+ | LexLet IndirectExpression[pass] { $$ = $pass; }
+ | LexLet Var_ LexBind ForBinding[binding] { $$ = CYNew CYForVariable($binding); }
| ForDeclaration[pass] { $$ = $pass; }
;
;
ReturnStatement
- : Return LexSetRegExp TerminatorSoft { $$ = CYNew CYReturn(NULL); }
+ : Return TerminatorSoft { $$ = CYNew CYReturn(NULL); }
| Return Expression[value] Terminator { $$ = CYNew CYReturn($value); }
;
/* }}} */
LabelledItem
: Statement[pass] { $$ = $pass; }
- | LexSetStatement LexLet LexSetRegExp FunctionDeclaration[pass] { $$ = $pass; }
+ | LexSetStatement LexLet FunctionDeclaration[pass] { $$ = $pass; }
;
/* }}} */
/* 13.14 The throw Statement {{{ */
;
ThrowStatement
- : Throw[throw] LexSetRegExp TerminatorSoft { CYERR(@throw, "throw without exception"); }
+ : Throw[throw] TerminatorSoft { CYERR(@throw, "throw without exception"); }
| Throw Expression[value] Terminator { $$ = CYNew cy::Syntax::Throw($value); }
;
/* }}} */
;
ArrowFunction
- : LexSetRegExp ArrowParameters[parameters] LexEqualRight "=>" LexNoBrace ConciseBody[code] { $$ = CYNew CYFatArrow($parameters, $code); }
+ : ArrowParameters[parameters] LexEqualRight "=>" LexNoBrace ConciseBody[code] { $$ = CYNew CYFatArrow($parameters, $code); }
;
ArrowParameters
ConciseBody
: AssignmentExpression[expression] { $$ = CYNew CYReturn($expression); }
- | LexSetRegExp ";{" FunctionBody[code] "}" { $$ = $code; }
+ | ";{" FunctionBody[code] "}" { $$ = $code; }
;
/* }}} */
/* 14.3 Method Definitions {{{ */
;
YieldExpression
- : Yield LexSetRegExp NewLineOpt { CYNOT(@$); /* $$ = CYNew CYYieldValue(NULL); */ }
+ : Yield NewLineOpt { CYNOT(@$); /* $$ = CYNew CYYieldValue(NULL); */ }
| Yield AssignmentExpression[value] { CYNOT(@$); /* $$ = CYNew CYYieldValue($value); */ }
- | Yield LexSetRegExp YieldStar AssignmentExpression[generator] { CYNOT(@$); /* $$ = CYNew CYYieldGenerator($generator); */ }
+ | Yield YieldStar AssignmentExpression[generator] { CYNOT(@$); /* $$ = CYNew CYYieldGenerator($generator); */ }
;
/* }}} */
/* 14.5 Class Definitions {{{ */
ScriptBodyOpt
: ScriptBody[pass] { $$ = $pass; }
- | LexSetStatement LexLet LexSetRegExp { $$ = NULL; }
+ | LexSetStatement LexLet { $$ = NULL; }
;
/* }}} */
/* 15.2 Modules {{{ */
;
ModuleItem
- : LexSetStatement LexLet LexSetRegExp ImportDeclaration
- | LexSetStatement LexLet LexSetRegExp ExportDeclaration
+ : LexSetStatement LexLet ImportDeclaration
+ | LexSetStatement LexLet ExportDeclaration
| StatementListItem
;
/* }}} */
| ExportClause FromClause Terminator
| ExportClause Terminator
| VariableStatement
- | "default" LexSetStatement LexSetRegExp HoistableDeclaration
- | "default" LexSetStatement LexSetRegExp ClassDeclaration
+ | "default" LexSetStatement HoistableDeclaration
+ | "default" LexSetStatement ClassDeclaration
| "default" LexSetStatement AssignmentExpression Terminator
;
ExportDeclaration
- : "export" LexSetStatement LexLet LexSetRegExp ExportDeclaration_
+ : "export" LexSetStatement LexLet ExportDeclaration_
| "export" Declaration
;
/* Cycript (Objective-C): @class Declaration {{{ */
ClassSuperOpt
/* XXX: why the hell did I choose MemberExpression? */
- : ":" LexSetRegExp MemberExpression[extends] { $$ = $extends; }
+ : ":" MemberExpression[extends] { $$ = $extends; }
| { $$ = NULL; }
;
ImplementationFieldListOpt
- : LexSetRegExp TypedIdentifier[typed] ";" ImplementationFieldListOpt[next] { $$ = CYNew CYImplementationField($typed, $next); }
- | LexSetRegExp { $$ = NULL; }
+ : TypedIdentifier[typed] ";" ImplementationFieldListOpt[next] { $$ = CYNew CYImplementationField($typed, $next); }
+ | { $$ = NULL; }
;
ImplementationFields
;
TypeOpt
- : "(" LexSetRegExp TypedIdentifier[type] ")" { if ($type->identifier_ != NULL) CYERR($type->location_, "unexpected identifier"); $$ = $type; }
+ : "(" TypedIdentifier[type] ")" { if ($type->identifier_ != NULL) CYERR($type->location_, "unexpected identifier"); $$ = $type; }
| { $$ = CYNew CYTypedIdentifier(CYNew CYTypeVariable("id")); }
;
MessageExpression
: "[" AssignmentExpressionClassic[self] { driver.contexts_.push_back($self); } SelectorList[arguments] "]" { driver.contexts_.pop_back(); } { $$ = CYNew CYSendDirect($self, $arguments); }
- | "[" LexSetRegExp "super" { driver.context_ = NULL; } SelectorList[arguments] "]" { $$ = CYNew CYSendSuper($arguments); }
+ | "[" "super" { driver.context_ = NULL; } SelectorList[arguments] "]" { $$ = CYNew CYSendSuper($arguments); }
;
SelectorExpression_
;
PrimaryExpression
- : "[" LexSetRegExp "&" LexSetRegExp "]" "(" TypedParameterListOpt[parameters] ")" "->" TypedIdentifier[type] BRACE FunctionBody[code] "}" { $$ = CYNew CYLambda($type, $parameters, $code); }
+ : "[" "&" "]" "(" TypedParameterListOpt[parameters] ")" "->" TypedIdentifier[type] BRACE FunctionBody[code] "}" { $$ = CYNew CYLambda($type, $parameters, $code); }
;
/* }}} */
/* Cycript (C): Type Definitions {{{ */
;
Comprehension
- : LexSetRegExp ComprehensionFor[comprehension] ComprehensionTail[next] AssignmentExpression[expression] { $comprehension->SetNext($next); $$ = CYNew CYArrayComprehension($expression, $comprehension); }
+ : ComprehensionFor[comprehension] ComprehensionTail[next] AssignmentExpression[expression] { $comprehension->SetNext($next); $$ = CYNew CYArrayComprehension($expression, $comprehension); }
;
ComprehensionTail
/* }}} */
/* JavaScript FTW: Coalesce Operator {{{ */
ConditionalExpression
- : LogicalORExpression[test] "?" LexPushInOff LexSetRegExp ":" LexPopIn AssignmentExpression[false] { $$ = CYNew CYCondition($test, $test, $false); }
+ : LogicalORExpression[test] "?" LexPushInOff ":" LexPopIn AssignmentExpression[false] { $$ = CYNew CYCondition($test, $test, $false); }
;
/* }}} */
/* JavaScript FTW: Named Arguments {{{ */
ArgumentList
- : LexSetRegExp Word[tag] ":" AssignmentExpression[value] ArgumentList_[next] { $$ = CYNew CYArgument($tag, $value, $next); }
+ : Word[tag] ":" AssignmentExpression[value] ArgumentList_[next] { $$ = CYNew CYArgument($tag, $value, $next); }
;
/* }}} */
/* JavaScript FTW: Ruby Blocks {{{ */
;
RubyProcParameters
- : LexSetRegExp "|" RubyProcParameterList[parameters] "|" { $$ = $parameters; }
- | LexSetRegExp "||" { $$ = NULL; }
+ : "|" RubyProcParameterList[parameters] "|" { $$ = $parameters; }
+ | "||" { $$ = NULL; }
;
RubyProcParametersOpt
: RubyProcParameters[pass] { $$ = $pass; }
- | LexSetRegExp { $$ = NULL; }
+ | { $$ = NULL; }
;
LexOpenBrace