-
Notifications
You must be signed in to change notification settings - Fork 40
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
Custom DSL support with instaparse #216
Comments
This is a cool idea, but we should do it by fixing ys to use arbitrary clojure libraries. I created this repo https://github.com/ingydotnet/instayaml?tab=readme-ov-file to start playing around with getting this to work. Please take a look. Also, Instaparse might be useful for replacing the YS custom parser in |
@delonnewman ^^ |
Fixed the YS bug on the [devel(https://github.com/yaml/yamlscript/tree/devel) branch. I'll release that fix in YS v0.1.91. Until then you can checkout that branch and run |
Cleaned up everything in step06: https://github.com/ingydotnet/instayaml/blob/main/step06/ReadMe.md I'll add first class Pod loading to the That's about as far as we can go with instaparse since the original won't work with ys; just the pod version. Here's the Pod Registry: https://github.com/babashka/pod-registry
We really want to be able to use non-Pod external libs and that will take a bit more work. |
How cool it would be to able to parse any string to yaml using ebnf in yamlscript ... or script your own scripting language with yamlscript?
Adding support for instaparse would do it. The parsetree from the instaparser could be easily transformed to YAML for further processing in yamlscript.
Here's a simple example:
This prints "(foo,bar,zyx)=>foo+bar>zyx" as:
And second example turns "1+(5/3)*2" to output.yaml file:
The text was updated successfully, but these errors were encountered: