Module Name: src Committed By: rillig Date: Mon Jan 18 16:29:59 UTC 2021
Modified Files: src/usr.bin/xlint/lint1: cgram.y scan.l Log Message: lint: rename T_STROP to T_MEMBACC The 'STR' was misleading since it is the abbreviation for 'string' in many other programs. Member access not only happens in structs, it also happens in unions. To generate a diff of this commit: cvs rdiff -u -r1.145 -r1.146 src/usr.bin/xlint/lint1/cgram.y cvs rdiff -u -r1.121 -r1.122 src/usr.bin/xlint/lint1/scan.l Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/xlint/lint1/cgram.y diff -u src/usr.bin/xlint/lint1/cgram.y:1.145 src/usr.bin/xlint/lint1/cgram.y:1.146 --- src/usr.bin/xlint/lint1/cgram.y:1.145 Sun Jan 17 15:09:56 2021 +++ src/usr.bin/xlint/lint1/cgram.y Mon Jan 18 16:29:59 2021 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: cgram.y,v 1.145 2021/01/17 15:09:56 rillig Exp $ */ +/* $NetBSD: cgram.y,v 1.146 2021/01/18 16:29:59 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.145 2021/01/17 15:09:56 rillig Exp $"); +__RCSID("$NetBSD: cgram.y,v 1.146 2021/01/18 16:29:59 rillig Exp $"); #endif #include <limits.h> @@ -139,7 +139,7 @@ anonymize(sym_t *s) }; %token T_LBRACE T_RBRACE T_LBRACK T_RBRACK T_LPAREN T_RPAREN -%token <y_op> T_STROP +%token <y_op> T_MEMBACC %token <y_op> T_UNOP %token <y_op> T_INCDEC %token T_SIZEOF @@ -261,7 +261,7 @@ anonymize(sym_t *s) %left T_ADDOP %left T_ASTERISK T_DIVOP %right T_UNOP T_INCDEC T_SIZEOF T_ALIGNOF T_REAL T_IMAG -%left T_LPAREN T_LBRACK T_STROP +%left T_LPAREN T_LBRACK T_MEMBACC %token <y_sb> T_NAME %token <y_sb> T_TYPENAME @@ -2021,14 +2021,14 @@ func_arg_list: ; point_or_arrow: - T_STROP { + T_MEMBACC { symtyp = FMEMBER; $$ = $1; } ; point: - T_STROP { + T_MEMBACC { if ($1 != POINT) { /* syntax error '%s' */ error(249, yytext); Index: src/usr.bin/xlint/lint1/scan.l diff -u src/usr.bin/xlint/lint1/scan.l:1.121 src/usr.bin/xlint/lint1/scan.l:1.122 --- src/usr.bin/xlint/lint1/scan.l:1.121 Sun Jan 17 23:04:09 2021 +++ src/usr.bin/xlint/lint1/scan.l Mon Jan 18 16:29:59 2021 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: scan.l,v 1.121 2021/01/17 23:04:09 rillig Exp $ */ +/* $NetBSD: scan.l,v 1.122 2021/01/18 16:29:59 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.121 2021/01/17 23:04:09 rillig Exp $"); +__RCSID("$NetBSD: scan.l,v 1.122 2021/01/18 16:29:59 rillig Exp $"); #endif #include <ctype.h> @@ -139,8 +139,8 @@ TL ([fFlL]?[i]?) ">>" return operator(T_SHFTOP, SHR); "++" return operator(T_INCDEC, INC); "--" return operator(T_INCDEC, DEC); -"->" return operator(T_STROP, ARROW); -"." return operator(T_STROP, POINT); +"->" return operator(T_MEMBACC, ARROW); +"." return operator(T_MEMBACC, POINT); "+" return operator(T_ADDOP, PLUS); "-" return operator(T_ADDOP, MINUS); "*" return operator(T_ASTERISK, NOOP);