Browse Source

arrow function is working

pull/20/head
Jason Williams 6 years ago
parent
commit
741b55806e
  1. 1
      .gitignore
  2. 5
      src/lib/syntax/lexer.rs
  3. 12
      tests/js/test.js

1
.gitignore vendored

@ -1,3 +1,4 @@
target
**/*.rs.bk
node_modules
.DS_Store

5
src/lib/syntax/lexer.rs

@ -419,7 +419,10 @@ impl<'a> Lexer<'a> {
} else {
Punctuator::Eq
}, Punctuator::Assign, {
'>' => Punctuator::Arrow
'>' => {
self.next()?;
Punctuator::Arrow
}
}),
'<' => op!(self, Punctuator::LessThanOrEq, Punctuator::LessThan, {
'<' => vop!(self, Punctuator::AssignLeftSh, Punctuator::LeftSh)

12
tests/js/test.js

@ -1,7 +1,9 @@
function getConf() {
const conf = "JSConf EU";
if (conf == "JSConf EU") {
const b = "bar";
return conf;
}
let jase = () => {
console.log("Hello");
};
jase();
}
getConf();

Loading…
Cancel
Save