Quellcode durchsuchen

moved from make to meson, recoded most parts

Kajetan Johannes Hammerle vor 5 Jahren
Ursprung
Commit
2365c826b0
100 geänderte Dateien mit 355 neuen und 2072 gelöschten Zeilen
  1. 0 3
      .gitignore
  2. 13 6
      Main.cpp
  3. 0 38
      Makefile
  4. 23 0
      code/ISnuviLogger.h
  5. 0 0
      code/Script.cpp
  6. 0 0
      code/Script.h
  7. 5 0
      exceptions/PreScriptException.cpp
  8. 17 0
      exceptions/PreScriptException.h
  9. 7 0
      meson.build
  10. 0 22
      snuviscript/code/ISnuviLogger.h
  11. 0 11
      snuviscript/exceptions/PreScriptException.cpp
  12. 0 22
      snuviscript/exceptions/PreScriptException.h
  13. 0 159
      snuviscript/test/Test.cpp
  14. 0 26
      snuviscript/test/Test.h
  15. 0 72
      snuviscript/test/TestLogger.cpp
  16. 0 32
      snuviscript/test/TestLogger.h
  17. 0 28
      snuviscript/tokenizer/DoubleToken.cpp
  18. 0 20
      snuviscript/tokenizer/DoubleToken.h
  19. 0 19
      snuviscript/tokenizer/StringToken.cpp
  20. 0 20
      snuviscript/tokenizer/StringToken.h
  21. 0 46
      snuviscript/tokenizer/Token.cpp
  22. 0 26
      snuviscript/tokenizer/Token.h
  23. 0 48
      snuviscript/tokenizer/Tokenizer.h
  24. 156 0
      test/Test.cpp
  25. 9 0
      test/Test.h
  26. 92 0
      test/TestLogger.cpp
  27. 33 0
      test/TestLogger.h
  28. 0 10
      test/arrays/array_dim1
  29. 0 37
      test/arrays/array_dim1.cout
  30. 0 3
      test/arrays/array_dim1.out
  31. 0 59
      test/arrays/array_dim1.tout
  32. 0 15
      test/arrays/array_dim2
  33. 0 72
      test/arrays/array_dim2.cout
  34. 0 6
      test/arrays/array_dim2.out
  35. 0 111
      test/arrays/array_dim2.tout
  36. 0 21
      test/arrays/array_dim3
  37. 0 111
      test/arrays/array_dim3.cout
  38. 0 24
      test/arrays/array_dim3.out
  39. 0 169
      test/arrays/array_dim3.tout
  40. 0 8
      test/basic/gosub
  41. 0 10
      test/basic/gosub.cout
  42. 0 3
      test/basic/gosub.out
  43. 0 28
      test/basic/gosub.tout
  44. 0 21
      test/basic/goto
  45. 0 25
      test/basic/goto.cout
  46. 0 4
      test/basic/goto.out
  47. 0 66
      test/basic/goto.tout
  48. 0 7
      test/basic/local
  49. 0 9
      test/basic/local.cout
  50. 0 1
      test/basic/local.out
  51. 0 21
      test/basic/local.tout
  52. 0 2
      test/basic/print
  53. 0 4
      test/basic/print.cout
  54. 0 2
      test/basic/print.out
  55. 0 11
      test/basic/print.tout
  56. 0 4
      test/basic/unicode
  57. 0 8
      test/basic/unicode.cout
  58. 0 4
      test/basic/unicode.out
  59. 0 21
      test/basic/unicode.tout
  60. 0 15
      test/calc/base
  61. 0 58
      test/calc/base.cout
  62. 0 12
      test/calc/base.out
  63. 0 95
      test/calc/base.tout
  64. 0 1
      test/calc/comma
  65. 0 8
      test/calc/comma.cout
  66. 0 1
      test/calc/comma.out
  67. 0 12
      test/calc/comma.tout
  68. 0 8
      test/calc/mixed
  69. 0 60
      test/calc/mixed.cout
  70. 0 8
      test/calc/mixed.out
  71. 0 97
      test/calc/mixed.tout
  72. 0 1
      test/calc/mod
  73. 0 4
      test/calc/mod.cout
  74. 0 1
      test/calc/mod.out
  75. 0 8
      test/calc/mod.tout
  76. 0 4
      test/comments/comment0
  77. 0 6
      test/comments/comment0.cout
  78. 0 3
      test/comments/comment0.out
  79. 0 16
      test/comments/comment0.tout
  80. 0 4
      test/comments/comment1
  81. 0 4
      test/comments/comment1.cout
  82. 0 2
      test/comments/comment1.out
  83. 0 11
      test/comments/comment1.tout
  84. 0 4
      test/comments/comment2
  85. 0 6
      test/comments/comment2.cout
  86. 0 3
      test/comments/comment2.out
  87. 0 16
      test/comments/comment2.tout
  88. 0 4
      test/comments/comment3
  89. 0 6
      test/comments/comment3.cout
  90. 0 3
      test/comments/comment3.out
  91. 0 16
      test/comments/comment3.tout
  92. 0 2
      test/conditions/conditions0
  93. 0 4
      test/conditions/conditions0.cout
  94. 0 2
      test/conditions/conditions0.out
  95. 0 11
      test/conditions/conditions0.tout
  96. 0 4
      test/conditions/conditions1
  97. 0 20
      test/conditions/conditions1.cout
  98. 0 4
      test/conditions/conditions1.out
  99. 0 29
      test/conditions/conditions1.tout
  100. 0 4
      test/conditions/conditions2

+ 0 - 3
.gitignore

@@ -1,4 +1 @@
-/nbproject
-lonely_tiger
 *.java
-*.o

+ 13 - 6
Main.cpp

@@ -1,10 +1,17 @@
-#include "snuviscript/test/Test.h"
+#include <cstring>
+#include <iostream>
+
+#include "test/Test.h"
 
 int main(int argc, char** argv) 
 {        
-    Test::test();
+    if(argc <= 0)
+    {
+        return 0;
+    }
+    if(argc >= 3 && strcmp(argv[1], "test") == 0)
+    {
+        Test::start(argv[2]);
+    }
     return 0;
-}
-
-
-
+}

+ 0 - 38
Makefile

@@ -1,38 +0,0 @@
-VERSION = -Wall -std=c++14
-
-run: lonely_tiger
-	./lonely_tiger
-	
-lonely_tiger: Main.cpp Test.o Token.o DoubleToken.o StringToken.o TokenType.o Tokenizer.o TestLogger.o PreScriptException.o
-	g++ $(VERSION) -o $@ Main.cpp *.o
-	
-clean:
-	rm lonely_tiger *.o
-	
-	
-PreScriptException.o: snuviscript/exceptions/PreScriptException.cpp snuviscript/exceptions/PreScriptException.h
-	g++ $(VERSION) -c snuviscript/exceptions/PreScriptException.cpp -o $@	
-
-Test.o: snuviscript/test/Test.cpp snuviscript/test/Test.h
-	g++ $(VERSION) -c snuviscript/test/Test.cpp -o $@
-	
-TestLogger.o: snuviscript/test/TestLogger.cpp snuviscript/test/TestLogger.h
-	g++ $(VERSION) -c snuviscript/test/TestLogger.cpp -o $@
-	
-StringObject.o: snuviscript/base/StringObject.cpp snuviscript/base/StringObject.h
-	g++ $(VERSION) -c snuviscript/base/StringObject.cpp -o $@
-	
-Token.o: snuviscript/tokenizer/Token.cpp snuviscript/tokenizer/Token.h
-	g++ $(VERSION) -c snuviscript/tokenizer/Token.cpp -o $@
-	
-DoubleToken.o: snuviscript/tokenizer/DoubleToken.cpp snuviscript/tokenizer/DoubleToken.h
-	g++ $(VERSION) -c snuviscript/tokenizer/DoubleToken.cpp -o $@
-	
-StringToken.o: snuviscript/tokenizer/StringToken.cpp snuviscript/tokenizer/StringToken.h
-	g++ $(VERSION) -c snuviscript/tokenizer/StringToken.cpp -o $@
-	
-TokenType.o: snuviscript/tokenizer/TokenType.cpp snuviscript/tokenizer/TokenType.h
-	g++ $(VERSION) -c snuviscript/tokenizer/TokenType.cpp -o $@
-	
-Tokenizer.o: snuviscript/tokenizer/Tokenizer.cpp snuviscript/tokenizer/Tokenizer.h
-	g++ $(VERSION) -c snuviscript/tokenizer/Tokenizer.cpp -o $@

+ 23 - 0
code/ISnuviLogger.h

@@ -0,0 +1,23 @@
+#ifndef ISNUVILOGGER_H
+#define ISNUVILOGGER_H
+
+#include <string>
+#include <exception>
+
+#include "code/Script.h"
+
+class ISnuviLogger
+{
+public:
+    virtual ~ISnuviLogger() = default;
+    virtual void print(
+            const std::string* message = nullptr, 
+            const std::exception* ex = nullptr, 
+            const std::string* function = nullptr, 
+            const std::string* scriptname = nullptr, 
+            const Script* sc = nullptr,
+            int line = -1) = 0;
+};
+
+#endif
+

+ 0 - 0
snuviscript/code/Script.cpp → code/Script.cpp


+ 0 - 0
snuviscript/code/Script.h → code/Script.h


+ 5 - 0
exceptions/PreScriptException.cpp

@@ -0,0 +1,5 @@
+#include "exceptions/PreScriptException.h"
+
+PreScriptException::PreScriptException(const std::string& message, unsigned int line) : message(message), line(line)
+{
+}

+ 17 - 0
exceptions/PreScriptException.h

