-
-
Notifications
You must be signed in to change notification settings - Fork 353
Add COMMENT tokens to the parser and AST #881
Copy link
Copy link
Open
Labels
hackerThis will require expert use of golang, mgmt, concurrency, algorithms, or even complicated testing.This will require expert use of golang, mgmt, concurrency, algorithms, or even complicated testing.help wanted
Description
Metadata
Metadata
Assignees
Labels
hackerThis will require expert use of golang, mgmt, concurrency, algorithms, or even complicated testing.This will require expert use of golang, mgmt, concurrency, algorithms, or even complicated testing.help wanted
In our lexer (in lexer.nex) we drop all the comments found. This made it easier to write the parser, and is common practice, but we actually need to parse them if we want to eventually have an
mgmt fmttype tool that prints out the parsed AST.As a result, we'd like to add them in wherever they are needed to
parser.y. If you are a yacc or goyacc expert, we'd appreciate the help! If you can do this in a minimally invasive way, such that it doesn't make the whole thing wholly unreadable, that would be lovely.This will need a bunch of new tests in TestAstFunc1/ or TestAstFunc2/ or perhaps it's even better to have a TestAstFuncX that is specialized for looking at parsed AST shape?
Once this is done, we can "print" out the AST to get back the original source (or our formatted version of it of course!)
A future step is removing the required trailing comma on single line lists and similar...