X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Floader%2FParsedSource.cpp;h=90597475726663807fdc2beaa5b8f1d7fc627c98;hb=a67f7e662c85b2b8d46f26a3c6e018b2df6eb318;hp=042dd69c7f6aeca25003268f40da54672d7068d9;hpb=0285546b22f9e8f496ca6b1abffdd232647b6b6a;p=l2e.git diff --git a/src/loader/ParsedSource.cpp b/src/loader/ParsedSource.cpp index 042dd69..9059747 100644 --- a/src/loader/ParsedSource.cpp +++ b/src/loader/ParsedSource.cpp @@ -200,6 +200,17 @@ Literal::Literal(const string &typeName, const vector &pls) } +Literal::Literal(const string &typeName, const vector &ids) +: props(0) +, typeName(typeName) +, identifiers(ids) +, i1(0), i2(0) +, i3(0), i4(0) +, b(false) +, type(ARRAY_IDENTS) { + +} + Literal::Literal(bool b) : props(0) , typeName("Boolean") @@ -324,6 +335,14 @@ const vector &Literal::GetPropertyLists() const { } } +const vector &Literal::GetIdentifiers() const { + if (type == ARRAY_IDENTS) { + return identifiers; + } else { + throw runtime_error("tried to access identifiers of non-array literal"); + } +} + bool Literal::GetBoolean() const { if (type == BOOLEAN) { return b; @@ -535,6 +554,9 @@ ostream &operator <<(ostream &out, const loader::Literal &l) { case loader::Literal::ARRAY_PROPS: out << "array of property lists"; break; + case loader::Literal::ARRAY_IDENTS: + out << "array of identifiers"; + break; case loader::Literal::BOOLEAN: out << "boolean, " << (l.GetBoolean() ? "true" : "false"); break;