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

Support for JavaScript octal and binary numbers (in ES6) #597

Merged
merged 1 commit into from
Jun 14, 2015
Merged

Support for JavaScript octal and binary numbers (in ES6) #597

merged 1 commit into from
Jun 14, 2015

Conversation

apfelbox
Copy link
Contributor

This will add support octal and binary numbers:

var a = 0o01234567;
var b = 0o101;

I also removed a duplicate negative sign for Infinity.

Fixes part of #111

@apfelbox apfelbox mentioned this pull request Jun 14, 2015
@apfelbox
Copy link
Contributor Author

You can merge #596 before this one, so I can rebase my PR based on these javascript changes.

@Golmote
Copy link
Contributor

Golmote commented Jun 14, 2015

I just merged #596. Let me know when this PR is updated.

@apfelbox
Copy link
Contributor Author

So, i just rebased and squashed the changes in one commit.

Ready to be merged @Golmote

@Golmote
Copy link
Contributor

Golmote commented Jun 14, 2015

Sorry, can you do it again?

@apfelbox
Copy link
Contributor Author

@Golmote no problem, done.

Golmote added a commit that referenced this pull request Jun 14, 2015
Support for JavaScript octal and binary numbers (in ES6)
@Golmote Golmote merged commit 6f2cd4e into PrismJS:gh-pages Jun 14, 2015
@loganfranken
Copy link
Contributor

Hey @vkbansal, maybe I'm wrong, but it doesn't look like operators are highlighted as part of numbers with Prism currently:
http://codepen.io/loganfranken/pen/gpxaLe

So it would seem to fall in line that -Infinity shouldn't be highlighted as a number (if the minus operator in -123 isn't highlighted as number, for example).

Totally let me know if I'm missing something, though!

@apfelbox
Copy link
Contributor Author

@vkbansal @loganfranken even easier than that. If you take a closer look at the braces in the regex, you will see that only Infinity has a negative sign. That is because that whole match already has a negative sign at the beginning – and therefore the one right before Infinity is duplicate.

2015-06-14 at 21 31

@loganfranken you are right, the regex matches it, but it isn't included in the token. Because of this it will be highlighted as operator later on.

@apfelbox apfelbox deleted the es6-numbers branch June 14, 2015 19:34
@loganfranken
Copy link
Contributor

@apfelbox Ahh, thanks for clearing that up!

@vkbansal
Copy link
Contributor

@apfelbox thanks for the clarification :)

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

Successfully merging this pull request may close these issues.

None yet

4 participants