Visitar URL original
Fix parsing of `Double` literal trailing whitespace by Gabriella439 · Pull Request #1647 · dhall-lang/dhall-haskell · GitHub
Skip to content

Fix parsing of Double literal trailing whitespace - #1647

Merged
mergify[bot] merged 1 commit into
masterfrom
gabriel/1646
Jan 28, 2020
Merged

mergify[bot] merged 1 commit into
masterfrom
gabriel/1646

Conversation

@Gabriella439

Copy link
Copy Markdown
Collaborator

Fixes #1646

@sjakobi sjakobi left a comment

Copy link
Copy Markdown
Collaborator

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