Browse Source

fixed immediate object access.

Nicolas Cannasse 19 years ago
parent
commit
acb432f5e8
1 changed files with 5 additions and 1 deletions
  1. 5 1
      parser.ml

+ 5 - 1
parser.ml

@@ -417,7 +417,11 @@ and parse_var_decl = parser
 		| [< >] -> (name,t,None)
 		| [< >] -> (name,t,None)
 
 
 and expr = parser
 and expr = parser
-	| [< '(BrOpen,p1); e = block1; '(BrClose,p2) >] -> (e,punion p1 p2)
+	| [< '(BrOpen,p1); b = block1; '(BrClose,p2); s >] -> 
+		let e = (b,punion p1 p2) in
+		(match b with
+		| EObjectDecl _ -> expr_next e s
+		| _ -> e)
 	| [< '(Const c,p); s >] -> expr_next (EConst c,p) s
 	| [< '(Const c,p); s >] -> expr_next (EConst c,p) s
 	| [< '(Kwd This,p); s >] -> expr_next (EConst (Ident "this"),p) s
 	| [< '(Kwd This,p); s >] -> expr_next (EConst (Ident "this"),p) s
 	| [< '(Kwd Callback,p); s >] -> expr_next (EConst (Ident "callback"),p) s
 	| [< '(Kwd Callback,p); s >] -> expr_next (EConst (Ident "callback"),p) s