rbelly 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc CHANGED
@@ -1,5 +1,9 @@
1
1
  = RBelly CHANGELOG
2
2
 
3
+ == 0.2.0
4
+
5
+ * Added a bellejs keyword, 'import' to the valid things that can be parsed.
6
+
3
7
  === 0.0.1
4
8
 
5
9
  * Pulled down RKelly, got it running ,under a different name.
data/lib/parser.y CHANGED
@@ -10,6 +10,9 @@ token BREAK CASE CATCH CONST CONTINUE DEBUGGER DEFAULT DELETE DO ELSE ENUM
10
10
  token FINALLY FOR FUNCTION IF IN INSTANCEOF NEW RETURN SWITCH THIS THROW TRY
11
11
  token TYPEOF VAR VOID WHILE WITH
12
12
 
13
+ /* Bellejs Keywords */
14
+ token IMPORT
15
+
13
16
  /* punctuators */
14
17
  token EQEQ NE /* == and != */
15
18
  token STREQ STRNEQ /* === and !== */
@@ -70,6 +73,7 @@ rule
70
73
  | ThrowStatement
71
74
  | TryStatement
72
75
  | DebuggerStatement
76
+ | ImportStatement
73
77
  ;
74
78
 
75
79
  Literal:
@@ -571,6 +575,10 @@ rule
571
575
  | IDENT Initializer { result = VarDeclNode.new(val[0], val[1], true) }
572
576
  ;
573
577
 
578
+ ImportStatement:
579
+ IMPORT Expr ';' { result = ImportNode.new(val[1]) }
580
+ ;
581
+
574
582
  Initializer:
575
583
  '=' AssignmentExpr { result = AssignExprNode.new(val[1]) }
576
584
  ;