From 0118cdcb80c8a299eb156ee669463b84fa44f51d Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Sat, 6 Apr 2019 17:42:00 -0300 Subject: Fix \u --- parser.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'parser.lua') 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]) -- cgit 1.4.1