@@ -0,0 +1,17 @@
+#ifndef PRESCRIPTEXCEPTION_H
+#define PRESCRIPTEXCEPTION_H
+
+#include <exception>
+#include <string>
+
+class PreScriptException : public std::exception
+{
+public:
+    PreScriptException(const std::string& message, unsigned int line);
+    
+private:
+    std::string message;
+    int line;
+};
+
+#endif

+ 7 - 0
meson.build

@@ -0,0 +1,7 @@
+project('lonely tiger', 'cpp')
+
+src = ['Main.cpp', 'test/Test.cpp', 'test/TestLogger.cpp', 'tokenizer/Token.cpp', 'tokenizer/TokenType.cpp', 'tokenizer/Tokenizer.cpp', 'exceptions/PreScriptException.cpp']
+
+executable('lonely_tiger', 
+    sources: src,
+    cpp_args: ['-Wall', '-Wextra', '-pedantic', '-Werror'])

+ 0 - 22
snuviscript/code/ISnuviLogger.h

@@ -1,22 +0,0 @@
-#ifndef ISNUVILOGGER_H
-#define ISNUVILOGGER_H
-
-#include <string>
-#include <exception>
-#include "Script.h"
-
-using namespace std;
-
-class ISnuviLogger
-{
-    virtual void print(
-            const string* message = nullptr, 
-            exception* ex = nullptr, 
-            const string* function = nullptr, 
-            const string* scriptname = nullptr, 
-            const Script* sc = nullptr,
-            int line = -1) = 0;
-};
-
-#endif
-

+ 0 - 11
snuviscript/exceptions/PreScriptException.cpp

@@ -1,11 +0,0 @@
-#include "PreScriptException.h"
-
-PreScriptException::PreScriptException(string message, int line) : message(message), line(line)
-{
-}
-
-/*const char* PreScriptException::what() const
-{
-    return message;
-}*/
-

+ 0 - 22
snuviscript/exceptions/PreScriptException.h

@@ -1,22 +0,0 @@
-#ifndef PRESCRIPTEXCEPTION_H
-#define PRESCRIPTEXCEPTION_H
-
-#include <exception>
-#include <string>
-
-using namespace std;
-
-class PreScriptException : public exception
-{
-public:
-    PreScriptException(string message, int line);
-
-    //const char* what() const override;
-    
-private:
-    string message;
-    int line;
-};
-
-#endif
-

+ 0 - 159
snuviscript/test/Test.cpp

@@ -1,159 +0,0 @@
-#include "Test.h"
-#include <dirent.h>
-#include <cstring>
-#include "../tokenizer/Tokenizer.h"
-
-int Test::done = 0;
-int Test::tests = 0;
-TestLogger Test::logger;
-
-void Test::test()
-{
-    testTokenizer();
-    //testCompiler();
-    //testOutput();
-}
-
-void Test::testTokenizer()
-{
-    done = 0;
-    tests = 0;
-    forEachFile("test", ".tout", [](const string& input, const string& output)
-    {
-        tests++;
-        
-        vector<unique_ptr<istream>> streams;
-        streams.push_back(unique_ptr<istream>(new fstream));
-        ((fstream*) streams[0].get())->open(input);
-        
-        fstream oStream;
-        oStream.open(output);
-        
-        if(!streams[0]->good() || !oStream.good())
-        {
-            return;
-        }
-        
-        Tokenizer tokenizer;
-        vector<unique_ptr<Token>> tokens;
-        
-        try
-        {
-            tokenizer.tokenize(tokens, streams);
-        }
-        catch(exception& ex)
-        {
-            return;
-        }
-        
-        logger.reset();
-        for(unsigned int i = 0; i < tokens.size(); i++)
-        {
-            string s = tokens[i]->toString();
-            logger.print(&s);
-        }
-        
-        if(logger.check(input, oStream))
-        {
-            done++;
-        }
-    });
-    cout << done << " / " << tests << " tokenizer tests succeeded" << endl;
-}
-
-void Test::testCompiler()
-{
-    /*
-     done = 0;
-        tests = 0; 
-        final Compiler c = new Compiler();
-        forEachFile(new File("./test"), ".cout", (inFile, checkFile) -> 
-        {
-            tests++;
-            try
-            {
-                try(FileInputStream in = new FileInputStream(inFile))
-                {
-                    Tokenizer tokenizer = new Tokenizer();
-                    LOGGER.reset();
-                    Instruction[] instr = c.compile(tokenizer.tokenize(in), 
-                            new HashMap<>(), new HashMap<>(), new HashMap<>(), 
-                            new HashMap<>());
-                    for(Instruction i : instr)
-                    {
-                        LOGGER.print(i.toString(), null, null, null, null, -1);
-                    }
-                    if(LOGGER.check(checkFile))
-                    {
-                        done++;
-                    }
-                }
-            }
-            catch(Exception ex)
-            {
-                System.out.println("_________________________________________");
-                System.out.println(inFile + " failed:");
-                System.out.println(ex.getMessage());
-                ex.printStackTrace();
-            }
-        });
-        System.out.println(String.format("%d / %d compiler tests succeeded", done, tests));
-     
-     */
-}
-
-void Test::testOutput()
-{
-    /*
-     
-     done = 0;
-        tests = 0;  
-        forEachFile(new File("./test"), ".out", (inFile, checkFile) -> 
-        {
-            tests++;
-                
-            LOGGER.reset();
-            
-            Script sc = new Script(PARSER, null, null, inFile.getName(), inFile.getPath());
-            sc.run();
-
-            if(LOGGER.check(checkFile))
-            {
-                done++;
-            }
-        });
-        System.out.println(String.format("%d / %d output tests succeeded", done, tests));
-     
-     */
-}
-
-void Test::forEachFile(const string& path, const string& ending, void (*f) (const string&, const string&))
-{
-    DIR* dir;
-    dir = opendir(path.c_str());
-    struct dirent* entry = nullptr;
-    if(dir != nullptr)
-    {
-        while((entry = readdir(dir)) != nullptr)
-        {
-            if(strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0)
-            {
-                continue;
-            }
-            if(entry->d_type == DT_DIR) // Folder
-            {
-                forEachFile(path + "/" + entry->d_name, ending, f);
-            }
-            else if(entry->d_type == DT_REG) // File
-            {
-                if(strchr(entry->d_name, '.') == nullptr)
-                {
-                    string pathInputFile = path + "/" + entry->d_name;
-                    string pathOutputFile = pathInputFile + ending;
-                    f(pathInputFile, pathOutputFile);
-                }
-            }
-        }
-        closedir(dir);
-    }
-}

+ 0 - 26
snuviscript/test/Test.h

@@ -1,26 +0,0 @@
-#ifndef TEST_H
-#define TEST_H
-
-#include <iostream>
-#include "TestLogger.h"
-
-using namespace std;
-
-class Test
-{
-public:
-    static void test();
-private:
-    static int done;
-    static int tests;
-    static TestLogger logger;
-    
-    static void testTokenizer();
-    static void testCompiler();
-    static void testOutput();
-    
-    static void forEachFile(const string& path, const string& ending, void (*f) (const string&, const string&));
-};
-
-#endif
-

+ 0 - 72
snuviscript/test/TestLogger.cpp

@@ -1,72 +0,0 @@
-#include "TestLogger.h"
-
-TestLogger::TestLogger()
-{
-}
-
-void TestLogger::print(const string* message, exception* ex, const string* function, const string* scriptname, const Script* sc, int line)
-{
-    if(ex == nullptr)
-    {
-        if(message != nullptr)
-        {
-            output.push_back(*message);
-        }
-    }
-    else
-    {
-        output.push_back(ex->what());
-    }
-}
-
-void TestLogger::reset()
-{
-    output.clear();
-}
-
-bool TestLogger::check(const string& name, fstream& check)
-{
-    vector<string> file;
-    
-    while(!check.eof())
-    {
-        char buffer[256];
-        check.getline(buffer, 256);
-        if(buffer[0] != '\0')
-        {
-            file.push_back(buffer);
-        }
-    }
-    
-    if(file.size() != output.size())
-    {
-        printNoMatch(name, file);
-        return false;
-    }
-    for(unsigned int i = 0; i < file.size(); i++)
-    {
-        if(file[i] != output[i])
-        {
-            printNoMatch(name, file);
-            return false;
-        }
-    }
-    
-    return true;
-}
-
-void TestLogger::printNoMatch(const string& name, vector<string>& file)
-{
-    cout << "error checking " << name << endl;
-    cout << "Expected ---------------------------------------------" << endl;
-    for(unsigned int i = 0; i < file.size(); i++)
-    {
-        cout << file[i] << endl;
-    }
-    cout << "Actual -----------------------------------------------" << endl;
-    for(unsigned int i = 0; i < output.size(); i++)
-    {
-        cout << output[i] << endl;
-    }
-    cout << "------------------------------------------------------" << endl;
-}

+ 0 - 32
snuviscript/test/TestLogger.h

@@ -1,32 +0,0 @@
-#ifndef TESTLOGGER_H
-#define TESTLOGGER_H
-
-#include "../code/ISnuviLogger.h"
-#include <iostream>
-#include <fstream>
-#include <vector>
-
-using namespace std;
-
-class TestLogger : public ISnuviLogger
-{
-public:
-    TestLogger();
-    void print(
-            const string* message = nullptr, 
-            exception* ex = nullptr, 
-            const string* function = nullptr, 
-            const string* scriptname = nullptr, 
-            const Script* sc = nullptr,
-            int line = -1) override;
-    void reset();
-    bool check(const string& name, fstream& check);
-
-private:
-    void printNoMatch(const string& name, vector<string>& file);
-    
-    vector<string> output;
-};
-
-#endif
-

+ 0 - 28
snuviscript/tokenizer/DoubleToken.cpp

