Skip to content

Having a look at integrating rowan/logos/lalrpop #5

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

ratmice
Copy link
Owner

@ratmice ratmice commented Mar 19, 2020

For the unicode ↔ ascii formatter to work it needs a form of concrete syntax tree,
rowan seems like the thing to use, and seems fairly straightforward to integrate with logos...

  • lexer iterator iterating over rowan SyntaxKinds.

  • parser, the main difficulty here is that lalrpop wants an enum, and it seems silly sending lalrpop an,
pub enum RowanToken {
  Token(lex::LexToken, SmolStr) 
}

It's solidly ugly to pattern match in lalrpop but it does seems to work...

Bottom-up

The current GreenNodeBuilder seems primarily geared towards top-down parsers,
the path of least resistence in lalrpop is bottom-up.

Lifetimes:

Returning from the parser, via e.g. GreenNodeBuilder::finish currently doesn't work,
It seems something like the NodeCache (which I think is private), might be a usable API for bottom-up construction, and fix this too, essentially building iterators from the bottom up, I imagine for this would have to return [Leaf;1], at the bottom...


  • ensure behavior is well defined.

@ratmice ratmice force-pushed the rowan branch 2 times, most recently from 317729b to e40da56 Compare March 21, 2020 08:33
@ratmice
Copy link
Owner Author

ratmice commented Mar 23, 2020

I think this is pretty much stalled until i can get bottom-up construction and lifetimes

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

Successfully merging this pull request may close these issues.

1 participant