File tree Expand file tree Collapse file tree 3 files changed +3
-5
lines changed Expand file tree Collapse file tree 3 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,8 @@ class Scanner
119
119
rescan ();
120
120
}
121
121
122
+ CharStream const & charStream () const noexcept { return m_source; }
123
+
122
124
// / @returns the next token and advances input
123
125
Token next ();
124
126
Original file line number Diff line number Diff line change @@ -87,7 +87,6 @@ ASTPointer<SourceUnit> Parser::parse(CharStream& _charStream)
87
87
try
88
88
{
89
89
m_recursionDepth = 0 ;
90
- m_source = &_charStream;
91
90
m_scanner = make_shared<Scanner>(_charStream);
92
91
ASTNodeFactory nodeFactory (*this );
93
92
@@ -2057,16 +2056,14 @@ bool Parser::variableDeclarationStart()
2057
2056
2058
2057
optional<string> Parser::findLicenseString (std::vector<ASTPointer<ASTNode>> const & _nodes)
2059
2058
{
2060
- solAssert (!!m_source, " " );
2061
-
2062
2059
// We circumvent the scanner here, because it skips non-docstring comments.
2063
2060
static regex const licenseRegex (" SPDX-License-Identifier:\\ s*([a-zA-Z0-9 ()+.-]+)" );
2064
2061
2065
2062
// Search inside all parts of the source not covered by parsed nodes.
2066
2063
// This will leave e.g. "global comments".
2067
2064
using iter = std::string::const_iterator;
2068
2065
vector<pair<iter, iter>> sequencesToSearch;
2069
- string const & source = m_source-> source ();
2066
+ string const & source = m_scanner-> charStream (). source ();
2070
2067
sequencesToSearch.emplace_back (source.begin (), source.end ());
2071
2068
for (ASTPointer<ASTNode> const & node: _nodes)
2072
2069
if (node->location ().hasText ())
Original file line number Diff line number Diff line change @@ -211,7 +211,6 @@ class Parser: public langutil::ParserBase
211
211
// / Creates an empty ParameterList at the current location (used if parameters can be omitted).
212
212
ASTPointer<ParameterList> createEmptyParameterList ();
213
213
214
- langutil::CharStream* m_source = nullptr ;
215
214
// / Flag that signifies whether '_' is parsed as a PlaceholderStatement or a regular identifier.
216
215
bool m_insideModifier = false ;
217
216
langutil::EVMVersion m_evmVersion;
You can’t perform that action at this time.
0 commit comments