Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public SourceRange withEnd(int newEndLine, int newEndColumn) {

public SourceRange startLineShiftColumn(int shift) {
assert shift >= 0;
if (shift == 0) {
if (shift == 0 || this == ARTIFICIAL_RANGE) {
return this;
}
return new SourceRange(startLine, startColumn, startLine, startColumn + shift);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ void beginRootSourceSection(SSTNode node, Builder b) {
}

private static void beginSourceSectionInner(Builder b, SourceRange sourceRange) {
if (sourceRange.startLine >= 1) {
if (sourceRange.startLine >= 1 && sourceRange != SourceRange.ARTIFICIAL_RANGE) {
if (sourceRange.startColumn >= 0 && sourceRange.endLine >= sourceRange.startLine && sourceRange.endColumn >= 0) {
if (sourceRange.endColumn > 0) {
b.beginSourceSection(sourceRange.startLine, sourceRange.startColumn + 1, sourceRange.endLine, sourceRange.endColumn);
Expand Down Expand Up @@ -4120,6 +4120,7 @@ public Void visit(StmtTy.FunctionDef node) {
}

public void emitFunctionDef(StmtTy node, String name, ArgumentsTy args, StmtTy[] body, ExprTy[] decoratorList, ExprTy returns, TypeParamTy[] typeParams) {
// For instrumentation, we want to map this statement only to the declaration line, such
// that, e.g., breakpoints inside the body fire only once the body actually executes and
// not is declared. There is no simple way to get the exact line width here, so we just
// approximate it with name width.
Expand Down
Loading