]> git.saurik.com Git - cycript.git/blobdiff - Cycript.yy.in
Fix cy$getProperty so NSArray .length is primitive.
[cycript.git] / Cycript.yy.in
index aa5f535c616bd268aaeb43a2a156c102f6a98474..3f240e40651a809119b939539255d9c3afb573ed 100644 (file)
 #include "E4X/Syntax.hpp"
 @end
 
+#include "Highlight.hpp"
+
 typedef struct {
     bool newline_;
+    hi::Value highlight_;
 
     union {
         bool bool_;
@@ -532,15 +535,15 @@ LexSetRegExp
     ;
 
 LexNoBrace
-    : { if (yychar == yyempty_) driver.nobrace_ = true; else if (yychar == token::OpenBrace || yychar == token::OpenBrace_) yychar = token::OpenBrace__; }
+    : { if (yychar == yyempty_) driver.no_.OpenBrace = true; else if (yychar == token::OpenBrace || yychar == token::OpenBrace_) yychar = token::OpenBrace__; }
     ;
 
 LexNoFunction
-    : { if (yychar == token::Function) yychar = token::Function_; }
+    : { if (yychar == yyempty_) driver.no_.Function = true; else if (yychar == token::Function) yychar = token::Function_; }
     ;
 
 LexNoAtImplementation
-    : { if (yychar == token::AtImplementation) yychar = token::AtImplementation_; }
+    : { if (yychar == yyempty_) driver.no_.AtImplementation = true; else if (yychar == token::AtImplementation) yychar = token::AtImplementation_; }
     ;
 
 LexSetStatement
@@ -1054,7 +1057,7 @@ StatementList
 
 StatementListOpt
     : StatementList { $$ = $1; }
-    | LexSetRegExp { $$ = NULL; }
+    | LexSetStatement LexSetRegExp { $$ = NULL; }
     ;
 
 StatementListItem
@@ -1318,7 +1321,7 @@ ProgramBody
 
 ProgramBodyOpt
     : ProgramBody { $$ = $1; }
-    | { $$ = NULL; }
+    | LexSetStatement LexSetRegExp { $$ = NULL; }
     ;
 /* }}} */
 
@@ -1491,7 +1494,7 @@ ImportPath
     ;
 
 StatementListItem
-    : "@import" ImportPath { $$ = CYNew CYImport(); }
+    : LexSetStatement LexSetRegExp "@import" ImportPath { $$ = CYNew CYImport(); }
     ;
 /* }}} */
 /* Cycript (Objective-C): Boxed Expressions {{{ */