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

self-delimiting parseExp (and others)? #449

Open
jwaldmann opened this issue Apr 24, 2020 · 0 comments
Open

self-delimiting parseExp (and others)? #449

jwaldmann opened this issue Apr 24, 2020 · 0 comments

Comments

@jwaldmann
Copy link

can we make parseExp self-delimiting? The type is

parseExp :: String -> ParseResult (Exp SrcSpanInfo)

but I'd want "maximum munch" and the part that was not eaten,
as in :: String -> ParseResult (.. , String)

I tried

  parseExp "x } foo bar"
ParseFailed (SrcLoc "<unknown>.hs" 1 3) "Unexpected }"

so I could extract the error location, and then re-parse that prefix.
That's feels a bit strange.

(cf. https://mail.haskell.org/pipermail/haskell-cafe/2020-April/132124.html)

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