langium
langium copied to clipboard
Broken cstNode calculation
given the grammar
grammar HelloWorld
entry Expression:
HasValue;
HasValue infers Expression:
DotExpression({infer HasValue.left=current} 'has-value')*;
DotExpression infers Expression:
RefExpression ({infer DotExpression.base = current} '.' target=DotTarget)*;
RefExpression:
target=ID;
DotTarget:
{infer DotTargetRef} ref=ID;
ID returns string: RawId | EscapedId;
hidden terminal WS: /\s+/;
terminal RawId: /[_a-zA-Z][\w_-]*/;
terminal EscapedId: /`[^`]*`/;
hidden terminal ML_COMMENT: /\/\*[\s\S]*?\*\//;
hidden terminal SL_COMMENT: /\/\/[^\n\r]*/;
and sample model
bs.cs.xx has-value
the cst-node for the dot expression
bs.cs.xx
is .xx
and as not expected bs.cs.xx
Might be related to https://github.com/eclipse-langium/langium/pull/932.
It also seems to be related to #1218.
thx for fixing