File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/parser Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ public Object visitChildren(RuleNode node) {
162
162
}
163
163
164
164
protected void deriveSourceSection (RuleNode node , Object r ) {
165
- if (r instanceof PNode ) {
165
+ if (r instanceof PNode && (( PNode ) r ). getSourceSection () == null ) {
166
166
SourceSection derivedSection = deriveSourceSection (node );
167
167
if (derivedSection != null ) {
168
168
((PNode ) r ).assignSourceSection (derivedSection );
@@ -186,7 +186,7 @@ private SourceSection deriveSourceSection(RuleNode node) {
186
186
} else if (node instanceof ParserRuleContext ) {
187
187
int start = ((ParserRuleContext ) node ).getStart ().getStartIndex ();
188
188
int stop = ((ParserRuleContext ) node ).getStop ().getStopIndex ();
189
- return createSourceSection (start , stop - start );
189
+ return createSourceSection (start , stop - start + 1 );
190
190
}
191
191
return null ;
192
192
}
You can’t perform that action at this time.
0 commit comments