@@ -1,28 +0,0 @@
-#include "DoubleToken.h"
-
-DoubleToken::DoubleToken(TokenType tt, int line, double data) : Token(tt, line), data(data)
-{
-}
-
-DoubleToken::~DoubleToken()
-{
-}
-
-const void* DoubleToken::getData() const
-{
-    return &data;
-}
-
-string DoubleToken::getDataString() const
-{
-    if(data == (long) data)
-    {
-        char buffer[20];
-        snprintf(buffer, 20, "%lg.0", data);
-        return buffer;
-    }
-    char buffer[20];
-    snprintf(buffer, 20, "%lg", data);
-    return buffer;
-}
-

+ 0 - 20
snuviscript/tokenizer/DoubleToken.h

@@ -1,20 +0,0 @@
-#ifndef DOUBLETOKEN_H
-#define DOUBLETOKEN_H
-
-#include "Token.h"
-
-class DoubleToken : public Token
-{
-public:
-    DoubleToken(TokenType tt, int line, double data);
-    ~DoubleToken();
-    
-    const void* getData() const override;
-    string getDataString() const override;
-    
-private:
-    double data;
-};
-
-#endif
-

+ 0 - 19
snuviscript/tokenizer/StringToken.cpp

@@ -1,19 +0,0 @@
-#include "StringToken.h"
-
-StringToken::StringToken(TokenType tt, int line, string data) : Token(tt, line), data(data)
-{
-}
-
-StringToken::~StringToken()
-{
-}
-
-const void* StringToken::getData() const
-{
-    return &data;
-}
-
-string StringToken::getDataString() const
-{
-    return "\"" + data + "\"";
-}

+ 0 - 20
snuviscript/tokenizer/StringToken.h

@@ -1,20 +0,0 @@
-#ifndef STRINGTOKEN_H
-#define STRINGTOKEN_H
-
-#include "Token.h"
-
-class StringToken : public Token
-{
-public:
-    StringToken(TokenType tt, int line, string data);
-    virtual ~StringToken();
-    
-    const void* getData() const override;
-    string getDataString() const override;
-    
-private:
-    string data;
-};
-
-#endif
-

+ 0 - 46
snuviscript/tokenizer/Token.cpp

@@ -1,46 +0,0 @@
-#include "Token.h"
-#include <sstream>
-
-Token::Token(TokenType tt, int line) : type(tt), line(line)
-{
-}
-
-Token::~Token()
-{
-}
-
-TokenType Token::getType() const
-{
-    return type;
-}
-
-int Token::getLine() const
-{
-    return line;
-}
-
-const void* Token::getData() const
-{
-    return nullptr;
-}
-
-string Token::getDataString() const
-{
-    return "";
-}
-
-string Token::toString() const
-{
-    stringstream ss;
-    ss << '(';
-    ss << line;
-    ss << ", ";
-    ss << TokenTypeUtils::getEnumName(type);
-    if(getData() != nullptr)
-    {
-        ss << ", ";
-        ss << getDataString();
-    }
-    ss << ')';
-    return ss.str();
-}

+ 0 - 26
snuviscript/tokenizer/Token.h

@@ -1,26 +0,0 @@
-#ifndef TOKEN_H
-#define TOKEN_H
-
-#include "TokenType.h"
-#include <memory>
-#include "../base/Object.h"
-
-class Token
-{
-public:
-    Token(TokenType tt, int line);
-    virtual ~Token();
-    
-    TokenType getType() const;
-    int getLine() const;
-    virtual const void* getData() const;
-    virtual string getDataString() const;
-    virtual string toString() const;
-    
-private:
-    TokenType type;
-    int line;
-};
-
-#endif
-

+ 0 - 48
snuviscript/tokenizer/Tokenizer.h

@@ -1,48 +0,0 @@
-#ifndef TOKENIZER_H
-#define TOKENIZER_H
-
-#include "Token.h"
-#include "DoubleToken.h"
-#include "StringToken.h"
-#include <vector>
-#include <memory>
-
-using namespace std;
-
-class Tokenizer
-{
-public:
-    Tokenizer();
-    
-    void tokenize(vector<unique_ptr<Token>>& tokens, vector<unique_ptr<istream>>& streams);
-    
-private:
-    int next();
-    int peek();
-    bool next(char c);
-    void add(TokenType type);
-    void add(TokenType type, double data);
-    void add(TokenType type, string data);
-    void add(char c, TokenType t1, TokenType t2, TokenType t3, TokenType t4);
-    void handleChar(int c);
-    void handleLiteral(int c, TokenType type);
-    void handleNumber(int c);
-    void handleSpecial(int c);
-    void handleString();
-    void handleSlash();
-    void handleOneLineComment();
-    void handleMultiLineComment();
-    
-    bool isLetter(int c);
-    bool isDigit(int c);
-    bool isValidNamePart(int c);
-    
-    int buffer;
-    unsigned int line;
-    vector<unique_ptr<Token>>* tokens;
-    unsigned int streamIndex;
-    vector<unique_ptr<istream>>* streams;
-};
-
-#endif
-

+ 156 - 0
test/Test.cpp

@@ -0,0 +1,156 @@
+#include <iostream>
+#include <fstream>
+#include <cstring>
+#include <vector>
+
+#include <dirent.h>
+
+#include "test/Test.h"
+#include "test/TestLogger.h"
+#include "tokenizer/Token.h"
+#include "tokenizer/Tokenizer.h"
+    
+static unsigned int done = 0;
+static unsigned int tests = 0;
+static TestLogger logger;
+
+static void forEachFile(const std::string& path, const std::string& ending, void (*f) (const std::string&, const std::string&))
+{
+    DIR* dir;
+    dir = opendir(path.c_str());
+    struct dirent* entry = nullptr;
+    if(dir != nullptr)
+    {
+        while((entry = readdir(dir)) != nullptr)
+        {
+            if(strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0)
+            {
+                continue;
+            }
+            if(entry->d_type == DT_DIR) // Folder
+            {
+                forEachFile(path + "/" + entry->d_name, ending, f);
+            }
+            else if(entry->d_type == DT_REG) // File
+            {
+                if(strchr(entry->d_name, '.') == nullptr)
+                {
+                    std::string pathInputFile = path + "/" + entry->d_name;
+                    std::string pathOutputFile = pathInputFile + ending;
+                    f(pathInputFile, pathOutputFile);
+                }
+            }
+        }
+        closedir(dir);
+    }
+}
+
+static void testTokenizer(const char* path)
+{
+    done = 0;
+    tests = 0;
+    forEachFile(path, ".tout", [](const std::string& input, const std::string& output)
+    {
+        tests++;
+        
+        std::ifstream iStream;
+        iStream.open(input);
+        
+        std::ifstream oStream;
+        oStream.open(output);
+        
+        if(!iStream.good() || !oStream.good())
+        {
+            return;
+        }
+        
+        std::vector<Token> tokens;
+        try
+        {
+            Tokenizer::tokenize(tokens, iStream);
+        }
+        catch(std::exception& ex)
+        {
+            return;
+        }
+        
+        logger.reset();
+        for(Token& token : tokens)
+        {
+            std::string s = token.toString();
+            logger.print(&s);
+        }
+        
+        if(logger.check(input, oStream))
+        {
+            done++;
+        }
+    });
+    std::cout << done << " / " << tests << " tokenizer tests succeeded" << std::endl;
+}
+
+//void Test::testCompiler()
+//{
+//     done = 0;
+//        tests = 0; 
+//        final Compiler c = new Compiler();
+//        forEachFile(new File("./test"), ".cout", (inFile, checkFile) -> 
+//        {
+//            tests++;
+//            try
+//            {
+//                try(FileInputStream in = new FileInputStream(inFile))
+//                {
+//                    Tokenizer tokenizer = new Tokenizer();
+//                    LOGGER.reset();
+//                    Instruction[] instr = c.compile(tokenizer.tokenize(in), 
+//                            new HashMap<>(), new HashMap<>(), new HashMap<>(), 
+//                            new HashMap<>());
+//                    for(Instruction i : instr)
+//                    {
+//                        LOGGER.print(i.toString(), null, null, null, null, -1);
+//                    }
+//                    if(LOGGER.check(checkFile))
+//                    {
+//                        done++;
+//                    }
+//                }
+//            }
+//            catch(Exception ex)
+//            {
+//                System.out.println("_________________________________________");
+//                System.out.println(inFile + " failed:");
+//                System.out.println(ex.getMessage());
+//                ex.printStackTrace();
+//            }
+//        });
+//        System.out.println(String.format("%d / %d compiler tests succeeded", done, tests));
+//}
+//
+//void Test::testOutput()
+//{
+//     done = 0;
+//        tests = 0;  
+//        forEachFile(new File("./test"), ".out", (inFile, checkFile) -> 
+//        {
+//            tests++;
+//                
+//            LOGGER.reset();
+//            
+//            Script sc = new Script(PARSER, null, null, inFile.getName(), inFile.getPath());
+//            sc.run();
+//
+//            if(LOGGER.check(checkFile))
+//            {
+//                done++;
+//            }
+//        });
+//        System.out.println(String.format("%d / %d output tests succeeded", done, tests));
+//}
+
+void Test::start(const char* path)
+{
+    testTokenizer(path);
+    //testCompiler();
+    //testOutput();
+}

+ 9 - 0
test/Test.h

@@ -0,0 +1,9 @@
+#ifndef TEST_H
+#define TEST_H
+
+namespace Test
+{
+    void start(const char* path);
+}
+
+#endif

+ 92 - 0
test/TestLogger.cpp

