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: rename T_AND to T_AMPER
details: https://anonhg.NetBSD.org/src/rev/8e131e6394a0
branches: trunk
changeset: 949815:8e131e6394a0
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Jan 17 15:09:56 2021 +0000
description:
lint: rename T_AND to T_AMPER
When parsing a text into a C program, the character '&' does not yet
mean 'bitwise and', it could also be the address operator.
diffstat:
usr.bin/xlint/lint1/cgram.y | 12 ++++++------
usr.bin/xlint/lint1/scan.l | 6 +++---
2 files changed, 9 insertions(+), 9 deletions(-)
diffs (83 lines):
diff -r 527feec4c1d2 -r 8e131e6394a0 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y Sun Jan 17 15:06:54 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y Sun Jan 17 15:09:56 2021 +0000
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: cgram.y,v 1.144 2021/01/17 15:06:54 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.145 2021/01/17 15:09:56 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.144 2021/01/17 15:06:54 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.145 2021/01/17 15:09:56 rillig Exp $");
#endif
#include <limits.h>
@@ -153,7 +153,7 @@
%token <y_op> T_SHFTOP
%token <y_op> T_RELOP
%token <y_op> T_EQOP
-%token <y_op> T_AND
+%token <y_op> T_AMPER
%token <y_op> T_XOR
%token <y_op> T_OR
%token <y_op> T_LOGAND
@@ -254,7 +254,7 @@
%left T_LOGAND
%left T_OR
%left T_XOR
-%left T_AND
+%left T_AMPER
%left T_EQOP
%left T_RELOP
%left T_SHFTOP
@@ -1817,7 +1817,7 @@
| expr T_EQOP expr {
$$ = build($2, $1, $3);
}
- | expr T_AND expr {
+ | expr T_AMPER expr {
$$ = build(BITAND, $1, $3);
}
| expr T_XOR expr {
@@ -1902,7 +1902,7 @@
| T_ASTERISK term {
$$ = build(INDIR, $2, NULL);
}
- | T_AND term {
+ | T_AMPER term {
$$ = build(ADDR, $2, NULL);
}
| T_UNOP term {
diff -r 527feec4c1d2 -r 8e131e6394a0 usr.bin/xlint/lint1/scan.l
--- a/usr.bin/xlint/lint1/scan.l Sun Jan 17 15:06:54 2021 +0000
+++ b/usr.bin/xlint/lint1/scan.l Sun Jan 17 15:09:56 2021 +0000
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: scan.l,v 1.119 2021/01/17 15:06:54 rillig Exp $ */
+/* $NetBSD: scan.l,v 1.120 2021/01/17 15:09:56 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: scan.l,v 1.119 2021/01/17 15:06:54 rillig Exp $");
+__RCSID("$NetBSD: scan.l,v 1.120 2021/01/17 15:09:56 rillig Exp $");
#endif
#include <ctype.h>
@@ -125,7 +125,7 @@
"||" return operator(T_LOGOR, LOGOR);
"&&" return operator(T_LOGAND, LOGAND);
"|" return operator(T_OR, BITOR);
-"&" return operator(T_AND, BITAND);
+"&" return operator(T_AMPER, BITAND);
"^" return operator(T_XOR, BITXOR);
"==" return operator(T_EQOP, EQ);
"!=" return operator(T_EQOP, NE);
Home |
Main Index |
Thread Index |
Old Index