summary refs log tree commit diff stats
path: root/parser.lua
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2019-04-06 17:42:00 -0300
committerSoniEx2 <endermoneymod@gmail.com>2019-04-06 17:42:00 -0300
commit0118cdcb80c8a299eb156ee669463b84fa44f51d (patch)
tree06beff5b1c5a437ca14a14d9b9d7661614e7abb7 /parser.lua
parent1f1f6c0732ddb22c7d102a810b6c24724a5b6d3b (diff)
Fix \u
Diffstat (limited to 'parser.lua')
-rw-r--r--parser.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/parser.lua b/parser.lua
index beb944e..0cd2853 100644
--- a/parser.lua
+++ b/parser.lua
@@ -72,7 +72,7 @@ local function get_next_common(state, in_pos, token)
 end
 
 local function get_next_table(state, in_pos)
-    if state[DATA] == nil or #state[DATA] == 0 then return in_pos, state end
+    if state[DATA] == nil or #state[DATA] == 0 then return in_pos, state end -- TODO end-of-stream handling
     in_pos = in_pos + 1
     local token = state[DATA][in_pos - state[OFFDATA]]
     if token == nil then
@@ -84,10 +84,10 @@ local function get_next_table(state, in_pos)
 end
 
 local function get_next_string(state, in_pos)
-    if state[DATA] == nil or #state[DATA] == 0 then return in_pos, state end
+    if state[DATA] == nil or #state[DATA] == 0 then return in_pos, state end -- TODO end-of-stream handling
     in_pos = in_pos + 1
-    local token = optimize_lookups[string.byte(state[DATA], in_pos - state[OFFDATA], in_pos - state[OFFDATA])] or ""
-    if token == "" then
+    local token = optimize_lookups[string.byte(state[DATA], in_pos - state[OFFDATA], in_pos - state[OFFDATA])]
+    if token == nil then
         state[OFFDATA] = in_pos - 1
         state[DATA] = state[GEN]()
         return get_next_string(state, state[OFFDATA])