@@ -0,0 +1,92 @@
+#include "TestLogger.h"
+
+TestLogger::TestLogger()
+{
+}
+
+TestLogger::~TestLogger()
+{
+}
+
+void TestLogger::print(const std::string* message, const std::exception* ex, 
+        const std::string* function, const std::string* scriptname, const Script* sc, int line)
+{
+    (void) function;
+    (void) scriptname;
+    (void) sc;
+    (void) line;
+    if(ex == nullptr)
+    {
+        if(message != nullptr)
+        {
+            int start = 0;
+            while(true)
+            {
+                int newLine = message->find('\n', start);
+                if(newLine == -1)
+                {
+                    output.push_back(message->substr(start, message->size() - start));
+                    break;
+                }
+                output.push_back(message->substr(start, newLine - start));
+                start = newLine + 1;
+            }
+        }
+    }
+    else
+    {
+        output.push_back(ex->what());
+    }
+}
+
+void TestLogger::reset()
+{
+    output.clear();
+}
+
+bool TestLogger::check(const std::string& name, std::ifstream& check)
+{
+    std::vector<std::string> file;
+    
+    while(!check.eof())
+    {
+        std::string line;
+        std::getline(check, line);
+        if(!check.eof())
+        {
+            file.push_back(line);
+        }
+    }
+    
+    if(file.size() != output.size())
+    {
+        std::cout << file.size() << " " << output.size() << std::endl;
+        printNoMatch(name, file, 0);
+        return false;
+    }
+    for(size_t i = 0; i < file.size(); i++)
+    {
+        if(file[i] != output[i])
+        {
+            printNoMatch(name, file, i + 1);
+            return false;
+        }
+    }
+    return true;
+}
+
+void TestLogger::printNoMatch(const std::string& name, std::vector<std::string>& file, unsigned int line)
+{
+    std::cout << "error checking " << name << ", error starting at " << line << "\n";
+    std::cout << "Expected ---------------------------------------------\n";
+    for(unsigned int i = 0; i < file.size(); i++)
+    {
+        std::cout << file[i] << "\n";
+    }
+    std::cout << "Actual -----------------------------------------------\n";
+    for(unsigned int i = 0; i < output.size(); i++)
+    {
+        std::cout << output[i] << "\n";
+    }
+    std::cout << "------------------------------------------------------\n";
+}

+ 33 - 0
test/TestLogger.h

@@ -0,0 +1,33 @@
+#ifndef TESTLOGGER_H
+#define TESTLOGGER_H
+
+#include <iostream>
+#include <fstream>
+#include <vector>
+
+#include "code/ISnuviLogger.h"
+
+class TestLogger : public ISnuviLogger
+{
+public:
+    TestLogger();
+    ~TestLogger();
+    
+    void print(
+            const std::string* message = nullptr, 
+            const std::exception* ex = nullptr, 
+            const std::string* function = nullptr, 
+            const std::string* scriptname = nullptr, 
+            const Script* sc = nullptr,
+            int line = -1) override;
+    
+    void reset();
+    bool check(const std::string& name, std::ifstream& check);
+
+private:
+    void printNoMatch(const std::string& name, std::vector<std::string>& file, unsigned int line);
+    
+    std::vector<std::string> output;
+};
+
+#endif

+ 0 - 10
test/arrays/array_dim1

@@ -1,10 +0,0 @@
-a = array.new(3);
-for(i = 0; i < array.length(a); i++)
-{
-    a[i] = i;
-}
-for(i = 0; i < array.length(a); i++)
-{
-    print(a[i]);
-}
-

+ 0 - 37
test/arrays/array_dim1.cout

@@ -1,37 +0,0 @@
-push a
-push 3
-use array.new(1)
-use =(2)
-push i
-push 0
-use =(2)
-push i
-push a
-use array.getsize(1)
-use <(2)
-goto(14)
-push i
-use p++(1)
-goto(6)
-for(20)
-push i
-push a[]
-push i
-use =(2)
-goto(11)
-push i
-push 0
-use =(2)
-push i
-push a
-use array.getsize(1)
-use <(2)
-goto(31)
-push i
-use p++(1)
-goto(23)
-for(36)
-push i
-push a[]
-use print(1)
-goto(28)

+ 0 - 3
test/arrays/array_dim1.out

@@ -1,3 +0,0 @@
-0.0
-1.0
-2.0

+ 0 - 59
test/arrays/array_dim1.tout

@@ -1,59 +0,0 @@
-(1, LITERAL, "a")
-(1, SET)
-(1, LITERAL, "array.new")
-(1, OPEN_BRACKET)
-(1, NUMBER, 3.0)
-(1, CLOSE_BRACKET)
-(1, SEMICOLON)
-(2, FOR)
-(2, OPEN_BRACKET)
-(2, LITERAL, "i")
-(2, SET)
-(2, NUMBER, 0.0)
-(2, SEMICOLON)
-(2, LITERAL, "i")
-(2, LESS)
-(2, LITERAL, "array.length")
-(2, OPEN_BRACKET)
-(2, LITERAL, "a")
-(2, CLOSE_BRACKET)
-(2, SEMICOLON)
-(2, LITERAL, "i")
-(2, INC)
-(2, CLOSE_BRACKET)
-(3, OPEN_CURVED_BRACKET)
-(4, LITERAL, "a")
-(4, OPEN_SQUARE_BRACKET)
-(4, LITERAL, "i")
-(4, CLOSE_SQUARE_BRACKET)
-(4, SET)
-(4, LITERAL, "i")
-(4, SEMICOLON)
-(5, CLOSE_CURVED_BRACKET)
-(6, FOR)
-(6, OPEN_BRACKET)
-(6, LITERAL, "i")
-(6, SET)
-(6, NUMBER, 0.0)
-(6, SEMICOLON)
-(6, LITERAL, "i")
-(6, LESS)
-(6, LITERAL, "array.length")
-(6, OPEN_BRACKET)
-(6, LITERAL, "a")
-(6, CLOSE_BRACKET)
-(6, SEMICOLON)
-(6, LITERAL, "i")
-(6, INC)
-(6, CLOSE_BRACKET)
-(7, OPEN_CURVED_BRACKET)
-(8, LITERAL, "print")
-(8, OPEN_BRACKET)
-(8, LITERAL, "a")
-(8, OPEN_SQUARE_BRACKET)
-(8, LITERAL, "i")
-(8, CLOSE_SQUARE_BRACKET)
-(8, CLOSE_BRACKET)
-(8, SEMICOLON)
-(9, CLOSE_CURVED_BRACKET)
-(11, EOF)

+ 0 - 15
test/arrays/array_dim2

@@ -1,15 +0,0 @@
-a = array.new(3, 2);
-for(x = 0; x < array.length(a); x++)
-{
-    for(y = 0; y < array.length(a[x]); y++)
-    {
-        a[x, y] = x * 2 + y;
-    }
-}
-for(x = 0; x < array.length(a); x++)
-{
-    for(y = 0; y < array.length(a[x]); y++)
-    {
-        print(a[x, y]);
-    }
-}

+ 0 - 72
test/arrays/array_dim2.cout

@@ -1,72 +0,0 @@
-push a
-push 3
-push 2
-use array.new(2)
-use =(2)
-push x
-push 0
-use =(2)
-push x
-push a
-use array.getsize(1)
-use <(2)
-goto(15)
-push x
-use p++(1)
-goto(7)
-for(40)
-push y
-push 0
-use =(2)
-push y
-push x
-push a[]
-use array.getsize(1)
-use <(2)
-goto(28)
-push y
-use p++(1)
-goto(19)
-for(39)
-push x
-push y
-push a[,]
-push x
-push 2
-use *(2)
-push y
-use +(2)
-use =(2)
-goto(25)
-goto(12)
-push x
-push 0
-use =(2)
-push x
-push a
-use array.getsize(1)
-use <(2)
-goto(51)
-push x
-use p++(1)
-goto(43)
-for(71)
-push y
-push 0
-use =(2)
-push y
-push x
-push a[]
-use array.getsize(1)
-use <(2)
-goto(64)
-push y
-use p++(1)
-goto(55)
-for(70)
-push x
-push y
-push a[,]
-use print(1)
-goto(61)
-goto(48)

+ 0 - 6
test/arrays/array_dim2.out

@@ -1,6 +0,0 @@
-0.0
-1.0
-2.0
-3.0
-4.0
-5.0

+ 0 - 111
test/arrays/array_dim2.tout

