aboutsummaryrefslogtreecommitdiff
path: root/lib/Lexer/Lexer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Lexer/Lexer.cc')
-rw-r--r--lib/Lexer/Lexer.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Lexer/Lexer.cc b/lib/Lexer/Lexer.cc
index 9956cd9..8f906ae 100644
--- a/lib/Lexer/Lexer.cc
+++ b/lib/Lexer/Lexer.cc
@@ -75,6 +75,10 @@ int Lexer::readToken() {
if (IdentifierStr == "CONSTANT") return tok_constant;
if (IdentifierStr == "INCLUDE") return tok_include;
+ if (IdentifierStr == "INCLUDE_OBJ") return tok_include_obj;
+ if (IdentifierStr == "EXTERN") return tok_extern;
+ if (IdentifierStr == "EXTERN_FUNCTION") return tok_extern_function;
+ if (IdentifierStr == "EXTERN_PROCEDURE") return tok_extern_procedure;
if (IdentifierStr == "GLOBAL") return tok_global;
if (IdentifierStr == "ENDGLOBAL") return tok_endglobal;
if (IdentifierStr == "DECLARE") return tok_declare;
@@ -229,6 +233,19 @@ int Lexer::readToken() {
return tok_colon;
}
+ if (LastChar == '.' && Input.peek() == '.') {
+ Input.get();
+ if (Input.peek() == '.') {
+ Input.get();
+ LastChar = Input.get();
+ return tok_ellipsis;
+ }
+ cps::sourceDiagnostic(CurrentLine, "error: Expected '...' at line %d\n", CurrentLine);
+ HadError = true;
+ LastChar = Input.get();
+ return tok_ellipsis;
+ }
+
if (LastChar == '(') { LastChar = Input.get(); return '('; }
if (LastChar == ')') { LastChar = Input.get(); return ')'; }
if (LastChar == '[') { LastChar = Input.get(); return '['; }