liblangutil: SourceLocation: adds (shared) pointer to underlying CharStream source, eliminating sourceName

Also, adapted affecting code to those changes.
This commit is contained in:
Christian Parpart
2018-11-30 17:07:12 +01:00
parent 22eff22492
commit c48a5264be
17 changed files with 127 additions and 102 deletions
+2 -2
View File
@@ -42,7 +42,7 @@ class Parser::ASTNodeFactory
{
public:
explicit ASTNodeFactory(Parser const& _parser):
m_parser(_parser), m_location(_parser.position(), -1, _parser.sourceName()) {}
m_parser(_parser), m_location(_parser.position(), -1, _parser.source()) {}
ASTNodeFactory(Parser const& _parser, ASTPointer<ASTNode> const& _childNode):
m_parser(_parser), m_location(_childNode->location()) {}
@@ -55,7 +55,7 @@ public:
template <class NodeType, typename... Args>
ASTPointer<NodeType> createNode(Args&& ... _args)
{
solAssert(m_location.sourceName, "");
solAssert(m_location.source, "");
if (m_location.end < 0)
markEndPosition();
return make_shared<NodeType>(m_location, std::forward<Args>(_args)...);