]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/ParsedSource.cpp
added script labels in parser/interpreter
[l2e.git] / src / loader / ParsedSource.cpp
index 6b2fc80413207811b90631c1bfc493982c95c5ee..8c3d3bd17415d5cd4fe7ff92df6b42a45204127a 100644 (file)
@@ -485,7 +485,7 @@ const string &ScriptToken::CommandName() const {
        }
 }
 
-const string &ScriptToken::GetIdentifier() const {
+const string &ScriptToken::Identifier() const {
        if (type == IDENTIFIER) {
                return str;
        } else {
@@ -493,6 +493,14 @@ const string &ScriptToken::GetIdentifier() const {
        }
 }
 
+const string &ScriptToken::Label() const {
+       if (type == LABEL) {
+               return str;
+       } else {
+               throw runtime_error("access to label of non-label script token");
+       }
+}
+
 const Literal *ScriptToken::GetLiteral() const {
        if (type == LITERAL) {
                return literal;