Repository navigation
Fix parsing of Double literal trailing whitespace - #1647
Merged
Merged
Conversation
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?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1646