-
Notifications
You must be signed in to change notification settings - Fork 84
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
Implement "Principled parsing for indentation-sensitive languages" #235
Comments
Thanks for opening this. I was pointed to that paper, and also saddened we were not already using it. |
https://michaeldadams.org/papers/layout_parsing/LayoutParsing.pdf here is the PDF from the author's website, without paywall. |
https://michaeldadams.org/projects/happy-indent/happy.indent.tar.gz (from https://michaeldadams.org/projects/) is the source code behind the things in the paper. Do note that Happy was still in darcs then, so we will need to do some careful surgery to get just the fork parts as a branch off the right commit in this git repo. |
happy.indent.tar.gz is a copy of the download just in case something were to happen to the author's website. |
Is the work of Michael Adams production-ready? Looking at his paper, it seems that he has given a new grammar formalism IS-CFG (indentation sensitive context free grammars) and explained how to generate a parser. |
See also: https://gitlab.haskell.org/ghc/ghc/-/issues/25322, which is another solution to having phase separation between the lexer and parser |
Principled parsing for indentation-sensitive languages [pdf] lays out a way for extending parser generators like Happy with the ability to directly deal with indentation-sensitive languages like Haskell. The paper mentions that a patch was made to extend Happy with this functionality, but afaict this was never merged into Happy.
Why hasn't this yet been added to Happy? Did nobody have the time to finish off and optimise this work, or is there another reason?
The text was updated successfully, but these errors were encountered: