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", name = "tokentab_h",
ins = { ins = {
"./maketokentab", "./maketokentab",
"util/cmisc+ed",
matching(filenamesof("+llgen"), "/Lpars.h$"), matching(filenamesof("+llgen"), "/Lpars.h$"),
}, },
outleaves = { "tokentab.h" }, outleaves = { "tokentab.h" },
commands = { commands = {
"%{ins} %{outs}" "%{ins[1]} < %{ins[2]} > %{outs}"
} }
} }

View file

@ -1,17 +1,6 @@
#!/bin/sh #!/bin/sh
$1 -s "${2:-Lpars.h}" > $3 <<'+' echo "char* tokentab[] = {"
1d awk '/^#define/ { print "\"" $2 "\"," }'
1,$s/# *define // echo "};"
1,$s/ ...$//
1,$s/^/ "/
1,$-1s/$/",/
$s/$/"/
0a
char *tokentab[] = {
.
$a
};
.
1,$p
+