-
Notifications
You must be signed in to change notification settings - Fork 11
Implement negatively signed numbers #39
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
base: master
Are you sure you want to change the base?
Conversation
|
Obviously the changes in commit ee2a4ae should be ignored. Test cases maybe should be increased to check for strings such as |
go.mod
Outdated
| @@ -1,4 +1,4 @@ | |||
| module github.com/bzick/tokenizer | |||
| module github.com/kettek/tokenizer | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you change back to github.com/bzick/tokenizer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| } else { | ||
| break | ||
| } | ||
| } else if !hasExp && p.curr == '-' { // Allow starting numbers from a negative sign. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I analyzed this and realized it breaks backward compatibility. Let's make it a separate setting, something like "negative number parsing" settings.
With the current implementation, having negative numbers, such as "-9" or "-9.99" will not be parsed as numbers but rather as keywords. This adjustments properly sets the start of number parsing to include the sign.