Make compatible with lua 5.1.

This commit is contained in:
David Given 2022-08-01 22:44:31 +02:00
parent 50d3354ccb
commit 5dd6e8c856
2 changed files with 4 additions and 4 deletions

View file

@ -33,9 +33,9 @@ function load_table()
break break
end end
local _, _, name, num, flags = line:find("^(%w+)%s+(%d+)%s+(%g+)$") local _, _, name, num, flags = line:find("^(%w+)%s+(%d+)%s+([^ \t]+)$")
if not name then if not name then
error("malformed pseudo line in em_table") error("malformed pseudo line in em_table: ")
end end
pseudos[#pseudos+1] = { pseudos[#pseudos+1] = {
@ -54,7 +54,7 @@ function load_table()
break break
end end
local _, _, name, flags1, flags2 = line:find("^(%w+)%s+(%g+)%s+(%g+)$") local _, _, name, flags1, flags2 = line:find("^(%w+)%s+([^ \t]+)%s+([^ \t]+)$")
if not name then if not name then
error("malformed mnemonic line in em_table") error("malformed mnemonic line in em_table")
end end

View file

@ -13,7 +13,7 @@ void enterkeyw(void) {
for line in io.stdin:lines() do for line in io.stdin:lines() do
if not line:find("^#") then if not line:find("^#") then
local _, _, w1, w2 = line:find("^(%g+)%s+(%g+)$") local _, _, w1, w2 = line:find("^([^ \t]+)%s+([^ \t]+)$")
print(string.format([[ print(string.format([[
lookup("%s", symkeyw, newsymbol)->sy_value.syv_keywno = %s; lookup("%s", symkeyw, newsymbol)->sy_value.syv_keywno = %s;
]], w1, w2)) ]], w1, w2))