X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Floader%2FParsedSource.cpp;h=1f7fc983053e68ab32047bdbba7abdc2f466d796;hb=2bd2e92a227af66386af1dfca2f52df6941f0f94;hp=b019fe76bc4f5fb6c09ebae980c86a1319936481;hpb=5d6b785e122093fe05e2ed14f688a8bce6bad6a9;p=l2e.git diff --git a/src/loader/ParsedSource.cpp b/src/loader/ParsedSource.cpp index b019fe7..1f7fc98 100644 --- a/src/loader/ParsedSource.cpp +++ b/src/loader/ParsedSource.cpp @@ -327,6 +327,23 @@ const PropertyList *Literal::GetProperties() const { } } + +const Literal &Value::GetLiteral() const { + if (isLiteral) { + return *literal; + } else { + throw runtime_error("tried to access literal of identifier value"); + } +} + +const std::string &Value::GetIdentifier() const { + if (!isLiteral) { + return identifier; + } else { + throw runtime_error("tried to access identifier of literal value"); + } +} + }