From 5dd6e8c85646c9c0fab445e0ac23c2e324e59b7f Mon Sep 17 00:00:00 2001 From: David Given Date: Mon, 1 Aug 2022 22:44:31 +0200 Subject: [PATCH] Make compatible with lua 5.1. --- h/em_table_lib.lua | 6 +++--- util/ncgg/make_enterkeyw_c.lua | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/h/em_table_lib.lua b/h/em_table_lib.lua index e43a9dee4..b5d1596c6 100644 --- a/h/em_table_lib.lua +++ b/h/em_table_lib.lua @@ -33,9 +33,9 @@ function load_table() break 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 - error("malformed pseudo line in em_table") + error("malformed pseudo line in em_table: ") end pseudos[#pseudos+1] = { @@ -54,7 +54,7 @@ function load_table() break 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 error("malformed mnemonic line in em_table") end diff --git a/util/ncgg/make_enterkeyw_c.lua b/util/ncgg/make_enterkeyw_c.lua index 572cbb084..3eb6bd15b 100755 --- a/util/ncgg/make_enterkeyw_c.lua +++ b/util/ncgg/make_enterkeyw_c.lua @@ -13,7 +13,7 @@ void enterkeyw(void) { for line in io.stdin:lines() do if not line:find("^#") then - local _, _, w1, w2 = line:find("^(%g+)%s+(%g+)$") + local _, _, w1, w2 = line:find("^([^ \t]+)%s+([^ \t]+)$") print(string.format([[ lookup("%s", symkeyw, newsymbol)->sy_value.syv_keywno = %s; ]], w1, w2))