]> git.localhorst.tv Git - l2e.git/commitdiff
new language, new compiler master
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 28 Jan 2019 16:49:07 +0000 (17:49 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 28 Jan 2019 16:49:07 +0000 (17:49 +0100)
src/common/ScriptRunner.cpp
src/loader/Interpreter.cpp
src/loader/Parser.cpp

index 947ded712b5a59912552b6de19593190dfbbe5f6..6c2d2fa5b2997fb3929b8c837c919e7c3b6169dd 100644 (file)
@@ -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;
 
index a1fdc8250639ec81ee3e9613e06dcf37ddb401d5..1888361c465dd3c75de8f8a0057e68f8025bd0ec 100644 (file)
@@ -625,6 +625,8 @@ void Interpreter::ReadScript(const std::vector<ScriptToken *> &s, Script *script
                                                ReadScriptVector(**i, text + cursor);
                                                cursor += sizeof(Vector<int>);
                                                break;
+                                       default:
+                                               break;
                                }
                        }
                } else if (cmd == "add") {
@@ -671,6 +673,8 @@ void Interpreter::ReadScript(const std::vector<ScriptToken *> &s, Script *script
                                                ReadScriptVector(**i, text + cursor);
                                                cursor += sizeof(Vector<int>);
                                                break;
+                                       default:
+                                               break;
                                }
                        }
                } else if (cmd == "mod") {
index 89e3931e9529ccdf2dd4ce3c6a5fae6544a1cd35..25a99b6d2314dbc7f7e6e591e80dee875a040b2e 100644 (file)
@@ -3,12 +3,12 @@
 #include "ParsedSource.h"
 #include "utility.h"
 
-#include <auto_ptr.h>
 #include <fstream>
+#include <memory>
 #include <string>
 #include <vector>
 
-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> propertyList(ParsePropertyList());
-                       auto_ptr<Definition> dfn(new Definition(typeName, identifier));
+                       unique_ptr<PropertyList> propertyList(ParsePropertyList());
+                       unique_ptr<Definition> dfn(new Definition(typeName, identifier));
                        dfn->SetValue(propertyList.release());
                        product.AddDefinition(dfn.get());
                        return dfn.release();
                } else if (BeginningOfPrimitiveLiteral(t)) {
-                       auto_ptr<Literal> literal(ParseLiteral());
-                       auto_ptr<Definition> dfn(new Definition(typeName, identifier));
+                       unique_ptr<Literal> literal(ParseLiteral());
+                       unique_ptr<Definition> 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<PropertyList> props(new PropertyList);
+       unique_ptr<PropertyList> props(new PropertyList);
 
        while (t.type != Token::ANGLE_BRACKET_CLOSE) {
                Token name(GetToken());