Skip to content

Commit a2e776f

Browse files
committed
Rename token variable to line
1 parent 18fe18f commit a2e776f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/luasm.lua

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -222,16 +222,16 @@ function LuASM:parse(tokenizer)
222222
parsed_lines = 0
223223
}
224224

225-
local token
225+
local line
226226
repeat
227-
token = tokenizer:get_next_line()
227+
line = tokenizer:get_next_line()
228228
parse_data.parsed_lines = parse_data.parsed_lines + 1
229229

230-
if token ~= nil then
230+
if line ~= nil then
231231

232232
-- Remove comments
233233
if self.settings.comment ~= nil then
234-
token = token:gsub(self.settings.comment, "")
234+
line = line:gsub(self.settings.comment, "")
235235
end
236236

237237
--[[
@@ -260,18 +260,18 @@ function LuASM:parse(tokenizer)
260260
location = parse_data.parsed_lines
261261
}
262262

263-
token = trim(rest)
263+
line = trim(rest)
264264
end
265265
end
266266

267+
if line == "" then
268+
goto continue -- Rest is empty
269+
end
270+
267271
local elements = {}
268-
string.gsub(token, self.settings.separator,
272+
string.gsub(line, self.settings.separator,
269273
function(value) elements[#elements + 1] = value end)
270274

271-
if #elements == 0 then
272-
goto continue -- empty line (or comment)
273-
end
274-
275275
local errors = {}
276276
for _, instr in ipairs(self.instructions) do
277277
if instr.name ~= elements[1] then

0 commit comments

Comments
 (0)