@@ -1,111 +0,0 @@
-(1, LITERAL, "a")
-(1, SET)
-(1, LITERAL, "array.new")
-(1, OPEN_BRACKET)
-(1, NUMBER, 3.0)
-(1, COMMA)
-(1, NUMBER, 2.0)
-(1, CLOSE_BRACKET)
-(1, SEMICOLON)
-(2, FOR)
-(2, OPEN_BRACKET)
-(2, LITERAL, "x")
-(2, SET)
-(2, NUMBER, 0.0)
-(2, SEMICOLON)
-(2, LITERAL, "x")
-(2, LESS)
-(2, LITERAL, "array.length")
-(2, OPEN_BRACKET)
-(2, LITERAL, "a")
-(2, CLOSE_BRACKET)
-(2, SEMICOLON)
-(2, LITERAL, "x")
-(2, INC)
-(2, CLOSE_BRACKET)
-(3, OPEN_CURVED_BRACKET)
-(4, FOR)
-(4, OPEN_BRACKET)
-(4, LITERAL, "y")
-(4, SET)
-(4, NUMBER, 0.0)
-(4, SEMICOLON)
-(4, LITERAL, "y")
-(4, LESS)
-(4, LITERAL, "array.length")
-(4, OPEN_BRACKET)
-(4, LITERAL, "a")
-(4, OPEN_SQUARE_BRACKET)
-(4, LITERAL, "x")
-(4, CLOSE_SQUARE_BRACKET)
-(4, CLOSE_BRACKET)
-(4, SEMICOLON)
-(4, LITERAL, "y")
-(4, INC)
-(4, CLOSE_BRACKET)
-(5, OPEN_CURVED_BRACKET)
-(6, LITERAL, "a")
-(6, OPEN_SQUARE_BRACKET)
-(6, LITERAL, "x")
-(6, COMMA)
-(6, LITERAL, "y")
-(6, CLOSE_SQUARE_BRACKET)
-(6, SET)
-(6, LITERAL, "x")
-(6, MUL)
-(6, NUMBER, 2.0)
-(6, ADD)
-(6, LITERAL, "y")
-(6, SEMICOLON)
-(7, CLOSE_CURVED_BRACKET)
-(8, CLOSE_CURVED_BRACKET)
-(9, FOR)
-(9, OPEN_BRACKET)
-(9, LITERAL, "x")
-(9, SET)
-(9, NUMBER, 0.0)
-(9, SEMICOLON)
-(9, LITERAL, "x")
-(9, LESS)
-(9, LITERAL, "array.length")
-(9, OPEN_BRACKET)
-(9, LITERAL, "a")
-(9, CLOSE_BRACKET)
-(9, SEMICOLON)
-(9, LITERAL, "x")
-(9, INC)
-(9, CLOSE_BRACKET)
-(10, OPEN_CURVED_BRACKET)
-(11, FOR)
-(11, OPEN_BRACKET)
-(11, LITERAL, "y")
-(11, SET)
-(11, NUMBER, 0.0)
-(11, SEMICOLON)
-(11, LITERAL, "y")
-(11, LESS)
-(11, LITERAL, "array.length")
-(11, OPEN_BRACKET)
-(11, LITERAL, "a")
-(11, OPEN_SQUARE_BRACKET)
-(11, LITERAL, "x")
-(11, CLOSE_SQUARE_BRACKET)
-(11, CLOSE_BRACKET)
-(11, SEMICOLON)
-(11, LITERAL, "y")
-(11, INC)
-(11, CLOSE_BRACKET)
-(12, OPEN_CURVED_BRACKET)
-(13, LITERAL, "print")
-(13, OPEN_BRACKET)
-(13, LITERAL, "a")
-(13, OPEN_SQUARE_BRACKET)
-(13, LITERAL, "x")
-(13, COMMA)
-(13, LITERAL, "y")
-(13, CLOSE_SQUARE_BRACKET)
-(13, CLOSE_BRACKET)
-(13, SEMICOLON)
-(14, CLOSE_CURVED_BRACKET)
-(15, CLOSE_CURVED_BRACKET)
-(16, EOF)

+ 0 - 21
test/arrays/array_dim3

@@ -1,21 +0,0 @@
-a = array.new(4, 3, 2);
-for(x = 0; x < array.length(a); x++)
-{
-    for(y = 0; y < array.length(a[x]); y++)
-    {
-        for(z = 0; z < array.length(a[x, y]); z++)
-        {
-            a[x, y, z] = x * 3 * 2 + y * 2 + z;
-        }
-    }
-}
-for(x = 0; x < array.length(a); x++)
-{
-    for(y = 0; y < array.length(a[x]); y++)
-    {
-        for(z = 0; z < array.length(a[x, y]); z++)
-        {
-            print(a[x, y, z]);
-        }
-    }
-}

+ 0 - 111
test/arrays/array_dim3.cout

@@ -1,111 +0,0 @@
-push a
-push 4
-push 3
-push 2
-use array.new(3)
-use =(2)
-push x
-push 0
-use =(2)
-push x
-push a
-use array.getsize(1)
-use <(2)
-goto(16)
-push x
-use p++(1)
-goto(8)
-for(63)
-push y
-push 0
-use =(2)
-push y
-push x
-push a[]
-use array.getsize(1)
-use <(2)
-goto(29)
-push y
-use p++(1)
-goto(20)
-for(62)
-push z
-push 0
-use =(2)
-push z
-push x
-push y
-push a[,]
-use array.getsize(1)
-use <(2)
-goto(43)
-push z
-use p++(1)
-goto(33)
-for(61)
-push x
-push y
-push z
-push a[,,]
-push x
-push 3
-use *(2)
-push 2
-use *(2)
-push y
-push 2
-use *(2)
-use +(2)
-push z
-use +(2)
-use =(2)
-goto(40)
-goto(26)
-goto(13)
-push x
-push 0
-use =(2)
-push x
-push a
-use array.getsize(1)
-use <(2)
-goto(74)
-push x
-use p++(1)
-goto(66)
-for(110)
-push y
-push 0
-use =(2)
-push y
-push x
-push a[]
-use array.getsize(1)
-use <(2)
-goto(87)
-push y
-use p++(1)
-goto(78)
-for(109)
-push z
-push 0
-use =(2)
-push z
-push x
-push y
-push a[,]
-use array.getsize(1)
-use <(2)
-goto(101)
-push z
-use p++(1)
-goto(91)
-for(108)
-push x
-push y
-push z
-push a[,,]
-use print(1)
-goto(98)
-goto(84)
-goto(71)

+ 0 - 24
test/arrays/array_dim3.out

@@ -1,24 +0,0 @@
-0.0
-1.0
-2.0
-3.0
-4.0
-5.0
-6.0
-7.0
-8.0
-9.0
-10.0
-11.0
-12.0
-13.0
-14.0
-15.0
-16.0
-17.0
-18.0
-19.0
-20.0
-21.0
-22.0
-23.0

+ 0 - 169
test/arrays/array_dim3.tout

@@ -1,169 +0,0 @@
-(1, LITERAL, "a")
-(1, SET)
-(1, LITERAL, "array.new")
-(1, OPEN_BRACKET)
-(1, NUMBER, 4.0)
-(1, COMMA)
-(1, NUMBER, 3.0)
-(1, COMMA)
-(1, NUMBER, 2.0)
-(1, CLOSE_BRACKET)
-(1, SEMICOLON)
-(2, FOR)
-(2, OPEN_BRACKET)
-(2, LITERAL, "x")
-(2, SET)
-(2, NUMBER, 0.0)
-(2, SEMICOLON)
-(2, LITERAL, "x")
-(2, LESS)
-(2, LITERAL, "array.length")
-(2, OPEN_BRACKET)
-(2, LITERAL, "a")
-(2, CLOSE_BRACKET)
-(2, SEMICOLON)
-(2, LITERAL, "x")
-(2, INC)
-(2, CLOSE_BRACKET)
-(3, OPEN_CURVED_BRACKET)
-(4, FOR)
-(4, OPEN_BRACKET)
-(4, LITERAL, "y")
-(4, SET)
-(4, NUMBER, 0.0)
-(4, SEMICOLON)
-(4, LITERAL, "y")
-(4, LESS)
-(4, LITERAL, "array.length")
-(4, OPEN_BRACKET)
-(4, LITERAL, "a")
-(4, OPEN_SQUARE_BRACKET)
-(4, LITERAL, "x")
-(4, CLOSE_SQUARE_BRACKET)
-(4, CLOSE_BRACKET)
-(4, SEMICOLON)
-(4, LITERAL, "y")
-(4, INC)
-(4, CLOSE_BRACKET)
-(5, OPEN_CURVED_BRACKET)
-(6, FOR)
-(6, OPEN_BRACKET)
-(6, LITERAL, "z")
-(6, SET)
-(6, NUMBER, 0.0)
-(6, SEMICOLON)
-(6, LITERAL, "z")
-(6, LESS)
-(6, LITERAL, "array.length")
-(6, OPEN_BRACKET)
-(6, LITERAL, "a")
-(6, OPEN_SQUARE_BRACKET)
-(6, LITERAL, "x")
-(6, COMMA)
-(6, LITERAL, "y")
-(6, CLOSE_SQUARE_BRACKET)
-(6, CLOSE_BRACKET)
-(6, SEMICOLON)
-(6, LITERAL, "z")
-(6, INC)
-(6, CLOSE_BRACKET)
-(7, OPEN_CURVED_BRACKET)
-(8, LITERAL, "a")
-(8, OPEN_SQUARE_BRACKET)
-(8, LITERAL, "x")
-(8, COMMA)
-(8, LITERAL, "y")
-(8, COMMA)
-(8, LITERAL, "z")
-(8, CLOSE_SQUARE_BRACKET)
-(8, SET)
-(8, LITERAL, "x")
-(8, MUL)
-(8, NUMBER, 3.0)
-(8, MUL)
-(8, NUMBER, 2.0)
-(8, ADD)
-(8, LITERAL, "y")
-(8, MUL)
-(8, NUMBER, 2.0)
-(8, ADD)
-(8, LITERAL, "z")
-(8, SEMICOLON)
-(9, CLOSE_CURVED_BRACKET)
-(10, CLOSE_CURVED_BRACKET)
-(11, CLOSE_CURVED_BRACKET)
-(12, FOR)
-(12, OPEN_BRACKET)
-(12, LITERAL, "x")
-(12, SET)
-(12, NUMBER, 0.0)
-(12, SEMICOLON)
-(12, LITERAL, "x")
-(12, LESS)
-(12, LITERAL, "array.length")
-(12, OPEN_BRACKET)
-(12, LITERAL, "a")
-(12, CLOSE_BRACKET)
-(12, SEMICOLON)
-(12, LITERAL, "x")
-(12, INC)
-(12, CLOSE_BRACKET)
-(13, OPEN_CURVED_BRACKET)
-(14, FOR)
-(14, OPEN_BRACKET)
-(14, LITERAL, "y")
-(14, SET)
-(14, NUMBER, 0.0)
-(14, SEMICOLON)
-(14, LITERAL, "y")
-(14, LESS)
-(14, LITERAL, "array.length")
-(14, OPEN_BRACKET)
-(14, LITERAL, "a")
-(14, OPEN_SQUARE_BRACKET)
-(14, LITERAL, "x")
-(14, CLOSE_SQUARE_BRACKET)
-(14, CLOSE_BRACKET)
-(14, SEMICOLON)
-(14, LITERAL, "y")
-(14, INC)
-(14, CLOSE_BRACKET)
-(15, OPEN_CURVED_BRACKET)
-(16, FOR)
-(16, OPEN_BRACKET)
-(16, LITERAL, "z")
-(16, SET)
-(16, NUMBER, 0.0)
-(16, SEMICOLON)
-(16, LITERAL, "z")
-(16, LESS)
-(16, LITERAL, "array.length")
-(16, OPEN_BRACKET)
-(16, LITERAL, "a")
-(16, OPEN_SQUARE_BRACKET)
-(16, LITERAL, "x")
-(16, COMMA)
-(16, LITERAL, "y")
-(16, CLOSE_SQUARE_BRACKET)
-(16, CLOSE_BRACKET)
-(16, SEMICOLON)
-(16, LITERAL, "z")
-(16, INC)
-(16, CLOSE_BRACKET)
-(17, OPEN_CURVED_BRACKET)
-(18, LITERAL, "print")
-(18, OPEN_BRACKET)
-(18, LITERAL, "a")
-(18, OPEN_SQUARE_BRACKET)
-(18, LITERAL, "x")
-(18, COMMA)
-(18, LITERAL, "y")
-(18, COMMA)
-(18, LITERAL, "z")
-(18, CLOSE_SQUARE_BRACKET)
-(18, CLOSE_BRACKET)
-(18, SEMICOLON)
-(19, CLOSE_CURVED_BRACKET)
-(20, CLOSE_CURVED_BRACKET)
-(21, CLOSE_CURVED_BRACKET)
-(22, EOF)

