Closed suzizecat closed 8 months ago
As discussed, there would be a need to write-access in a generic fashion the first token of any SyntaxNode.
SyntaxNode
I am willing to try and implement it myself.
In order to not disrupt the current features would be to:
ReferenceTokenOrSyntax
Token
Syntax
gen_syntax.py
getChild
getFirstChild
getLastChild
Could I have a confirmation that this is the right approach ?
Yes, that sounds right. I think you'll want it to be a pointer, so TokenPtrOrSyntax probably.
Ok, thanks for the pointers. I may not have much time in the next week, but I'll have a look into this 🙂
Discussed in https://github.com/MikePopoloski/slang/discussions/898
As discussed, there would be a need to write-access in a generic fashion the first token of any
SyntaxNode
.I am willing to try and implement it myself.
In order to not disrupt the current features would be to:
ReferenceTokenOrSyntax
object (or another name) which would hold the reference or a pointer to aToken
or aSyntax
.gen_syntax.py
to implement thegetChild
version which would return theReferenceTokenOrSyntax
getFirstChild
andgetLastChild
functions.Could I have a confirmation that this is the right approach ?