From f15075f9a491be96344a4f3cc0b61009622b0ebd Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 16 Jul 2022 13:47:22 +0200 Subject: [PATCH] Don't use ed to generate the Basic token list. --- lang/basic/src/build.lua | 3 +-- lang/basic/src/maketokentab | 19 ++++--------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/lang/basic/src/build.lua b/lang/basic/src/build.lua index c02e9621e..3f09611fa 100644 --- a/lang/basic/src/build.lua +++ b/lang/basic/src/build.lua @@ -9,12 +9,11 @@ normalrule { name = "tokentab_h", ins = { "./maketokentab", - "util/cmisc+ed", matching(filenamesof("+llgen"), "/Lpars.h$"), }, outleaves = { "tokentab.h" }, commands = { - "%{ins} %{outs}" + "%{ins[1]} < %{ins[2]} > %{outs}" } } diff --git a/lang/basic/src/maketokentab b/lang/basic/src/maketokentab index c388c5d99..ee6e8a4e0 100755 --- a/lang/basic/src/maketokentab +++ b/lang/basic/src/maketokentab @@ -1,17 +1,6 @@ #!/bin/sh -$1 -s "${2:-Lpars.h}" > $3 <<'+' -1d -1,$s/# *define // -1,$s/ ...$// -1,$s/^/ "/ -1,$-1s/$/",/ -$s/$/"/ -0a -char *tokentab[] = { -. -$a -}; -. -1,$p -+ +echo "char* tokentab[] = {" +awk '/^#define/ { print "\"" $2 "\"," }' +echo "};" +