Module Name:    src
Committed By:   kre
Date:           Wed Jul 26 03:46:55 UTC 2017

Modified Files:
        src/bin/sh: mktokens

Log Message:
Add a comment explaining the ordering reltionship of the tokens
(operators all come first, then TWORD, then keywords), and switch
from using TIF to define KWDOFFSET to using TWORD (the barrier,
rather than the token that happens to be first after it.)


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/bin/sh/mktokens

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/mktokens
diff -u src/bin/sh/mktokens:1.13 src/bin/sh/mktokens:1.14
--- src/bin/sh/mktokens:1.13	Thu May  4 04:37:51 2017
+++ src/bin/sh/mktokens	Wed Jul 26 03:46:54 2017
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$NetBSD: mktokens,v 1.13 2017/05/04 04:37:51 kre Exp $
+#	$NetBSD: mktokens,v 1.14 2017/07/26 03:46:54 kre Exp $
 #
 # Copyright (c) 1991, 1993
 #	The Regents of the University of California.  All rights reserved.
@@ -40,6 +40,9 @@
 # token marks the end of a list.  The third column is the name to print in
 # error messages.
 
+# Note that all the keyword tokens come after TWORD, and all the others
+# come before it.   We rely upon that relationship - keep it!
+
 cat > /tmp/ka$$ <<\!
 TEOF	1	end of file
 TNL	0	newline
@@ -87,7 +90,7 @@ ${SED} -e 's/"/\\"/g' \
 echo '};
 '
 ${SED} 's/"//g' /tmp/ka$$ | ${AWK} '
-/TIF/{print "#define KWDOFFSET " NR-1; print ""; 
+/TWORD/{print "#define KWDOFFSET " NR; print ""; 
       print "const char *const parsekwd[] = {"}
 /TIF/,/neverfound/{print "	\"" $3 "\","}'
 echo '	0

Reply via email to