Replies: 1 comment 1 reply
-
Hey! That’s really interesting. Storing a specific Boolean type would be totally fine, and makes sense. Parsing and storing whitespace in the AST could work. The one that might be a bit harder is comments since they’re eliminated separately in a pre-pass right now. So, that would probably be the hardest part, since we’d need to reconsider how comments are parsed from the ground up, and check for them somewhere where they’re caught absolutely everywhere... |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there!
First of all, thank you for making Ink available for all, I really love this system and I try to find any excuse to use it on all my projects :D.
I've been working on a project lately that requires me to recreate the Ink after adding some modifications to it (we're adding automatic ids to every line for voiceover / I18N) and I've found it difficult to recreate the Ink exactly from an AST. Basically, I'm trying to write a "Ink to Ink" parser 🙂 .
I was wondering if changes that make this process easier would be accepted upstream: As an example, one of the changes I had to do was create a
BooleanNumber
class and return that instead of a normalNumber
when parsing thetrue/false
case. That one was innocuous but something more "controversial" like whitespace should also be saved to help with this task (the Roslyn compiler also does this, they call it "Syntax trivia"), maybe with an option so the cost is not paid when not needed.I'll appreciate any thoughts on this, and thanks again!
Beta Was this translation helpful? Give feedback.
All reactions