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 floating point numbers without leading zero digit #215

Closed
tsandall opened this issue Jan 16, 2017 · 0 comments
Closed

Support floating point numbers without leading zero digit #215

tsandall opened this issue Jan 16, 2017 · 0 comments

Comments

@tsandall
Copy link
Member

The parser requires that floating point numbers include a leading zero digit, for example:

torin:~$ opa run
OPA 0.3.2-dev (commit ad52c56-dirty, built at 2017-01-16T17:34:27Z)

Run 'help' to see a list of commands.

> 0.5
0.5
> .5
|
error: 1 error occurred: 1:2: no match found, unexpected '.'

The parser should be updated to support FP numbers with and without the leading zero digit.

tsandall added a commit to tsandall/opa that referenced this issue Jan 17, 2017
These changes update the grammar to allow floating point literals without an
integer part, i.e., just the fraction part (.1, -.1, etc.)

Fixes open-policy-agent#215
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