Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh Add a comment explaining the ordering reltionship of ...



details:   https://anonhg.NetBSD.org/src/rev/b8c7483f8c9e
branches:  trunk
changeset: 825633:b8c7483f8c9e
user:      kre <kre%NetBSD.org@localhost>
date:      Wed Jul 26 03:46:54 2017 +0000

description:
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.)

diffstat:

 bin/sh/mktokens |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 6b95ff219013 -r b8c7483f8c9e bin/sh/mktokens
--- a/bin/sh/mktokens   Wed Jul 26 03:44:43 2017 +0000
+++ b/bin/sh/mktokens   Wed Jul 26 03:46:54 2017 +0000
@@ -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 @@
 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



Home | Main Index | Thread Index | Old Index