Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Don't scope decimals as illegal; tokenize decimal marks, illegal identifiers - #319

Merged
winstliu merged 4 commits into
atom:masterfrom
MaximSokolov:numbers
Feb 2, 2016
Merged

winstliu merged 4 commits into
atom:masterfrom
MaximSokolov:numbers

Conversation

@MaximSokolov

Copy link
Copy Markdown
Contributor
// octal
015, 0010, 0o77, 0O10

// hexadecimal
0xFF, 0xff, 0x1123, 0X00111, 0XF1A7

// binary
0b11, 0b0011, 0b11,                 

// decimal
// [(+|-)][digits][.digits][(E|e)[(+|-)]digits]
1E+12
3.1415926
.123456789
3.1E+12
.1e-23

1
1.
.1
1.1
1E+3
1.E3
.1E+3
1.1E+3

// illegal identifiers
1abc
123abc
1$
123$abc
.1a
obj.1
obj.1a
1$.123

Fixes #318

Comment thread spec/javascript-spec.coffee Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this impossible to test for now? Can't we just give numbers higher priority?

@MaximSokolov MaximSokolov changed the title Don't scope decimals as illegal; tokenize decimal marks Don't scope decimals as illegal; tokenize decimal marks, illegal identifiers Feb 1, 2016
@MaximSokolov

Copy link
Copy Markdown
Contributor Author

updated

@winstliu

winstliu commented Feb 1, 2016

Copy link
Copy Markdown
Contributor

Awesome! @chbk would you be so kind to test this as well? 😛

Comment thread grammars/javascript.cson

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.E3 is also possible...it doesn't look like you're catching that right now

@chbk

chbk commented Feb 2, 2016

Copy link
Copy Markdown

Tested and working 👍

@winstliu

winstliu commented Feb 2, 2016

Copy link
Copy Markdown
Contributor

Thanks for testing @chbk!

winstliu pushed a commit that referenced this pull request Feb 2, 2016
Don't scope decimals as illegal; tokenize decimal marks, illegal identifiers
@winstliu
winstliu merged commit 5f406e1 into atom:master Feb 2, 2016
@MaximSokolov
MaximSokolov deleted the numbers branch February 2, 2016 13:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants