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

p199 potential missing consideration when parsing numbers? #352

Open
xr opened this issue Aug 24, 2016 · 0 comments
Open

p199 potential missing consideration when parsing numbers? #352

xr opened this issue Aug 24, 2016 · 0 comments

Comments

@xr
Copy link

xr commented Aug 24, 2016

book p199 ended up the parsing numbers part.

But how about the following test case:

it('can parse plus number', function() {
  var fn = parse('+2');
  expect(fn()).toBe(2);
});

I already noticed on page 194 said:

You may have noticed we’re only considering positive integers here. That is because we will handle negative numbers differently, by considering the minus sign as an operator instead of being part of the number itself.

But why didn't we consider about "+3" -> 3 case? Or am I wrong or sth?

BTW, thanks for your work, cheers!

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

1 participant