Replies: 1 comment 2 replies
-
|
Hey @hallvard, we built the What is your exact need here? Do you want to transform a parsed AST node into something different? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm experimenting with a language with several kinds of literals (data types), besides the typical ones (string, int, boolean) e.g. UUIDs, time of day. When traversing the AST I need to check the rule and convert the parsed string to the corresponding value type. An alternative is to register a value converter, which allows the converted value to be part of the AST (if I understand this correctly). It's more robust to check the value type when traversing the AST than checking the rule name. However,
ValueConverterseems to only support a small set of basic types, at least itsconvertmethod returnsValueType, which is a union ofnumber, bigint, string, Date, boolean.Is there a way to make it support custom ones?
Beta Was this translation helpful? Give feedback.
All reactions