%type <bool_> MessageScope
%type <type_> ModifiedType
%type <typedIdentifier_> PrefixedType
+%type <expression_> PrimitiveType
%type <type_> QualifiedType
%type <argument_> SelectorCall_
%type <argument_> SelectorCall
PropertyDefinitionList_
: "," PropertyDefinitionList { $$ = $2; }
- | "," { $$ = NULL; }
+ | "," LexSetRegExp { $$ = NULL; }
| { $$ = NULL; }
;
PropertyDefinitionListOpt
: PropertyDefinitionList { $$ = $1; }
- | { $$ = NULL; }
+ | LexSetRegExp { $$ = NULL; }
;
PropertyDefinition
/* }}} */
/* 12.9 The return Statement {{{ */
ReturnStatement
- : "return" "\n" StrictSemi { $$ = CYNew CYReturn(NULL); }
+ : "return" LexSetRegExp "\n" StrictSemi { $$ = CYNew CYReturn(NULL); }
| "return" ExpressionOpt Terminator { $$ = CYNew CYReturn($2); }
;
/* }}} */
/* }}} */
/* 12.13 The throw Statement {{{ */
ThrowStatement
- : "throw" "\n" StrictSemi { YYABORT; }
+ : "throw" LexSetRegExp "\n" StrictSemi { YYABORT; }
| "throw" Expression Terminator { $$ = CYNew cy::Syntax::Throw($2); }
;
/* }}} */
ConciseBody
: AssignmentExpression { $$ = CYNew CYReturn($1); }
- | ";{" LexPushInOff FunctionBody LexPopIn "}" { $$ = $3; }
+ | LexSetRegExp ";{" LexPushInOff FunctionBody LexPopIn "}" { $$ = $4; }
;
/* }}} */
/* 14 Program {{{ */
| "*" PrefixedType { CYSetLast($2->type_) = CYNew CYTypePointerTo(); $$ = $2; }
;
+PrimitiveType
+ : Variable { $$ = $1; }
+ | "void" { $$ = CYNew cy::Syntax::New(CYNew CYVariable(CYNew CYIdentifier("Type")), CYNew CYArgument(CYNew CYString("v"))); }
+ ;
+
QualifiedType
- : Variable { $$ = CYNew CYTypeVariable($1); }
+ : PrimitiveType { $$ = CYNew CYTypeVariable($1); }
| "const" QualifiedType { $$ = CYNew CYTypeConstant($2); }
;
ClassFieldListOpt
: Expression Identifier ";" ClassFieldListOpt { $$ = CYNew CYField($1, $2, $4); }
- | { $$ = NULL; }
+ | LexSetRegExp { $$ = NULL; }
;
ClassFields
TypeOpt
: "(" LexSetRegExp EncodedType ")" { $$ = $3; }
- | "(" LexSetRegExp "void" ")" { $$ = CYNew CYString("v"); }
| { $$ = NULL; }
;