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) {
162162 }
163163
164164 protected void deriveSourceSection (RuleNode node , Object r ) {
165- if (r instanceof PNode ) {
165+ if (r instanceof PNode && (( PNode ) r ). getSourceSection () == null ) {
166166 SourceSection derivedSection = deriveSourceSection (node );
167167 if (derivedSection != null ) {
168168 ((PNode ) r ).assignSourceSection (derivedSection );
@@ -186,7 +186,7 @@ private SourceSection deriveSourceSection(RuleNode node) {
186186 } else if (node instanceof ParserRuleContext ) {
187187 int start = ((ParserRuleContext ) node ).getStart ().getStartIndex ();
188188 int stop = ((ParserRuleContext ) node ).getStop ().getStopIndex ();
189- return createSourceSection (start , stop - start );
189+ return createSourceSection (start , stop - start + 1 );
190190 }
191191 return null ;
192192 }
You can’t perform that action at this time.
0 commit comments