-
When creating a parser class by extending the parser, the rules are created in the constructor.
And then later on when consuming the subrule:
Which results in a Typescript error on How are others addressing this ? Thanks, Kurt |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hey @khkiley, I cannot really follow. Can you give a reproducible example? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the superfast reply! Maybe a screenshot from VSCode will be clearer: Those red squiggles under the rules are type errors, indicating the rule is not defined on the class. |
Beta Was this translation helpful? Give feedback.
-
Oh, perfect! I was unaware that this could work. Thank you. |
Beta Was this translation helpful? Give feedback.
Oh, I see that's what you mean. For TypeScript, you need to perform the assignments manually for the compiler to pick it up. Instead of performing the
RULE
calls inside of the constructor, you can also move them outside of it: