Skip to content

How to parse real numbers? #237

Answered by zesterer
duskmoon314 asked this question in Q&A
Dec 27, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

I think you're fairly close with this as-is. You might find the number parser in the json.rs example to be useful, it pretty much does what you're looking for.

Lexing tokens like this is definitely the sort of thing that's currently a bit verbose in chumsky today. This will be improving though! The soon-to-be-merged zero-copy branch will include a regex combinator, allowing you to parse something like this in a single line!

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@duskmoon314
Comment options

@zesterer
Comment options

Answer selected by duskmoon314
# for free to join this conversation on GitHub. Already have an account? # to comment
Category
Q&A
Labels
None yet
2 participants