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 currency/dollar value #31

Open
cogentParadigm opened this issue Jan 24, 2023 · 0 comments
Open

Support currency/dollar value #31

cogentParadigm opened this issue Jan 24, 2023 · 0 comments

Comments

@cogentParadigm
Copy link

Thanks for sharing this work! I would like to parse dollar values in my expression, for example:

$1,500.75 - $200.00

I'm not sure the best way to do this, but it looks like I can create a custom Lexer and add a token definition with an custom pattern that will match dollar values.

However, I would still need to parse the token into a float. For TokenType::RealNumber this happens in the Node::factory method which is called from the private function shuntingYard in the the Parser class. This doesn't look easily extendable.

Do you have any suggestions on how I should go about this?

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

No branches or pull requests

1 participant