tokay
tokay copied to clipboard
`Self`/`self`-reference currently unclear
This issue resulted from further investigation into #127, when using the Self
reference.
# Problem: XAssignment defaults to Self, which becomes __main__, but should be XAssignment<Int>
XAssignment : @<Expression, InnerAssignment: Self, ext: void> {
# Ident _ '=' _ XAssignment ast("assign" + ext + " " + $1)
print(*InnerAssignment)
Ident _ '=' _ Expect<InnerAssignment> ast("assign" + ext + " " + $1)
Expression ast("value")
}
ast_print(XAssignment<Int>)
The Self
-default of InnerAssignment
is derived by the Self of the parselet instance in __main__
, but it should refer to the constructed derive of XAssignment<Int>
.