Skip to content

Commit 1a93885

Browse files
committed
Tests for new detailed source positions.
1 parent 43c0df9 commit 1a93885

21 files changed

+239
-47
lines changed

core/src/main/java/org/jruby/ast/Node.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public String toString(boolean indent, int indentation) {
126126
builder.append(":").append(((INameNode) this).getName());
127127
}
128128

129-
builder.append(" ").append(getPosition().getStartLine());
129+
builder.append(" ").append(getPosition().getLine());
130130

131131
if (!childNodes().isEmpty() && indent) {
132132
builder.append("\n");

core/src/main/java/org/jruby/ast/util/SexpMaker.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
package org.jruby.ast.util;
22

33
import java.io.File;
4-
import java.nio.CharBuffer;
54
import java.security.MessageDigest;
65
import java.security.NoSuchAlgorithmException;
76
import java.util.List;
8-
import java.util.Locale;
97
import java.util.concurrent.atomic.AtomicLong;
108

119
import org.jruby.ast.AliasNode;
@@ -223,7 +221,7 @@ private static void processMethod(Builder sb, String methodName, Node argsNode,
223221
sb.append("(method ").append(methodName).append(' ');
224222
// JRUBY-4301, include filename and line in sexp
225223
sb.append("(file ").append(new File(body.getPosition().getFile()).getName()).append(") ");
226-
sb.append("(line ").append(body.getPosition().getStartLine()).append(") ");
224+
sb.append("(line ").append(body.getPosition().getLine()).append(") ");
227225
process(sb, argsNode);
228226
sb.append(' ');
229227
process(sb, body);

core/src/main/java/org/jruby/common/RubyWarnings.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public boolean isVerbose() {
6969
public void warn(ID id, ISourcePosition position, String message) {
7070
if (!runtime.warningsEnabled()) return;
7171

72-
warn(id, position.getFile(), position.getStartLine() + 1, message);
72+
warn(id, position.getFile(), position.getLine() + 1, message);
7373
}
7474

7575
/**
@@ -168,7 +168,7 @@ public void warning(ID id, ISourcePosition position, String message) {
168168
if (!isVerbose()) return;
169169
if (!runtime.warningsEnabled()) return;
170170

171-
warning(id, position.getFile(), position.getStartLine() + 1, message);
171+
warning(id, position.getFile(), position.getLine() + 1, message);
172172
}
173173

174174
/**

core/src/main/java/org/jruby/internal/runtime/methods/CompiledMethod.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public String getFile() {
230230

231231
public int getLine() {
232232
if (compiledMethod == null) initializeMethod();
233-
return position.getStartLine();
233+
return position.getLine();
234234
}
235235

236236
public String[] getParameterList() {
@@ -306,7 +306,7 @@ public String getFile() {
306306
}
307307

308308
public int getLine() {
309-
return position.getStartLine();
309+
return position.getLine();
310310
}
311311

312312
public Object getScriptObject() {

core/src/main/java/org/jruby/internal/runtime/methods/InvocationMethodFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ public DynamicMethod getCompiledMethod(
282282
scope,
283283
callConfig,
284284
position.getFile(),
285-
position.getStartLine(),
285+
position.getLine(),
286286
methodNodes);
287287
generatedClass = endCallWithBytes(invokerBytes, invokerPath);
288288
} catch (LinkageError le) {

core/src/main/java/org/jruby/internal/runtime/methods/ReflectedCompiledMethod.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule claz
6565
boolean isTrace = runtime.hasEventHooks();
6666
try {
6767
if (isTrace) {
68-
runtime.callEventHooks(context, RubyEvent.CALL, position.getFile(), position.getStartLine(), name, getImplementationClass());
68+
runtime.callEventHooks(context, RubyEvent.CALL, position.getFile(), position.getLine(), name, getImplementationClass());
6969
}
7070
return (IRubyObject)method.invoke(null, $scriptObject, context, self, args, block);
7171
} finally {

core/src/main/java/org/jruby/ir/IRBuilder.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ public IRBuilder newIRBuilder(IRManager manager) {
467467
public Node skipOverNewlines(IRScope s, Node n) {
468468
if (n.getNodeType() == NodeType.NEWLINENODE) {
469469
// Do not emit multiple line number instrs for the same line
470-
int currLineNum = n.getPosition().getStartLine();
470+
int currLineNum = n.getPosition().getLine();
471471
if (currLineNum != _lastProcessedLineNum) {
472472
if (RubyInstanceConfig.FULL_TRACE_ENABLED) {
473473
addInstr(s, new TraceInstr(RubyEvent.LINE, methodNameFor(s), s.getFileName(), currLineNum));
@@ -504,7 +504,7 @@ public Operand build(Node node, IRScope s) {
504504
}
505505

506506
public Operand buildLambda(LambdaNode node, IRScope s) {
507-
IRClosure closure = new IRClosure(manager, s, node.getPosition().getStartLine(), node.getScope(), Arity.procArityOf(node.getArgs()), node.getArgumentType());
507+
IRClosure closure = new IRClosure(manager, s, node.getPosition().getLine(), node.getScope(), Arity.procArityOf(node.getArgs()), node.getArgumentType());
508508

509509
// Create a new nested builder to ensure this gets its own IR builder state
510510
// like the ensure block stack
@@ -990,7 +990,7 @@ public Operand buildCall(CallNode callNode, IRScope s) {
990990
callInstr.setProcNew(true);
991991
}
992992

993-
receiveBreakException(s, block, callInstr, callNode.getPosition().getStartLine());
993+
receiveBreakException(s, block, callInstr, callNode.getPosition().getLine());
994994
return callResult;
995995
}
996996

@@ -1107,7 +1107,7 @@ public Operand buildClass(ClassNode classNode, IRScope s) {
11071107
IRClassBody body = new IRClassBody(manager, s, className, classNode.getPosition().getLine(), classNode.getScope());
11081108
Variable tmpVar = addResultInstr(s, new DefineClassInstr(s.createTemporaryVariable(), body, container, superClass));
11091109

1110-
return buildModuleOrClassBody(s, tmpVar, body, classNode.getBodyNode(), classNode.getPosition().getStartLine());
1110+
return buildModuleOrClassBody(s, tmpVar, body, classNode.getBodyNode(), classNode.getPosition().getLine());
11111111
}
11121112

11131113
// class Foo; class << self; end; end
@@ -1118,7 +1118,7 @@ public Operand buildSClass(SClassNode sclassNode, IRScope s) {
11181118
IRModuleBody body = new IRMetaClassBody(manager, s, manager.getMetaClassName(), sclassNode.getPosition().getLine(), sclassNode.getScope());
11191119
Variable tmpVar = addResultInstr(s, new DefineMetaClassInstr(s.createTemporaryVariable(), receiver, body));
11201120

1121-
return buildModuleOrClassBody(s, tmpVar, body, sclassNode.getBodyNode(), sclassNode.getPosition().getStartLine());
1121+
return buildModuleOrClassBody(s, tmpVar, body, sclassNode.getBodyNode(), sclassNode.getPosition().getLine());
11221122
}
11231123

11241124
// @@c
@@ -2243,7 +2243,7 @@ public Operand buildFCall(FCallNode fcallNode, IRScope s) {
22432243
Operand block = setupCallClosure(fcallNode.getIterNode(), s);
22442244
Variable callResult = s.createTemporaryVariable();
22452245
CallInstr callInstr = CallInstr.create(CallType.FUNCTIONAL, callResult, new MethAddr(fcallNode.getName()), s.getSelf(), args.toArray(new Operand[args.size()]), block);
2246-
receiveBreakException(s, block, callInstr, fcallNode.getPosition().getStartLine());
2246+
receiveBreakException(s, block, callInstr, fcallNode.getPosition().getLine());
22472247
return callResult;
22482248
}
22492249

@@ -2360,14 +2360,14 @@ public Operand buildFor(ForNode forNode, IRScope s) {
23602360
Operand receiver = build(forNode.getIterNode(), s);
23612361
Operand forBlock = buildForIter(forNode, s);
23622362
CallInstr callInstr = new CallInstr(CallType.NORMAL, result, new MethAddr("each"), receiver, NO_ARGS, forBlock);
2363-
receiveBreakException(s, forBlock, callInstr, forNode.getPosition().getStartLine());
2363+
receiveBreakException(s, forBlock, callInstr, forNode.getPosition().getLine());
23642364

23652365
return result;
23662366
}
23672367

23682368
public Operand buildForIter(final ForNode forNode, IRScope s) {
23692369
// Create a new closure context
2370-
IRClosure closure = new IRFor(manager, s, forNode.getPosition().getStartLine(), forNode.getScope(), Arity.procArityOf(forNode.getVarNode()), forNode.getArgumentType());
2370+
IRClosure closure = new IRFor(manager, s, forNode.getPosition().getLine(), forNode.getScope(), Arity.procArityOf(forNode.getVarNode()), forNode.getArgumentType());
23712371

23722372
// Create a new nested builder to ensure this gets its own IR builder state
23732373
// like the ensure block stack
@@ -2518,7 +2518,7 @@ public Operand buildInstVar(InstVarNode node, IRScope s) {
25182518
}
25192519

25202520
public Operand buildIter(final IterNode iterNode, IRScope s) {
2521-
IRClosure closure = new IRClosure(manager, s, iterNode.getPosition().getStartLine(), iterNode.getScope(), Arity.procArityOf(iterNode.getVarNode()), iterNode.getArgumentType());
2521+
IRClosure closure = new IRClosure(manager, s, iterNode.getPosition().getLine(), iterNode.getScope(), Arity.procArityOf(iterNode.getVarNode()), iterNode.getArgumentType());
25222522

25232523
// Create a new nested builder to ensure this gets its own IR builder state
25242524
// like the ensure block stack
@@ -2660,7 +2660,7 @@ public Operand buildModule(ModuleNode moduleNode, IRScope s) {
26602660
IRModuleBody body = new IRModuleBody(manager, s, moduleName, moduleNode.getPosition().getLine(), moduleNode.getScope());
26612661
Variable tmpVar = addResultInstr(s, new DefineModuleInstr(s.createTemporaryVariable(), body, container));
26622662

2663-
return buildModuleOrClassBody(s, tmpVar, body, moduleNode.getBodyNode(), moduleNode.getPosition().getStartLine());
2663+
return buildModuleOrClassBody(s, tmpVar, body, moduleNode.getBodyNode(), moduleNode.getPosition().getLine());
26642664
}
26652665

26662666
public Operand buildMultipleAsgn(MultipleAsgnNode multipleAsgnNode, IRScope s) {
@@ -2949,7 +2949,7 @@ public Operand buildPostExe(PostExeNode postExeNode, IRScope s) {
29492949
IRScope topLevel = s.getTopLevelScope();
29502950
IRScope nearestLVarScope = s.getNearestTopLocalVariableScope();
29512951

2952-
IRClosure endClosure = new IRClosure(manager, s, postExeNode.getPosition().getStartLine(), nearestLVarScope.getStaticScope(), Arity.procArityOf(postExeNode.getVarNode()), postExeNode.getArgumentType(), "_END_", true);
2952+
IRClosure endClosure = new IRClosure(manager, s, postExeNode.getPosition().getLine(), nearestLVarScope.getStaticScope(), Arity.procArityOf(postExeNode.getVarNode()), postExeNode.getArgumentType(), "_END_", true);
29532953
// Create a new nested builder to ensure this gets its own IR builder state
29542954
// like the ensure block stack
29552955
IRBuilder closureBuilder = newIRBuilder(manager);
@@ -2969,7 +2969,7 @@ public Operand buildPostExe(PostExeNode postExeNode, IRScope s) {
29692969
}
29702970

29712971
public Operand buildPreExe(PreExeNode preExeNode, IRScope s) {
2972-
IRClosure beginClosure = new IRFor(manager, s, preExeNode.getPosition().getStartLine(), s.getTopLevelScope().getStaticScope(), Arity.procArityOf(preExeNode.getVarNode()), preExeNode.getArgumentType(), "_BEGIN_");
2972+
IRClosure beginClosure = new IRFor(manager, s, preExeNode.getPosition().getLine(), s.getTopLevelScope().getStaticScope(), Arity.procArityOf(preExeNode.getVarNode()), preExeNode.getArgumentType(), "_BEGIN_");
29732973
// Create a new nested builder to ensure this gets its own IR builder state
29742974
// like the ensure block stack
29752975
IRBuilder closureBuilder = newIRBuilder(manager);
@@ -3304,7 +3304,7 @@ public Operand buildSuper(SuperNode superNode, IRScope s) {
33043304
List<Operand> args = setupCallArgs(superNode.getArgsNode(), s);
33053305
Operand block = setupCallClosure(superNode.getIterNode(), s);
33063306
if (block == null) block = getImplicitBlockArg(s);
3307-
return buildSuperInstr(s, block, args.toArray(new Operand[args.size()]), superNode.getPosition().getStartLine());
3307+
return buildSuperInstr(s, block, args.toArray(new Operand[args.size()]), superNode.getPosition().getLine());
33083308
}
33093309

33103310
private Operand buildSuperInScriptBody(IRScope s) {
@@ -3495,7 +3495,7 @@ public Operand buildZSuper(ZSuperNode zsuperNode, IRScope s) {
34953495
Operand block = setupCallClosure(zsuperNode.getIterNode(), s);
34963496
if (block == null) block = getImplicitBlockArg(s);
34973497

3498-
int linenumber = zsuperNode.getPosition().getStartLine();
3498+
int linenumber = zsuperNode.getPosition().getLine();
34993499

35003500
// Enebo:ZSuper in for (or nested for) can be statically resolved like method but it needs
35013501
// to fixup depth.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved. This
3+
* code is released under a tri EPL/GPL/LGPL license. You can use it,
4+
* redistribute it and/or modify it under the terms of the:
5+
*
6+
* Eclipse Public License version 1.0
7+
* GNU General Public License version 2
8+
* GNU Lesser General Public License version 2.1
9+
*/
10+
package org.jruby.lexer.yacc;
11+
12+
public class DetailedSourcePosition extends SimpleSourcePosition {
13+
14+
final int offset;
15+
final int length;
16+
17+
public DetailedSourcePosition(String filename, int line, int offset, int length) {
18+
super(filename, line);
19+
this.offset = offset;
20+
this.length = length;
21+
}
22+
23+
public int getOffset() {
24+
return offset;
25+
}
26+
27+
public int getLength() {
28+
return length;
29+
}
30+
31+
@Override
32+
public String toString() {
33+
return String.format("%s:%d:%d:%d", getFile(), getLine() + 1, offset, length);
34+
}
35+
36+
}

core/src/main/java/org/jruby/lexer/yacc/ISourcePosition.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ public interface ISourcePosition extends PositionAware {
5050
* Which is the first(start) line that this source position occurs on (zero-based)
5151
* @return
5252
*/
53-
public int getStartLine();
53+
public int getLine();
5454

5555
}

core/src/main/java/org/jruby/lexer/yacc/InvalidSourcePosition.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,8 @@ public String getFile() {
3636
return "dummy";
3737
}
3838

39-
public int getStartLine() {
40-
return -1;
41-
}
42-
4339
public int getLine() {
4440
return -1;
4541
}
42+
4643
}

core/src/main/java/org/jruby/lexer/yacc/RubyLexer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
import org.jruby.util.StringSupport;
6868
import org.jruby.util.cli.Options;
6969

70-
71-
/** This is a port of the MRI lexer to Java it is compatible to Ruby 1.8.1.
70+
/*
71+
* This is a port of the MRI lexer to Java.
7272
*/
7373
public class RubyLexer {
7474
public static final Encoding UTF8_ENCODING = UTF8Encoding.INSTANCE;

core/src/main/java/org/jruby/lexer/yacc/SimpleSourcePosition.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,13 @@ public String getFile() {
4141
return filename;
4242
}
4343

44-
public int getStartLine() {
45-
return line;
46-
}
47-
4844
public int getLine() {
4945
return line;
5046
}
5147

5248
@Override
5349
public String toString() {
54-
return getFile() + ":" + (getStartLine() + 1);
50+
return String.format("%s:%d", getFile(), getLine() + 1);
5551
}
52+
5653
}

core/src/main/java/org/jruby/lexer/yacc/SimpleSourcePositionFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public ISourcePosition getPosition(ISourcePosition startPosition) {
5151
public ISourcePosition getPosition() {
5252
// Only give new position if we are at least one char past \n of previous line so that last tokens
5353
// of previous line will not get associated with the next line.
54-
if (lastPosition.getStartLine() == source.getVirtualLine() || source.lastWasBeginOfLine()) return lastPosition;
54+
if (lastPosition.getLine() == source.getVirtualLine() || source.lastWasBeginOfLine()) return lastPosition;
5555

5656
lastPosition = new SimpleSourcePosition(source.getFilename(), source.getVirtualLine());
5757

core/src/main/java/org/jruby/parser/Parser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public Node parse(String file, LexerSource lexerSource, DynamicScope blockScope,
129129
default:
130130
StringBuilder buffer = new StringBuilder(100);
131131
buffer.append(e.getPosition().getFile()).append(':');
132-
buffer.append(e.getPosition().getStartLine() + 1).append(": ");
132+
buffer.append(e.getPosition().getLine() + 1).append(": ");
133133
buffer.append(e.getMessage());
134134

135135
throw runtime.newSyntaxError(buffer.toString());

core/src/main/java/org/jruby/parser/ParserSupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ protected void getterIdentifierError(ISourcePosition position, String identifier
168168
public Node newline_node(Node node, ISourcePosition position) {
169169
if (node == null) return null;
170170

171-
configuration.coverLine(position.getStartLine());
171+
configuration.coverLine(position.getLine());
172172

173173
return node instanceof NewlineNode ? node : new NewlineNode(position, node);
174174
}

core/src/main/java/org/jruby/parser/RubyParser.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import org.jruby.ast.BlockNode;
4545
import org.jruby.ast.BlockPassNode;
4646
import org.jruby.ast.BreakNode;
47-
import org.jruby.ast.CallNode;
4847
import org.jruby.ast.ClassNode;
4948
import org.jruby.ast.ClassVarNode;
5049
import org.jruby.ast.ClassVarAsgnNode;
@@ -4615,7 +4614,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException {
46154614
};
46164615
states[514] = new ParserState() {
46174616
@Override public Object execute(ParserSupport support, RubyLexer lexer, Object yyVal, Object[] yyVals, int yyTop) {
4618-
yyVal = new FixnumNode(lexer.getPosition(), lexer.tokline.getStartLine()+1);
4617+
yyVal = new FixnumNode(lexer.getPosition(), lexer.tokline.getLine()+1);
46194618
return yyVal;
46204619
}
46214620
};

core/src/main/java/org/jruby/runtime/ThreadContext.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import org.jruby.RubyString;
4545
import org.jruby.RubyThread;
4646
import org.jruby.ast.executable.RuntimeCache;
47-
import org.jruby.exceptions.JumpException.ReturnJump;
4847
import org.jruby.ext.fiber.ThreadFiber;
4948
import org.jruby.internal.runtime.methods.DynamicMethod;
5049
import org.jruby.lexer.yacc.ISourcePosition;
@@ -582,7 +581,7 @@ public void setFileAndLine(String file, int line) {
582581
public void setFileAndLine(ISourcePosition position) {
583582
BacktraceElement b = backtrace[backtraceIndex];
584583
b.filename = position.getFile();
585-
b.line = position.getStartLine();
584+
b.line = position.getLine();
586585
}
587586

588587
public Visibility getCurrentVisibility() {

core/src/main/java/org/jruby/truffle/translator/BodyTranslator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,7 @@ public RubyNode visitMultipleAsgnNode(org.jruby.ast.MultipleAsgn19Node node) {
13371337
RubyNode rhsTranslated;
13381338

13391339
if (rhs == null) {
1340-
context.getRuntime().getWarnings().warn(IRubyWarnings.ID.TRUFFLE, node.getPosition().getFile(), node.getPosition().getStartLine(), "no RHS for multiple assignment - using nil");
1340+
context.getRuntime().getWarnings().warn(IRubyWarnings.ID.TRUFFLE, node.getPosition().getFile(), node.getPosition().getLine(), "no RHS for multiple assignment - using nil");
13411341
rhsTranslated = new ObjectLiteralNode(context, sourceSection, context.getCoreLibrary().getNilObject());
13421342
} else {
13431343
rhsTranslated = rhs.accept(this);
@@ -1560,7 +1560,7 @@ public RubyNode visitMultipleAsgnNode(org.jruby.ast.MultipleAsgn19Node node) {
15601560

15611561
return SequenceNode.sequence(context, sourceSection, sequence);
15621562
} else {
1563-
context.getRuntime().getWarnings().warn(IRubyWarnings.ID.TRUFFLE, node.getPosition().getFile(), node.getPosition().getStartLine(), node + " unknown form of multiple assignment");
1563+
context.getRuntime().getWarnings().warn(IRubyWarnings.ID.TRUFFLE, node.getPosition().getFile(), node.getPosition().getLine(), node + " unknown form of multiple assignment");
15641564
return new ObjectLiteralNode(context, sourceSection, context.getCoreLibrary().getNilObject());
15651565
}
15661566
}
@@ -2154,7 +2154,7 @@ protected RubyNode defaultVisit(Node node) {
21542154
}
21552155

21562156
protected RubyNode unimplemented(Node node) {
2157-
context.getRuntime().getWarnings().warn(IRubyWarnings.ID.TRUFFLE, node.getPosition().getFile(), node.getPosition().getStartLine(), node + " does nothing - translating as nil");
2157+
context.getRuntime().getWarnings().warn(IRubyWarnings.ID.TRUFFLE, node.getPosition().getFile(), node.getPosition().getLine(), node + " does nothing - translating as nil");
21582158
return new ObjectLiteralNode(context, translate(node.getPosition()), context.getCoreLibrary().getNilObject());
21592159
}
21602160

core/src/main/java/org/jruby/truffle/translator/Translator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public SourceSection translate(Source source, org.jruby.lexer.yacc.ISourcePositi
4343
}
4444
} else if (Options.TRUFFLE_ALLOW_SIMPLE_SOURCE_SECTIONS.load()) {
4545
// If we didn't run with -X+T, so maybe we're using truffelize, we might still get simple source sections
46-
return source.createSection(getIdentifier(), sourcePosition.getStartLine() + 1);
46+
return source.createSection(getIdentifier(), sourcePosition.getLine() + 1);
4747
} else {
4848
throw new UnsupportedOperationException("Truffle needs detailed source positions unless you know what you are doing and set truffle.allow_simple_source_sections - got " + sourcePosition.getClass());
4949
}

0 commit comments

Comments
 (0)