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

Fix parsing of Double literal trailing whitespace #1647

Merged
merged 1 commit into from
Jan 28, 2020
Merged

Conversation

Gabriella439
Copy link
Collaborator

Fixes #1646

Copy link
Collaborator

@sjakobi sjakobi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mergify mergify bot merged commit 4c829a5 into master Jan 28, 2020
@mergify mergify bot deleted the gabriel/1646 branch January 28, 2020 05:26
Gabriella439 added a commit that referenced this pull request Feb 21, 2020
The fix from #1647 broke GHCJS support for Dhall.  Specifically, any Dhall
code containing numeric literals would fail to parse when using GHCJS.

The consequence of this is that the final example from the online demo
currently does not work because it uses at least one number.

The root cause was this issue:

ghcjs/ghcjs-base#62

The change to use `Text.Megaparsec.Char.Lexer.float` triggered the above
problem, because `float` depended transitively on `Data.Char.toTitle` which
was not working for the version of GHCJS that we currently build against.

The fix is to reimplement the logic for parsing double literals by
following the standard grammar instead of reusing an existing utility.
However, I cribbed quite a bit from the existing logic for
`Text.Parser.Char.double` along the way.
mergify bot pushed a commit that referenced this pull request Feb 22, 2020
* Fix numeric parsing for GHCJS

The fix from #1647 broke GHCJS support for Dhall.  Specifically, any Dhall
code containing numeric literals would fail to parse when using GHCJS.

The consequence of this is that the final example from the online demo
currently does not work because it uses at least one number.

The root cause was this issue:

ghcjs/ghcjs-base#62

The change to use `Text.Megaparsec.Char.Lexer.float` triggered the above
problem, because `float` depended transitively on `Data.Char.toTitle` which
was not working for the version of GHCJS that we currently build against.

The fix is to reimplement the logic for parsing double literals by
following the standard grammar instead of reusing an existing utility.
However, I cribbed quite a bit from the existing logic for
`Text.Parser.Char.double` along the way.

* Add comment explaining the hand-written parsing code

... as suggested by @sjakobi

* Work around GHC parsing bug

For some reason `-- * ${URL}` is not allowed in a comment?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

parser error using double followed by another value
2 participants