+ 0 - 8
test/basic/gosub

@@ -1,8 +0,0 @@
-print("start");
-gosub(@sub);
-gosub("sub");
-term();
-
-@sub
-print("hi");
-return;

+ 0 - 10
test/basic/gosub.cout

@@ -1,10 +0,0 @@
-push "start"
-use print(1)
-push "sub"
-use gosub(1)
-push "sub"
-use gosub(1)
-use term(0)
-push "hi"
-use print(1)
-return(0)

+ 0 - 3
test/basic/gosub.out

@@ -1,3 +0,0 @@
-start
-hi
-hi

+ 0 - 28
test/basic/gosub.tout

@@ -1,28 +0,0 @@
-(1, LITERAL, "print")
-(1, OPEN_BRACKET)
-(1, STRING, "start")
-(1, CLOSE_BRACKET)
-(1, SEMICOLON)
-(2, LITERAL, "gosub")
-(2, OPEN_BRACKET)
-(2, LABEL, "@sub")
-(2, CLOSE_BRACKET)
-(2, SEMICOLON)
-(3, LITERAL, "gosub")
-(3, OPEN_BRACKET)
-(3, STRING, "sub")
-(3, CLOSE_BRACKET)
-(3, SEMICOLON)
-(4, LITERAL, "term")
-(4, OPEN_BRACKET)
-(4, CLOSE_BRACKET)
-(4, SEMICOLON)
-(6, LABEL, "@sub")
-(7, LITERAL, "print")
-(7, OPEN_BRACKET)
-(7, STRING, "hi")
-(7, CLOSE_BRACKET)
-(7, SEMICOLON)
-(8, RETURN)
-(8, SEMICOLON)
-(9, EOF)

+ 0 - 21
test/basic/goto

@@ -1,21 +0,0 @@
-print("a");
-invstring = "";
-goto(@label4);
-@label3
-print("e");
-goto(@label5);
-@label4
-
-goto(@label1);
-print("b");
-@label1
-
-goto("label2");
-print("c");
-@label2;
-
-goto(@label3);
-@label5
-print("d");
-
-print("b");

+ 0 - 25
test/basic/goto.cout

@@ -1,25 +0,0 @@
-push "a"
-use print(1)
-push invstring
-push ""
-use =(2)
-push "label4"
-use goto(1)
-push "e"
-use print(1)
-push "label5"
-use goto(1)
-push "label1"
-use goto(1)
-push "b"
-use print(1)
-push "label2"
-use goto(1)
-push "c"
-use print(1)
-push "label3"
-use goto(1)
-push "d"
-use print(1)
-push "b"
-use print(1)

+ 0 - 4
test/basic/goto.out

@@ -1,4 +0,0 @@
-a
-e
-d
-b

+ 0 - 66
test/basic/goto.tout

@@ -1,66 +0,0 @@
-(1, LITERAL, "print")
-(1, OPEN_BRACKET)
-(1, STRING, "a")
-(1, CLOSE_BRACKET)
-(1, SEMICOLON)
-(2, LITERAL, "invstring")
-(2, SET)
-(2, STRING, "")
-(2, SEMICOLON)
-(3, LITERAL, "goto")
-(3, OPEN_BRACKET)
-(3, LABEL, "@label4")
-(3, CLOSE_BRACKET)
-(3, SEMICOLON)
-(4, LABEL, "@label3")
-(5, LITERAL, "print")
-(5, OPEN_BRACKET)
-(5, STRING, "e")
-(5, CLOSE_BRACKET)
-(5, SEMICOLON)
-(6, LITERAL, "goto")
-(6, OPEN_BRACKET)
-(6, LABEL, "@label5")
-(6, CLOSE_BRACKET)
-(6, SEMICOLON)
-(7, LABEL, "@label4")
-(9, LITERAL, "goto")
-(9, OPEN_BRACKET)
-(9, LABEL, "@label1")
-(9, CLOSE_BRACKET)
-(9, SEMICOLON)
-(10, LITERAL, "print")
-(10, OPEN_BRACKET)
-(10, STRING, "b")
-(10, CLOSE_BRACKET)
-(10, SEMICOLON)
-(11, LABEL, "@label1")
-(13, LITERAL, "goto")
-(13, OPEN_BRACKET)
-(13, STRING, "label2")
-(13, CLOSE_BRACKET)
-(13, SEMICOLON)
-(14, LITERAL, "print")
-(14, OPEN_BRACKET)
-(14, STRING, "c")
-(14, CLOSE_BRACKET)
-(14, SEMICOLON)
-(15, LABEL, "@label2")
-(15, SEMICOLON)
-(17, LITERAL, "goto")
-(17, OPEN_BRACKET)
-(17, LABEL, "@label3")
-(17, CLOSE_BRACKET)
-(17, SEMICOLON)
-(18, LABEL, "@label5")
-(19, LITERAL, "print")
-(19, OPEN_BRACKET)
-(19, STRING, "d")
-(19, CLOSE_BRACKET)
-(19, SEMICOLON)
-(21, LITERAL, "print")
-(21, OPEN_BRACKET)
-(21, STRING, "b")
-(21, CLOSE_BRACKET)
-(21, SEMICOLON)
-(22, EOF)

+ 0 - 7
test/basic/local

@@ -1,7 +0,0 @@
-print(get());
-
-function get()
-{
-    a = 5;
-    return a;
-}

+ 0 - 9
test/basic/local.cout

@@ -1,9 +0,0 @@
-use get(0)
-use print(1)
-get(8)
-push a#L
-push 5
-use =(2)
-push a#L
-return(1)
-return(0)

+ 0 - 1
test/basic/local.out

@@ -1 +0,0 @@
-5.0

+ 0 - 21
test/basic/local.tout

@@ -1,21 +0,0 @@
-(1, LITERAL, "print")
-(1, OPEN_BRACKET)
-(1, LITERAL, "get")
-(1, OPEN_BRACKET)
-(1, CLOSE_BRACKET)
-(1, CLOSE_BRACKET)
-(1, SEMICOLON)
-(3, FUNCTION)
-(3, LITERAL, "get")
-(3, OPEN_BRACKET)
-(3, CLOSE_BRACKET)
-(4, OPEN_CURVED_BRACKET)
-(5, LITERAL, "a")
-(5, SET)
-(5, NUMBER, 5.0)
-(5, SEMICOLON)
-(6, RETURN)
-(6, LITERAL, "a")
-(6, SEMICOLON)
-(7, CLOSE_CURVED_BRACKET)
-(8, EOF)

+ 0 - 2
test/basic/print

@@ -1,2 +0,0 @@
-print("HI");
-print( 	 "HI2"	  )  	;

+ 0 - 4
test/basic/print.cout

@@ -1,4 +0,0 @@
-push "HI"
-use print(1)
-push "HI2"
-use print(1)

+ 0 - 2
test/basic/print.out

@@ -1,2 +0,0 @@
-HI
-HI2

+ 0 - 11
test/basic/print.tout

@@ -1,11 +0,0 @@
-(1, LITERAL, "print")
-(1, OPEN_BRACKET)
-(1, STRING, "HI")
-(1, CLOSE_BRACKET)
-(1, SEMICOLON)
-(2, LITERAL, "print")
-(2, OPEN_BRACKET)
-(2, STRING, "HI2")
-(2, CLOSE_BRACKET)
-(2, SEMICOLON)
-(3, EOF)

+ 0 - 4
test/basic/unicode

@@ -1,4 +0,0 @@
-print("▇");
-print("äöü");
-print("ÄÖÜ");
-print("ß");

+ 0 - 8
test/basic/unicode.cout

@@ -1,8 +0,0 @@
-push "▇"
-use print(1)
-push "äöü"
-use print(1)
-push "ÄÖÜ"
-use print(1)
-push "ß"
-use print(1)

+ 0 - 4
test/basic/unicode.out

@@ -1,4 +0,0 @@
-▇
-äöü
-ÄÖÜ

