Make dynasm accept labels and stmts on same line

Now accepts e.g.:

    1: jmp <1

Used to be a parse error.
This commit is contained in:
Ben Noordhuis 2024-10-20 21:03:19 +02:00
parent 97813fb924
commit 64c4d0f8b5

View File

@ -861,6 +861,10 @@ local function doline(line)
-- Strip assembler comments.
aline = gsub(aline, "//.*$", "")
-- Process and remove labels.
for stmt in gmatch(aline, "[^:]+:") do dostmt(stmt) end
aline = gsub(aline, "[^:]+:", "")
-- Split line into statements at semicolons.
if match(aline, ";") then
for stmt in gmatch(aline, "[^;]+") do dostmt(stmt) end