File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ std::shared_ptr<DebugData const> Parser::createDebugData() const
8080 case UseSourceLocationFrom::LocationOverride:
8181 return DebugData::create (m_locationOverride);
8282 case UseSourceLocationFrom::Comments:
83- return m_debugDataOverride ;
83+ return DebugData::create (m_locationFromComment, m_astIDFromComment) ;
8484 }
8585 solAssert (false , " " );
8686}
@@ -135,7 +135,7 @@ void Parser::fetchDebugDataFromComment()
135135 string_view commentLiteral = m_scanner->currentCommentLiteral ();
136136 match_results<string_view::const_iterator> match;
137137
138- langutil::SourceLocation sourceLocation = m_debugDataOverride-> location ;
138+ langutil::SourceLocation sourceLocation = m_locationFromComment ;
139139 // Empty for each new node.
140140 optional<int > astID;
141141
@@ -163,7 +163,8 @@ void Parser::fetchDebugDataFromComment()
163163 continue ;
164164 }
165165
166- m_debugDataOverride = DebugData::create (sourceLocation, astID);
166+ m_locationFromComment = sourceLocation;
167+ m_astIDFromComment = astID;
167168}
168169
169170optional<pair<string_view, SourceLocation>> Parser::parseSrcComment (
Original file line number Diff line number Diff line change @@ -61,7 +61,6 @@ class Parser: public langutil::ParserBase
6161 ParserBase(_errorReporter),
6262 m_dialect(_dialect),
6363 m_locationOverride{_locationOverride ? *_locationOverride : langutil::SourceLocation{}},
64- m_debugDataOverride{},
6564 m_useSourceLocationFrom{
6665 _locationOverride ?
6766 UseSourceLocationFrom::LocationOverride :
@@ -79,7 +78,6 @@ class Parser: public langutil::ParserBase
7978 ParserBase(_errorReporter),
8079 m_dialect(_dialect),
8180 m_sourceNames{std::move (_sourceNames)},
82- m_debugDataOverride{DebugData::create ()},
8381 m_useSourceLocationFrom{
8482 m_sourceNames.has_value () ?
8583 UseSourceLocationFrom::Comments :
@@ -154,7 +152,8 @@ class Parser: public langutil::ParserBase
154152
155153 std::optional<std::map<unsigned , std::shared_ptr<std::string const >>> m_sourceNames;
156154 langutil::SourceLocation m_locationOverride;
157- std::shared_ptr<DebugData const > m_debugDataOverride;
155+ langutil::SourceLocation m_locationFromComment;
156+ std::optional<int64_t > m_astIDFromComment;
158157 UseSourceLocationFrom m_useSourceLocationFrom = UseSourceLocationFrom::Scanner;
159158 ForLoopComponent m_currentForLoopComponent = ForLoopComponent::None;
160159 bool m_insideFunction = false ;
You can’t perform that action at this time.
0 commit comments