+ 0 - 21
test/basic/unicode.tout

@@ -1,21 +0,0 @@
-(1, LITERAL, "print")
-(1, OPEN_BRACKET)
-(1, STRING, "▇")
-(1, CLOSE_BRACKET)
-(1, SEMICOLON)
-(2, LITERAL, "print")
-(2, OPEN_BRACKET)
-(2, STRING, "äöü")
-(2, CLOSE_BRACKET)
-(2, SEMICOLON)
-(3, LITERAL, "print")
-(3, OPEN_BRACKET)
-(3, STRING, "ÄÖÜ")
-(3, CLOSE_BRACKET)
-(3, SEMICOLON)
-(4, LITERAL, "print")
-(4, OPEN_BRACKET)
-(4, STRING, "ß")
-(4, CLOSE_BRACKET)
-(4, SEMICOLON)
-(5, EOF)

+ 0 - 15
test/calc/base

@@ -1,15 +0,0 @@
-print(1 + 1);
-print(1 + -3);
-
-print(1 - 3);
-print(1 - -3);
-
-print(4 * 3);
-print(6 * -3);
-print(-6 * 4);
-print(-6 * -4);
-
-print(4 / 2);
-print(6 / -2);
-print(-6 / 3);
-print(-6 / -2);

+ 0 - 58
test/calc/base.cout

@@ -1,58 +0,0 @@
-push 1
-push 1
-use +(2)
-use print(1)
-push 1
-push 3
-use -(1)
-use +(2)
-use print(1)
-push 1
-push 3
-use -(2)
-use print(1)
-push 1
-push 3
-use -(1)
-use -(2)
-use print(1)
-push 4
-push 3
-use *(2)
-use print(1)
-push 6
-push 3
-use -(1)
-use *(2)
-use print(1)
-push 6
-use -(1)
-push 4
-use *(2)
-use print(1)
-push 6
-use -(1)
-push 4
-use -(1)
-use *(2)
-use print(1)
-push 4
-push 2
-use /(2)
-use print(1)
-push 6
-push 2
-use -(1)
-use /(2)
-use print(1)
-push 6
-use -(1)
-push 3
-use /(2)
-use print(1)
-push 6
-use -(1)
-push 2
-use -(1)
-use /(2)
-use print(1)

+ 0 - 12
test/calc/base.out

@@ -1,12 +0,0 @@
-2.0
--2.0
--2.0
-4.0
-12.0
--18.0
--24.0
-24.0
-2.0
--3.0
--2.0
-3.0

+ 0 - 95
test/calc/base.tout

@@ -1,95 +0,0 @@
-(1, LITERAL, "print")
-(1, OPEN_BRACKET)
-(1, NUMBER, 1.0)
-(1, ADD)
-(1, NUMBER, 1.0)
-(1, CLOSE_BRACKET)
-(1, SEMICOLON)
-(2, LITERAL, "print")
-(2, OPEN_BRACKET)
-(2, NUMBER, 1.0)
-(2, ADD)
-(2, SUB)
-(2, NUMBER, 3.0)
-(2, CLOSE_BRACKET)
-(2, SEMICOLON)
-(4, LITERAL, "print")
-(4, OPEN_BRACKET)
-(4, NUMBER, 1.0)
-(4, SUB)
-(4, NUMBER, 3.0)
-(4, CLOSE_BRACKET)
-(4, SEMICOLON)
-(5, LITERAL, "print")
-(5, OPEN_BRACKET)
-(5, NUMBER, 1.0)
-(5, SUB)
-(5, SUB)
-(5, NUMBER, 3.0)
-(5, CLOSE_BRACKET)
-(5, SEMICOLON)
-(7, LITERAL, "print")
-(7, OPEN_BRACKET)
-(7, NUMBER, 4.0)
-(7, MUL)
-(7, NUMBER, 3.0)
-(7, CLOSE_BRACKET)
-(7, SEMICOLON)
-(8, LITERAL, "print")
-(8, OPEN_BRACKET)
-(8, NUMBER, 6.0)
-(8, MUL)
-(8, SUB)
-(8, NUMBER, 3.0)
-(8, CLOSE_BRACKET)
-(8, SEMICOLON)
-(9, LITERAL, "print")
-(9, OPEN_BRACKET)
-(9, SUB)
-(9, NUMBER, 6.0)
-(9, MUL)
-(9, NUMBER, 4.0)
-(9, CLOSE_BRACKET)
-(9, SEMICOLON)
-(10, LITERAL, "print")
-(10, OPEN_BRACKET)
-(10, SUB)
-(10, NUMBER, 6.0)
-(10, MUL)
-(10, SUB)
-(10, NUMBER, 4.0)
-(10, CLOSE_BRACKET)
-(10, SEMICOLON)
-(12, LITERAL, "print")
-(12, OPEN_BRACKET)
-(12, NUMBER, 4.0)
-(12, DIV)
-(12, NUMBER, 2.0)
-(12, CLOSE_BRACKET)
-(12, SEMICOLON)
-(13, LITERAL, "print")
-(13, OPEN_BRACKET)
-(13, NUMBER, 6.0)
-(13, DIV)
-(13, SUB)
-(13, NUMBER, 2.0)
-(13, CLOSE_BRACKET)
-(13, SEMICOLON)
-(14, LITERAL, "print")
-(14, OPEN_BRACKET)
-(14, SUB)
-(14, NUMBER, 6.0)
-(14, DIV)
-(14, NUMBER, 3.0)
-(14, CLOSE_BRACKET)
-(14, SEMICOLON)
-(15, LITERAL, "print")
-(15, OPEN_BRACKET)
-(15, SUB)
-(15, NUMBER, 6.0)
-(15, DIV)
-(15, SUB)
-(15, NUMBER, 2.0)
-(15, CLOSE_BRACKET)
-(15, SEMICOLON)
-(16, EOF)

+ 0 - 1
test/calc/comma

@@ -1 +0,0 @@
-print(5.125 + 3.125 + 1.25 + 0.5);

+ 0 - 8
test/calc/comma.cout

@@ -1,8 +0,0 @@
-push 5.125
-push 3.125
-use +(2)
-push 1.25
-use +(2)
-push 0.5
-use +(2)
-use print(1)

+ 0 - 1
test/calc/comma.out

@@ -1 +0,0 @@
-10.0

+ 0 - 12
test/calc/comma.tout

@@ -1,12 +0,0 @@
-(1, LITERAL, "print")
-(1, OPEN_BRACKET)
-(1, NUMBER, 5.125)
-(1, ADD)
-(1, NUMBER, 3.125)
-(1, ADD)
-(1, NUMBER, 1.25)
-(1, ADD)
-(1, NUMBER, 0.5)
-(1, CLOSE_BRACKET)
-(1, SEMICOLON)
-(2, EOF)

+ 0 - 8
test/calc/mixed

@@ -1,8 +0,0 @@
-print(2 + 3 * 4);
-print((2 + 3) * 4);
-print(2 + 3 * 4 + 2);
-print(2 + 3 * (4 + 2));
-print(2 + 3 * (4 + 2));
-print(2 + -3 * (4 + 2));
-print(2 + 3 * (-4 + 2));
-print((2 - 3) * 4);

+ 0 - 60
test/calc/mixed.cout

@@ -1,60 +0,0 @@
-push 2
-push 3
-push 4
-use *(2)
-use +(2)
-use print(1)
-push 2
-push 3
-use +(2)
-push 4
-use *(2)
-use print(1)
-push 2
-push 3
-push 4
-use *(2)
-use +(2)
-push 2
-use +(2)
-use print(1)
-push 2
-push 3
-push 4
-push 2
-use +(2)
-use *(2)
-use +(2)
-use print(1)
-push 2
-push 3
-push 4
-push 2
-use +(2)
-use *(2)
-use +(2)
-use print(1)
-push 2
-push 3
-use -(1)
-push 4
-push 2
-use +(2)
-use *(2)
-use +(2)
-use print(1)
-push 2
-push 3
-push 4
-use -(1)
-push 2
-use +(2)
-use *(2)
-use +(2)
-use print(1)
-push 2
-push 3
-use -(2)
-push 4
-use *(2)
-use print(1)

+ 0 - 8
test/calc/mixed.out

@@ -1,8 +0,0 @@
-14.0
-20.0
-16.0
-20.0
-20.0
--16.0
--4.0
--4.0

+ 0 - 97
test/calc/mixed.tout

