Last active
April 10, 2023 01:38
-
-
Save deanebarker/fb292bc4f4cfea320904ca84d0b39db6 to your computer and use it in GitHub Desktop.
An implementation of Emmet in C# using Parlot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Moved to a permanent repo here: https://github.com/deanebarker/Nemmet |
Author
NonwhiteSpace should work, maybe I should add a unit test and see why it may fail.
You can pass a custom Context class that would have "LastParent" and then when a Up/Down/Next is found you can read the LastParent property. You are storing some information about what you parse for later when it needs to use it.
Author
Weirdly, changing it to this...
.And(Literals.NonWhiteSpace())
...breaks with or without quotes.
Author
I just realized if we got rid of the >^+ business and derived that based on indentation (see lines 22-29), then we'd essentially have re-created HAML.
UPDATE: and here we go... https://gist.github.com/deanebarker/fb292bc4f4cfea320904ca84d0b39db6#file-pleasehaml__donthurtem-cs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@sebastienros
I thought about this, but I'm not worried about it. That's a trivial step, and it's so much easier and clearer to parse to a serial list. Trying to organize the hierarchy within the parser would complicate it enormously for no practical benefit. Parsing is hard enough to understand as it is.