Don't use ed to generate the Basic token list.

This commit is contained in:
David Given 2022-07-16 13:47:22 +02:00
parent 0eae0d5d71
commit f15075f9a4
2 changed files with 5 additions and 17 deletions

View file

@ -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}"
}
}

View file

@ -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 "};"