-
Notifications
You must be signed in to change notification settings - Fork 395
[ refactor ] move parser into Idris #3652
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
base: main
Are you sure you want to change the base?
Conversation
|
This is currently failing due to pack having a internal dependency on Idris file structure, so this should be pulled before the pack pr |
|
It looks like it also breaks idris2-lsp and katla. |
Fixed! |
|
I'm not sure I see the point of this type of PR:
all in the name of "improv[ing] readability", a subjective outcome? We have fairly limited people power (with e.g. much higher priority structural PRs |
|
Made some updates to the description |
|
Working on #3513 to move forward with coming updates |
Agreeed |
Description
Currently, the Idris 2 parser is split into three places
src/Libraries/Textwhich defines the core parsing environment (independent of the Idris syntax)src/Parser, which defines part of the Idris syntaxsrc/Idris/Parser.idrandsrc/Idris/Parser/Let.idr, which define the rest of the parser (and the final general parsing methods)The last two of these seem like they should be in the same place, preferably in
src/Idris/Parser, as they are Idris front-end components. So, as a part of #3369, this is intended to make the parser organization more understandable for new contributors, as well as new syntaxParser.*toIdris.Parser.Core.*src/Idris/Parser/Basic.idrintosrc/Idris/Parser/Source.idrsrc/Idris/Parser/Repl.idr, and makessrc/Idris/Parser.idrre-exports all of them.Ultimately, this means that the directory
src/Idris/Parsercontains all of the Idris specific parser code, and also splits up the parser to be less large (granted,src/Idris/Parser/Source.idris still nearly 2000 lines long, butsrc/Idris/Parser.idrwas nearly 3000 lines long).Apart from this the changes include:
src/Idris/Parser/Basic.idrandsrc/Idris/Parser/Source.idrthat are used in one of the other files (as they are now separate)While refactors are annoying to deal with and take up time, I believe that this, given its simplicity (almost everything is just copy pasted from one file to another), is worth the time.
I might note that this starts with the following:
Self-check
CONTRIBUTING.mdand I've updated
CONTRIBUTORS.mdwith my name.implementation, I have updated
CHANGELOG_NEXT.md