File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -131,10 +131,8 @@ void Parser::fetchSourceLocationFromComment()
131
131
m_debugDataOverride = DebugData::create ();
132
132
if (!sourceIndex || !start || !end)
133
133
m_errorReporter.syntaxError (6367_error, commentLocation, " Invalid value in source location mapping. Could not parse location specification." );
134
- else if (!((*start < 0 && *end < 0 ) || (*start >= 0 && *start <= *end)))
135
- m_errorReporter.syntaxError (5798_error, commentLocation, " Invalid value in source location mapping. Start offset larger than end offset." );
136
- else if (sourceIndex == -1 && (0 <= *start && *start <= *end)) // Use source index -1 to indicate original source.
137
- m_debugDataOverride = DebugData::create (SourceLocation{*start, *end, ParserBase::currentLocation ().source });
134
+ else if (sourceIndex == -1 )
135
+ m_debugDataOverride = DebugData::create (SourceLocation{*start, *end, nullptr });
138
136
else if (!(sourceIndex >= 0 && m_charStreamMap->count (static_cast <unsigned >(*sourceIndex))))
139
137
m_errorReporter.syntaxError (2674_error, commentLocation, " Invalid source mapping. Source index not defined via @use-src." );
140
138
else
Original file line number Diff line number Diff line change @@ -573,9 +573,7 @@ BOOST_AUTO_TEST_CASE(customSourceLocations_reference_original_sloc)
573
573
BOOST_REQUIRE (holds_alternative<VariableDeclaration>(result->statements .at (0 )));
574
574
VariableDeclaration const & varDecl = get<VariableDeclaration>(result->statements .at (0 ));
575
575
576
- // -1 points to original source code, which in this case is `sourceText` (which is also
577
- // available via `0`, that's why the first @src is set to `1` instead.)
578
- CHECK_LOCATION (varDecl.debugData ->location , sourceText, 10 , 20 );
576
+ CHECK_LOCATION (varDecl.debugData ->location , " " , 10 , 20 );
579
577
}
580
578
581
579
BOOST_AUTO_TEST_SUITE_END ()
You can’t perform that action at this time.
0 commit comments