aboutsummaryrefslogtreecommitdiff
path: root/src/Lexical.kt
diff options
context:
space:
mode:
authorMarvin Borner2019-08-14 18:28:10 +0200
committerMarvin Borner2019-08-14 18:28:10 +0200
commit38aad3dcda01fc5ed82556dbfdf4cfc30ff479d9 (patch)
treec38ac3df2f68e820f408c03468c43433e98f4be6 /src/Lexical.kt
parentd9d9fbdd9d13a5eadc5c57ac19405983cfe11b2e (diff)
Began syntactical analysis
Diffstat (limited to 'src/Lexical.kt')
-rw-r--r--src/Lexical.kt16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/Lexical.kt b/src/Lexical.kt
index 1655805..df60a8e 100644
--- a/src/Lexical.kt
+++ b/src/Lexical.kt
@@ -13,6 +13,7 @@ class Lexical {
if (buffer == "\"") stringMode = true
buffer = ""
}
+ if (tokenType == TokenType.Empty) buffer = ""
}
return tokens
}
@@ -65,18 +66,3 @@ class Lexical {
private val brackets = listOf("(", ")", "[", "]", "{", "}") // TODO: Use brackets for functions
private val classifier = listOf("\"") // TODO: Add char mode e.g 'a'
}
-
-enum class TokenType {
- Keyword,
- Assignment,
- Arithmetic,
- Comparison,
- Logical,
- Identifier,
- Constant,
- Punctuation,
- Bracket,
- Classifier,
- Empty,
- Skip
-} \ No newline at end of file