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

Create Number parser #132

Merged
merged 5 commits into from
Jun 15, 2024
Merged

Create Number parser #132

merged 5 commits into from
Jun 15, 2024

Conversation

sebastienros
Copy link
Owner

Fixes #106
Fixes #130

@sebastienros
Copy link
Owner Author

@lahma was able to delete TokenResult and use ReadOnlySpan<char> instead.
@gumbarros this should allow to remove the custom logic in ncalc

@gumbarros
Copy link
Contributor

@lahma was able to delete TokenResult and use ReadOnlySpan<char> instead. @gumbarros this should allow to remove the custom logic in ncalc

Nice, will this also work in the exponent parser https://github.com/ncalc/ncalc/pull/193/files?

Copy link
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.

Now a small feat implementing this! Added some comments, maybe some make sense, maybe not. Would be nice to see perf numbers for before/after.

src/Parlot/Fluent/DoubleLiteral.cs Outdated Show resolved Hide resolved
src/Parlot/Fluent/FloatLiteral.cs Outdated Show resolved Hide resolved
src/Parlot/Fluent/Helpers.cs Show resolved Hide resolved
src/Parlot/Fluent/NumberLiteral.Net80.cs Outdated Show resolved Hide resolved
src/Parlot/Fluent/NumberLiteral.cs Outdated Show resolved Hide resolved
src/Parlot/Fluent/ParseContext.cs Outdated Show resolved Hide resolved
src/Parlot/Scanner.cs Outdated Show resolved Hide resolved
src/Parlot/Scanner.cs Outdated Show resolved Hide resolved
src/Parlot/Scanner.cs Outdated Show resolved Hide resolved
src/Parlot/Scanner.cs Outdated Show resolved Hide resolved
@sebastienros
Copy link
Owner Author

@gumbarros I made NumberLiteralBase public such that you can create custom parser type and logic that will still use Parlot internally.

@lahma I made flags even faster by pre-computing them!

@sebastienros sebastienros enabled auto-merge (squash) June 15, 2024 17:48
@sebastienros sebastienros merged commit afc46f5 into main Jun 15, 2024
1 check passed
@sebastienros sebastienros deleted the sebros/number branch June 15, 2024 17:49
This pull request was closed.
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.

Add culture support for number parsers Native support for scientific notation
4 participants