Website Summary Files Commits Branches @commit @diff @stats
path: root / JSImpl / src / Lexer.h
diff options
context:
space:
mode:
1 files changed, 8 insertions, 4 deletions
-rw-r--r--JSImpl/src/Lexer.h12
diff --git a/JSImpl/src/Lexer.h b/JSImpl/src/Lexer.h
index 914b6ed..fb3e0a1 100644
--- a/JSImpl/src/Lexer.h
+++ b/JSImpl/src/Lexer.h
@@ -1,9 +1,8 @@
#pragma once
#include "CommonTypes.h"
-#include <functional>
-enum TokenType
+enum class TokenType
{
// Single-character tokens.
LeftParen,
@@ -98,7 +97,6 @@ enum TokenType
True,
False,
-
Eof,
Invalid
};
@@ -111,4 +109,10 @@ struct Token
double Number;
};
-IPLVector<Token> Tokenize(const char* code, const std::function<void()>& onError = {});
+struct LexerResult
+{
+ bool IsSuccessful;
+ IPLError Error;
+};
+
+LexerResult Tokenize(const char* code, IPLVector<Token>& tokens);