Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/xlint/lint1 lint: make generating the operators tabl...
details: https://anonhg.NetBSD.org/src/rev/805ab8ac1dd2
branches: trunk
changeset: 979680:805ab8ac1dd2
user: rillig <rillig%NetBSD.org@localhost>
date: Tue Jan 05 21:32:47 2021 +0000
description:
lint: make generating the operators table simpler
The generated files are exactly the same as before.
diffstat:
usr.bin/xlint/lint1/mkops | 16 +----
usr.bin/xlint/lint1/ops.def | 124 ++++++++++++++++++++++----------------------
2 files changed, 66 insertions(+), 74 deletions(-)
diffs (160 lines):
diff -r 75abccdfd63a -r 805ab8ac1dd2 usr.bin/xlint/lint1/mkops
--- a/usr.bin/xlint/lint1/mkops Tue Jan 05 18:00:21 2021 +0000
+++ b/usr.bin/xlint/lint1/mkops Tue Jan 05 21:32:47 2021 +0000
@@ -1,5 +1,5 @@
#!/bin/sh -
-# $NetBSD: mkops,v 1.11 2020/12/31 16:19:05 rillig Exp $
+# $NetBSD: mkops,v 1.12 2021/01/05 21:32:47 rillig Exp $
#
# Copyright (c) 2011 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -96,18 +96,10 @@
}
FIRST = LAST;
LAST = $2;
- LASTCOMMENT = $4;
+ LASTCOMMENT = $5;
}
- if (v == "c") {
- if ($3 == "X") {
- m = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,";
- act = 0;
- } else {
- m = $3;
- act = 1;
- }
- printf("\t{ /* %s */\t{ %s \"%s\" }, %d },\n", $2, m, $1, act);
- }
+ if (v == "c")
+ printf("\t{ /* %s */\t{ %s, \"%s\" }, %d },\n", $2, $3, $1, $4);
}
END {
diff -r 75abccdfd63a -r 805ab8ac1dd2 usr.bin/xlint/lint1/ops.def
--- a/usr.bin/xlint/lint1/ops.def Tue Jan 05 18:00:21 2021 +0000
+++ b/usr.bin/xlint/lint1/ops.def Tue Jan 05 21:32:47 2021 +0000
@@ -1,62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,0,0,0,0,0,0 1
+load LOAD 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 1
+push PUSH 0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0 1
+return RETURN 1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0 1
+p.re REAL 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0
+p.im IMAG 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0
+p = {} INIT 1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0 1 pseudo
+case CASE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0 pseudo
+f(p) FARG 1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0 1 pseudo
Home |
Main Index |
Thread Index |
Old Index