Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnexpectedKeyword(Else) #38

Closed
caracal7 opened this issue Jun 30, 2019 · 1 comment
Closed

UnexpectedKeyword(Else) #38

caracal7 opened this issue Jun 30, 2019 · 1 comment

Comments

@caracal7
Copy link

test.js

const fib = n => {
  if(n <= 1) {
    return n;
  } else {
    return fib(n - 1) + fib(n - 2);
  }
}

console.log(fib(10));


let a = "hello world";
a;

result

Hello
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: UnexpectedKeyword(Else)', src/libcore/result.rs:997:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
@jasonwilliams
Copy link
Member

thanks for finding this @caracal7, the output of tokens looks fine https://gist.github.com/jasonwilliams/670694d81dd2d35c13ea00d1ed2eac44

So im guessing the problem is with the parser somewhere:
https://github.com/jasonwilliams/boa/blob/master/src/lib/syntax/parser.rs#L149-L168

Will take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants