diff --git a/source/tlang/commandline/lexer.d b/source/tlang/commandline/lexer.d index ac38b29e..b498470a 100644 --- a/source/tlang/commandline/lexer.d +++ b/source/tlang/commandline/lexer.d @@ -38,7 +38,7 @@ public final class Lexer position++; } - else if(currentChar == ';' && !stringMode) + else if(isSpliter(currentChar) && !stringMode) { /* Flush the current token (if one exists) */ if(currentToken.length) @@ -100,4 +100,14 @@ public final class Lexer { return tokens; } + + /* TODO: We need to add pop functionality if we encounter || */ + private bool isSpliter(char character) + { + return character == ';' || character == ',' || character == '(' || + character == ')' || character == '[' || character == ']' || + character == '+' || character == '-' || character == '/' || + character == '%' || character == '*' || character == '&' || + character == '|' || character == '^' || character == '!'; + } } \ No newline at end of file diff --git a/source/tlang/compiler/compiler.d b/source/tlang/compiler/compiler.d index 4567de80..444a213f 100644 --- a/source/tlang/compiler/compiler.d +++ b/source/tlang/compiler/compiler.d @@ -15,8 +15,8 @@ void beginCompilation(string[] sourceFiles) gprintln("Performing tokenization on '"~sourceFile~"' ..."); /* TODO: Open source file */ - // string sourceCode = "hello \"world\";"; - string sourceCode = "hello;"; + string sourceCode = "hello \"world\";"; + // string sourceCode = "hello;"; Lexer currentLexer = new Lexer(sourceCode); currentLexer.performLex();