diff --git a/Cargo.toml b/Cargo.toml index 053bb5579e..42715646b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "Boa" -version = "0.1.2" +version = "0.1.3" authors = ["Jason Williams "] description = "Boa is a Javascript lexer, parser and Just-in-Time compiler written in Rust. Currently, it has support for some of the language." homepage = "https://github.com/jasonwilliams/boa" diff --git a/src/lib/syntax/parser.rs b/src/lib/syntax/parser.rs index 787e2f8d05..467455ae4e 100644 --- a/src/lib/syntax/parser.rs +++ b/src/lib/syntax/parser.rs @@ -7,12 +7,14 @@ use syntax::ast::punc::Punctuator; use syntax::ast::token::{Token, TokenData}; macro_rules! mk ( - ($this:expr, $def:expr) => ( - Expr::new($def, try!($this.get_token($this.pos)).pos, try!($this.get_token($this.pos)).pos) - ); - ($this:expr, $def:expr, $first:expr) => ( + ($this:expr, $def:expr) => { + { + Expr::new($def, try!($this.get_token($this.pos)).pos, try!($this.get_token($this.pos)).pos) + } + }; + ($this:expr, $def:expr, $first:expr) => { Expr::new($def, $first.pos, try!($this.get_token($this.pos)).pos) - ); + }; ); /// ParseError is an enum which represents errors encounted during parsing an expression @@ -53,7 +55,6 @@ impl Parser { let result = try!(self.parse()); exprs.push(result); } - println!("{}", exprs[0]); Ok(mk!(self, ExprDef::BlockExpr(exprs))) } diff --git a/tests/js/defineVar.js b/tests/js/defineVar.js index bba55c721b..4a9a312b05 100644 --- a/tests/js/defineVar.js +++ b/tests/js/defineVar.js @@ -1 +1 @@ -var a \ No newline at end of file +var a = 'Jason'; \ No newline at end of file