@@ -1,97 +0,0 @@
-(1, LITERAL, "print")
-(1, OPEN_BRACKET)
-(1, NUMBER, 2.0)
-(1, ADD)
-(1, NUMBER, 3.0)
-(1, MUL)
-(1, NUMBER, 4.0)
-(1, CLOSE_BRACKET)
-(1, SEMICOLON)
-(2, LITERAL, "print")
-(2, OPEN_BRACKET)
-(2, OPEN_BRACKET)
-(2, NUMBER, 2.0)
-(2, ADD)
-(2, NUMBER, 3.0)
-(2, CLOSE_BRACKET)
-(2, MUL)
-(2, NUMBER, 4.0)
-(2, CLOSE_BRACKET)
-(2, SEMICOLON)
-(3, LITERAL, "print")
-(3, OPEN_BRACKET)
-(3, NUMBER, 2.0)
-(3, ADD)
-(3, NUMBER, 3.0)
-(3, MUL)
-(3, NUMBER, 4.0)
-(3, ADD)
-(3, NUMBER, 2.0)
-(3, CLOSE_BRACKET)
-(3, SEMICOLON)
-(4, LITERAL, "print")
-(4, OPEN_BRACKET)
-(4, NUMBER, 2.0)
-(4, ADD)
-(4, NUMBER, 3.0)
-(4, MUL)
-(4, OPEN_BRACKET)
-(4, NUMBER, 4.0)
-(4, ADD)
-(4, NUMBER, 2.0)
-(4, CLOSE_BRACKET)
-(4, CLOSE_BRACKET)
-(4, SEMICOLON)
-(5, LITERAL, "print")
-(5, OPEN_BRACKET)
-(5, NUMBER, 2.0)
-(5, ADD)
-(5, NUMBER, 3.0)
-(5, MUL)
-(5, OPEN_BRACKET)
-(5, NUMBER, 4.0)
-(5, ADD)
-(5, NUMBER, 2.0)
-(5, CLOSE_BRACKET)
-(5, CLOSE_BRACKET)
-(5, SEMICOLON)
-(6, LITERAL, "print")
-(6, OPEN_BRACKET)
-(6, NUMBER, 2.0)
-(6, ADD)
-(6, SUB)
-(6, NUMBER, 3.0)
-(6, MUL)
-(6, OPEN_BRACKET)
-(6, NUMBER, 4.0)
-(6, ADD)
-(6, NUMBER, 2.0)
-(6, CLOSE_BRACKET)
-(6, CLOSE_BRACKET)
-(6, SEMICOLON)
-(7, LITERAL, "print")
-(7, OPEN_BRACKET)
-(7, NUMBER, 2.0)
-(7, ADD)
-(7, NUMBER, 3.0)
-(7, MUL)
-(7, OPEN_BRACKET)
-(7, SUB)
-(7, NUMBER, 4.0)
-(7, ADD)
-(7, NUMBER, 2.0)
-(7, CLOSE_BRACKET)
-(7, CLOSE_BRACKET)
-(7, SEMICOLON)
-(8, LITERAL, "print")
-(8, OPEN_BRACKET)
-(8, OPEN_BRACKET)
-(8, NUMBER, 2.0)
-(8, SUB)
-(8, NUMBER, 3.0)
-(8, CLOSE_BRACKET)
-(8, MUL)
-(8, NUMBER, 4.0)
-(8, CLOSE_BRACKET)
-(8, SEMICOLON)
-(9, EOF)

+ 0 - 1
test/calc/mod

@@ -1 +0,0 @@
-print(7 % 5);

+ 0 - 4
test/calc/mod.cout

@@ -1,4 +0,0 @@
-push 7
-push 5
-use %(2)
-use print(1)

+ 0 - 1
test/calc/mod.out

@@ -1 +0,0 @@
-2.0

+ 0 - 8
test/calc/mod.tout

@@ -1,8 +0,0 @@
-(1, LITERAL, "print")
-(1, OPEN_BRACKET)
-(1, NUMBER, 7.0)
-(1, MOD)
-(1, NUMBER, 5.0)
-(1, CLOSE_BRACKET)
-(1, SEMICOLON)
-(2, EOF)

+ 0 - 4
test/comments/comment0

@@ -1,4 +0,0 @@
-print("a");
-//print("b");
-print("c");
-print("d");

+ 0 - 6
test/comments/comment0.cout

@@ -1,6 +0,0 @@
-push "a"
-use print(1)
-push "c"
-use print(1)
-push "d"
-use print(1)

+ 0 - 3
test/comments/comment0.out

@@ -1,3 +0,0 @@
-a
-c
-d

+ 0 - 16
test/comments/comment0.tout

@@ -1,16 +0,0 @@
-(1, LITERAL, "print")
-(1, OPEN_BRACKET)
-(1, STRING, "a")
-(1, CLOSE_BRACKET)
-(1, SEMICOLON)
-(3, LITERAL, "print")
-(3, OPEN_BRACKET)
-(3, STRING, "c")
-(3, CLOSE_BRACKET)
-(3, SEMICOLON)
-(4, LITERAL, "print")
-(4, OPEN_BRACKET)
-(4, STRING, "d")
-(4, CLOSE_BRACKET)
-(4, SEMICOLON)
-(5, EOF)

+ 0 - 4
test/comments/comment1

@@ -1,4 +0,0 @@
-print("a");
-/*print("b");
-print("c");*/
-print("d");

+ 0 - 4
test/comments/comment1.cout

@@ -1,4 +0,0 @@
-push "a"
-use print(1)
-push "d"
-use print(1)

+ 0 - 2
test/comments/comment1.out

@@ -1,2 +0,0 @@
-a
-d

+ 0 - 11
test/comments/comment1.tout

@@ -1,11 +0,0 @@
-(1, LITERAL, "print")
-(1, OPEN_BRACKET)
-(1, STRING, "a")
-(1, CLOSE_BRACKET)
-(1, SEMICOLON)
-(4, LITERAL, "print")
-(4, OPEN_BRACKET)
-(4, STRING, "d")
-(4, CLOSE_BRACKET)
-(4, SEMICOLON)
-(5, EOF)

+ 0 - 4
test/comments/comment2

@@ -1,4 +0,0 @@
-print("a");
-//print("b");
-print("c"); //print("d");
-print("e");

+ 0 - 6
test/comments/comment2.cout

@@ -1,6 +0,0 @@
-push "a"
-use print(1)
-push "c"
-use print(1)
-push "e"
-use print(1)

+ 0 - 3
test/comments/comment2.out

@@ -1,3 +0,0 @@
-a
-c
-e

+ 0 - 16
test/comments/comment2.tout

@@ -1,16 +0,0 @@
-(1, LITERAL, "print")
-(1, OPEN_BRACKET)
-(1, STRING, "a")
-(1, CLOSE_BRACKET)
-(1, SEMICOLON)
-(3, LITERAL, "print")
-(3, OPEN_BRACKET)
-(3, STRING, "c")
-(3, CLOSE_BRACKET)
-(3, SEMICOLON)
-(4, LITERAL, "print")
-(4, OPEN_BRACKET)
-(4, STRING, "e")
-(4, CLOSE_BRACKET)
-(4, SEMICOLON)
-(5, EOF)

+ 0 - 4
test/comments/comment3

@@ -1,4 +0,0 @@
-print("a");
-/*print("b");
-print("c"); */print("d");
-print("e");

+ 0 - 6
test/comments/comment3.cout

@@ -1,6 +0,0 @@
-push "a"
-use print(1)
-push "d"
-use print(1)
-push "e"
-use print(1)

+ 0 - 3
test/comments/comment3.out

@@ -1,3 +0,0 @@
-a
-d
-e

+ 0 - 16
test/comments/comment3.tout

@@ -1,16 +0,0 @@
-(1, LITERAL, "print")
-(1, OPEN_BRACKET)
-(1, STRING, "a")
-(1, CLOSE_BRACKET)
-(1, SEMICOLON)
-(3, LITERAL, "print")
-(3, OPEN_BRACKET)
-(3, STRING, "d")
-(3, CLOSE_BRACKET)
-(3, SEMICOLON)
-(4, LITERAL, "print")
-(4, OPEN_BRACKET)
-(4, STRING, "e")
-(4, CLOSE_BRACKET)
-(4, SEMICOLON)
-(5, EOF)

+ 0 - 2
test/conditions/conditions0

@@ -1,2 +0,0 @@
-print(true);
-print(false);

+ 0 - 4
test/conditions/conditions0.cout

@@ -1,4 +0,0 @@
-push true
-use print(1)
-push false
-use print(1)

+ 0 - 2
test/conditions/conditions0.out

@@ -1,2 +0,0 @@
-true
-false

+ 0 - 11
test/conditions/conditions0.tout

@@ -1,11 +0,0 @@
-(1, LITERAL, "print")
-(1, OPEN_BRACKET)
-(1, TRUE)
-(1, CLOSE_BRACKET)
-(1, SEMICOLON)
-(2, LITERAL, "print")
-(2, OPEN_BRACKET)
-(2, FALSE)
-(2, CLOSE_BRACKET)
-(2, SEMICOLON)
-(3, EOF)

+ 0 - 4
test/conditions/conditions1

@@ -1,4 +0,0 @@
-print(true && true);
-print(false && true);
-print(true && false);
-print(false && false);

+ 0 - 20
test/conditions/conditions1.cout

@@ -1,20 +0,0 @@
-push true
-if goto(3, false)
-push true
-use &&(2)
-use print(1)
-push false
-if goto(8, false)
-push true
-use &&(2)
-use print(1)
-push true
-if goto(13, false)
-push false
-use &&(2)
-use print(1)
-push false
-if goto(18, false)
-push false
-use &&(2)
-use print(1)

+ 0 - 4
test/conditions/conditions1.out

@@ -1,4 +0,0 @@
-true
-false
-false
-false

+ 0 - 29
test/conditions/conditions1.tout

@@ -1,29 +0,0 @@
-(1, LITERAL, "print")
-(1, OPEN_BRACKET)
-(1, TRUE)
-(1, AND)
-(1, TRUE)
-(1, CLOSE_BRACKET)
-(1, SEMICOLON)
-(2, LITERAL, "print")
-(2, OPEN_BRACKET)
-(2, FALSE)
-(2, AND)
-(2, TRUE)
-(2, CLOSE_BRACKET)
-(2, SEMICOLON)
-(3, LITERAL, "print")
-(3, OPEN_BRACKET)
-(3, TRUE)
-(3, AND)
-(3, FALSE)
-(3, CLOSE_BRACKET)
-(3, SEMICOLON)
-(4, LITERAL, "print")
-(4, OPEN_BRACKET)
-(4, FALSE)
-(4, AND)
-(4, FALSE)
-(4, CLOSE_BRACKET)
-(4, SEMICOLON)
-(5, EOF)

+ 0 - 4
test/conditions/conditions2

@@ -1,4 +0,0 @@
-print(true || true);
-print(false || true);
-print(true || false);
-print(false || false);

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.