From: Daniel Karbach Date: Mon, 28 Jan 2019 16:49:07 +0000 (+0100) Subject: new language, new compiler X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;ds=sidebyside;p=l2e.git new language, new compiler --- diff --git a/src/common/ScriptRunner.cpp b/src/common/ScriptRunner.cpp index 947ded7..6c2d2fa 100644 --- a/src/common/ScriptRunner.cpp +++ b/src/common/ScriptRunner.cpp @@ -71,6 +71,8 @@ void ScriptRunner::Exec(Script::Code code) { vector[code.reg1] = value; break; } + default: + break; } break; @@ -89,6 +91,8 @@ void ScriptRunner::Exec(Script::Code code) { vector[code.reg1] += value; break; } + default: + break; } break; diff --git a/src/loader/Interpreter.cpp b/src/loader/Interpreter.cpp index a1fdc82..1888361 100644 --- a/src/loader/Interpreter.cpp +++ b/src/loader/Interpreter.cpp @@ -625,6 +625,8 @@ void Interpreter::ReadScript(const std::vector &s, Script *script ReadScriptVector(**i, text + cursor); cursor += sizeof(Vector); break; + default: + break; } } } else if (cmd == "add") { @@ -671,6 +673,8 @@ void Interpreter::ReadScript(const std::vector &s, Script *script ReadScriptVector(**i, text + cursor); cursor += sizeof(Vector); break; + default: + break; } } } else if (cmd == "mod") { diff --git a/src/loader/Parser.cpp b/src/loader/Parser.cpp index 89e3931..25a99b6 100644 --- a/src/loader/Parser.cpp +++ b/src/loader/Parser.cpp @@ -3,12 +3,12 @@ #include "ParsedSource.h" #include "utility.h" -#include #include +#include #include #include -using std::auto_ptr; +using std::unique_ptr; using std::ifstream; using std::string; using std::vector; @@ -87,14 +87,14 @@ Declaration *Parser::ProbeDefinition() { Token t(GetToken()); tok.Putback(t); if (BeginOfPropertyList(t)) { - auto_ptr propertyList(ParsePropertyList()); - auto_ptr dfn(new Definition(typeName, identifier)); + unique_ptr propertyList(ParsePropertyList()); + unique_ptr dfn(new Definition(typeName, identifier)); dfn->SetValue(propertyList.release()); product.AddDefinition(dfn.get()); return dfn.release(); } else if (BeginningOfPrimitiveLiteral(t)) { - auto_ptr literal(ParseLiteral()); - auto_ptr dfn(new Definition(typeName, identifier)); + unique_ptr literal(ParseLiteral()); + unique_ptr dfn(new Definition(typeName, identifier)); dfn->SetValue(literal.release()); product.AddDefinition(dfn.get()); return dfn.release(); @@ -182,7 +182,7 @@ PropertyList *Parser::ParsePropertyList() { Token t(GetToken()); AssertTokenType(t.type, Token::ANGLE_BRACKET_OPEN); - auto_ptr props(new PropertyList); + unique_ptr props(new PropertyList); while (t.type != Token::ANGLE_BRACKET_CLOSE) { Token name(GetToken());