Skip to content

BigInt & numeric separator support#204

Merged
lahma merged 5 commits into
sebastienros:mainfrom
jogibear9988:fixBigIntAndSep
Nov 4, 2021
Merged

BigInt & numeric separator support#204
lahma merged 5 commits into
sebastienros:mainfrom
jogibear9988:fixBigIntAndSep

Conversation

@jogibear9988
Copy link
Copy Markdown
Contributor

there is not yet a pull request for esprima

Comment thread src/Esprima/Scanner.cs Outdated
Comment thread src/Esprima/Scanner.cs Outdated
{
public readonly string BigInt;

public BigInteger? BigIntValue => (BigInteger?) Value;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we really need to add this as Literal already has that, I think it should be quite cheap to call even with the type check

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

@jogibear9988 jogibear9988 Nov 2, 2021

Choose a reason for hiding this comment

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

Cause I think the AST should be nearly the same in all Javascript Parsers

Comment thread src/Esprima/Scanner.cs Outdated
if (Source.CharCodeAt(Index) == '_')
ThrowUnexpectedToken(Messages.NumericSeperatorNotAllowedHere);

while (!Eof() && (check(Source.CharCodeAt(Index)) || Source.CharCodeAt(Index) == '_')) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

in c# version we always add braces and they should on new line, I think that .editorconfig should enforce these?

Copy link
Copy Markdown
Contributor Author

@jogibear9988 jogibear9988 Nov 2, 2021

Choose a reason for hiding this comment

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

maybe an issue with vs2022?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

might be, just a thing to keep in mind so code is kept consistent

@lahma lahma changed the title bigint & numeric seperator support BigInt & numeric separator support Nov 2, 2021
@jogibear9988
Copy link
Copy Markdown
Contributor Author

is there anything I need to do here?

@lahma
Copy link
Copy Markdown
Collaborator

lahma commented Nov 3, 2021

I guess there's no Esprima PR to diff this against?

@jogibear9988
Copy link
Copy Markdown
Contributor Author

yes, I'll look when I've time to port my changes from esprima-next to esprima (should not be much work). but the development on esprima has nearly come to an halt, yes there were a few merges, but no reaction to questions, many dead branches... and no release since years...

@jogibear9988
Copy link
Copy Markdown
Contributor Author

pull req in esprima: jquery/esprima#2105

Copy link
Copy Markdown
Collaborator

@lahma lahma left a comment

Choose a reason for hiding this comment

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

Good to go, thanks for making the effort to get changes back to original JS project.

@lahma lahma merged commit 5156c3d into sebastienros:main Nov 4, 2021
@jogibear9988 jogibear9988 deleted the fixBigIntAndSep branch January 3, 2022 05:51
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.

3 participants