nerdsupremacist / Syntax

Write value-driven parsers quickly in Swift with an intuitive SwiftUI-like DSL
https://quickbirdstudios.com/blog/swift-string-parse/
MIT License
147 stars 10 forks source link

Variables #7

Closed markusmoenig closed 3 years ago

markusmoenig commented 3 years ago

Hi, this looks cool. Is it still supported ?

I am looking into writing an easy meta language which would transpile to Metal. But for this I would need Variables, any plans to adding these in the future ?

Thanks

nerdsupremacist commented 3 years ago

Hi Markus,

I'm not sure I understand what it is you want. But we can definitely check if there's some cool feature we can look at here.

So do you mean having like variables to parametrize parsing? Or do you mean variables in the language you want to parse?

If it's the latter I'm not sure there's much we can do at this level. This library should give you the equivalent to a Syntax Tree. You have to specify how variables look and then deal with them afterwards. Here's an example of a repo that is parsing variables: https://github.com/nerdsupremacist/graphql-syntax

markusmoenig commented 3 years ago

Thanks for the answer, yes that was what I was looking for, the link helps a lot.