How to implements 'this' keyword in with langium ? #1325
Answered
by
msujew
hyphappy011
asked this question in
Q&A
-
I copy the langium-lox example, and write some code with a simple class in the playground, but it can not deal the "this" keyword. class testClass {
name: string
testIt():void {
this.name = "123";
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
msujew
Dec 26, 2023
Replies: 1 comment
-
Hey @hyphappy011, to support the |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
hyphappy011
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @hyphappy011,
to support the
this
keyword correctly, you would need to implement a specialized scope provider. You can find a general guide on it here. Unfortunately, the Langium playground doesn't offer to define a new scope provider, and the default scoping doesn't cover this kind of advanced use case.