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
+4 -2
View File
@@ -55,10 +55,12 @@ BOOST_AUTO_TEST_SUITE(Assembler)
BOOST_AUTO_TEST_CASE(all_assembly_items)
{
Assembly _assembly;
_assembly.setSourceLocation(SourceLocation(1, 3, make_shared<string>("root.asm")));
auto root_asm = make_shared<CharStream>("", "root.asm");
_assembly.setSourceLocation(SourceLocation(1, 3, root_asm));
Assembly _subAsm;
_subAsm.setSourceLocation(SourceLocation(6, 8, make_shared<string>("sub.asm")));
auto sub_asm = make_shared<CharStream>("", "sub.asm");
_subAsm.setSourceLocation(SourceLocation(6, 8, sub_asm));
_subAsm.append(Instruction::INVALID);
shared_ptr<Assembly> _subAsmPtr = make_shared<Assembly>(_subAsm);