Replies: 1 comment 3 replies
-
I think you should look into projects with a productive extensible quality TypeScript grammar support Beyond just the parsing level, also at the code generation level... |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I am trying to use chevrotain to extend the syntax of ts.
Create a new file named ovs type, which is oop viewer syntax.
I only need to extend a syntax for ts, called renderDom, the syntax definition is as follows
code
I will convert code to
Convert to Vue's rendering function
https://vuejs.org/api/render-function.html#h
This function seems simple, but I have some difficulty doing it.
Because I can't find a ready-made chevrotain syntax file for typescript, I only found the syntax file for ECMA5, I need to create a typescript syntax file based on the ecma5 syntax file
Then convert all project codes including renderDom into ts code through the typescript syntax file based on chevrotain
I also need to convert the cst generated by chevrotain's typescript syntax file to the official typescript ast, and then convert the typescript ast to typescript code through the official ts api
I need to write by hand
Extend the typescript syntax based on ecma5
Convert chevrotain-typescript-cst to typescript-ast
But I can't find any other more convenient way. Is this the right way to do it?
Beta Was this translation helpful? Give feedback.
All reactions