]> git.saurik.com Git - cycript.git/blobdiff - Cycript.yy.in
Make lexer start a comment with #! (for scripts).
[cycript.git] / Cycript.yy.in
index c8a18629aa0a2d8bc749b0389e8bbc8a123f93cb..2c8125ea37c1a0d663f4968f62082dfbc1ac1af5 100644 (file)
@@ -161,7 +161,6 @@ int cylex(YYSTYPE *, cy::location *, void *);
 
 @begin E4X ObjectiveC
 %token At "@"
-%token Pound "#"
 @end
 
 %token Ampersand "&"
@@ -1054,11 +1053,11 @@ AssignmentExpression
 /* 11.14 Comma Operator {{{ */
 Expression_
     : "," Expression { $$ = $2; }
-    | { $$ = CYNew CYCompound(); }
+    | { $$ = NULL; }
     ;
 
 Expression
-    : AssignmentExpression Expression_ { $2->AddPrev($1); $$ = $2; }
+    : AssignmentExpression Expression_ { $$ = CYNew CYCompound($1, $2); }
     ;
 
 ExpressionOpt
@@ -1449,7 +1448,7 @@ IntegerType
 
 IntegerTypeOpt
     : IntegerType { $$ = $1; }
-    |
+    | { $$ = CYNew CYTypeVariable("int"); }
     ;
 
 PrimitiveType
@@ -1470,7 +1469,7 @@ EncodedType
     ;
 
 PrimaryExpression
-    : AtEncode "(" EncodedType ")" { $$ = $3; }
+    : "@encode" "(" EncodedType ")" { $$ = $3; }
     ;
 /* }}} */
 /* Cycript (Objective-C): @class Declaration {{{ */
@@ -1481,7 +1480,7 @@ ClassSuperOpt
     ;
 
 ClassFieldListOpt
-    : Expression Identifier ";" ClassFieldListOpt { $$ = CYNew CYField($1, $2, $4); }
+    : TypedIdentifier ";" ClassFieldListOpt { $$ = CYNew CYField($1, $3); }
     | LexSetRegExp { $$ = NULL; }
     ;
 
@@ -1665,7 +1664,7 @@ PrimaryExpression
 /* }}} */
 /* Cycript (Objective-C): Instance Literals {{{ */
 PrimaryExpression
-    : "#" NumericLiteral { $$ = CYNew CYInstanceLiteral($2); }
+    : "^" NumericLiteral { $$ = CYNew CYInstanceLiteral($2); }
     ;
 /* }}} */
 @end