Browse Source

bumping version

pull/1/head
Jason Williams 6 years ago
parent
commit
6590416a40
  1. 2
      Cargo.toml
  2. 13
      src/lib/syntax/parser.rs
  3. 2
      tests/js/defineVar.js

2
Cargo.toml

@ -1,6 +1,6 @@
[package] [package]
name = "Boa" name = "Boa"
version = "0.1.2" version = "0.1.3"
authors = ["Jason Williams <jase.williams@gmail.com>"] authors = ["Jason Williams <jase.williams@gmail.com>"]
description = "Boa is a Javascript lexer, parser and Just-in-Time compiler written in Rust. Currently, it has support for some of the language." 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" homepage = "https://github.com/jasonwilliams/boa"

13
src/lib/syntax/parser.rs

@ -7,12 +7,14 @@ use syntax::ast::punc::Punctuator;
use syntax::ast::token::{Token, TokenData}; use syntax::ast::token::{Token, TokenData};
macro_rules! mk ( macro_rules! mk (
($this:expr, $def:expr) => ( ($this:expr, $def:expr) => {
Expr::new($def, try!($this.get_token($this.pos)).pos, try!($this.get_token($this.pos)).pos) {
); 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, $first:expr) => {
Expr::new($def, $first.pos, try!($this.get_token($this.pos)).pos) Expr::new($def, $first.pos, try!($this.get_token($this.pos)).pos)
); };
); );
/// ParseError is an enum which represents errors encounted during parsing an expression /// ParseError is an enum which represents errors encounted during parsing an expression
@ -53,7 +55,6 @@ impl Parser {
let result = try!(self.parse()); let result = try!(self.parse());
exprs.push(result); exprs.push(result);
} }
println!("{}", exprs[0]);
Ok(mk!(self, ExprDef::BlockExpr(exprs))) Ok(mk!(self, ExprDef::BlockExpr(exprs)))
} }

2
tests/js/defineVar.js

@ -1 +1 @@
var a var a = 'Jason';
Loading…
Cancel
Save