Mercurial > hg > index.cgi
diff src/buildkeywordtab.c @ 124:8770e6f977c3
Rework parser to use parse_wordtab for symbols too
There's no reason not to use the parse_wordtab table thing to match the
symbols with their token codes. It takes less space than the combined code
and tables to do it separately.
author | William Astle <lost@l-w.ca> |
---|---|
date | Mon, 01 Jan 2024 15:57:59 -0700 |
parents | 5681cdada362 |
children | ac183a519439 |
line wrap: on
line diff
--- a/src/buildkeywordtab.c Mon Jan 01 15:15:45 2024 -0700 +++ b/src/buildkeywordtab.c Mon Jan 01 15:57:59 2024 -0700 @@ -106,7 +106,7 @@ // lose any line terminators while (*ptr == '\r' || *ptr == '\n') *ptr-- = '\0'; - ptr = strchr(linebuf, ','); + ptr = strchr(linebuf, '\t'); if (!ptr) { fprintf(stderr, "WARNING: malformed input line\n"); @@ -132,7 +132,6 @@ tnprev -> nextsibling = tn; else tnp -> firstchild = tn; - fprintf(stderr, "Create entry: %c, %s\n", tn -> ccode, tn -> toksym); } tnp = tn; } @@ -147,7 +146,7 @@ } fprintf(outfile, "; This file is automatically generated. Edit %s and rebuild to make changes.\n", argv[1]); fprintf(outfile, " *pragmapush list\n *pragma list\n"); - fprintf(outfile, "parse_wordtab\n"); + fprintf(outfile, "parse_wt\n"); print_tree(outfile, treeroot, NULL, 0); fprintf(outfile, " *pragmapop list\n"); fclose(outfile);