Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/indent indent: rename form_feed to tt_lex_form_feed
details: https://anonhg.NetBSD.org/src/rev/7decdd4042c3
branches: trunk
changeset: 990053:7decdd4042c3
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Oct 24 22:44:13 2021 +0000
description:
indent: rename form_feed to tt_lex_form_feed
No functional change.
diffstat:
tests/usr.bin/indent/token_lparen.c | 9 +++++----
usr.bin/indent/indent.c | 13 +++++++------
usr.bin/indent/indent.h | 4 ++--
usr.bin/indent/lexi.c | 8 ++++----
4 files changed, 18 insertions(+), 16 deletions(-)
diffs (139 lines):
diff -r 80785ce34da3 -r 7decdd4042c3 tests/usr.bin/indent/token_lparen.c
--- a/tests/usr.bin/indent/token_lparen.c Sun Oct 24 22:38:20 2021 +0000
+++ b/tests/usr.bin/indent/token_lparen.c Sun Oct 24 22:44:13 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: token_lparen.c,v 1.5 2021/10/24 22:28:06 rillig Exp $ */
+/* $NetBSD: token_lparen.c,v 1.6 2021/10/24 22:44:13 rillig Exp $ */
/* $FreeBSD$ */
/*
@@ -130,8 +130,8 @@
switch (expr) {}
#define preprocessing
(preprocessing)();
- /* $ XXX: form_feed should be skipped, just as newline. */
- (form_feed)(); /* XXX: should be skipped */
+ /* $ XXX: tt_lex_form_feed should be skipped, just as newline. */
+ (tt_lex_form_feed)(); /* XXX: should be skipped */
for(;;);
do(tt_lex_do)=3;while(0);
// $ TODO: is if_expr possible?
@@ -197,7 +197,8 @@
#define preprocessing
(preprocessing)();
- (form_feed)(); /* XXX: should be skipped */
+/* $ XXX: Where has the '\f' gone? It should have been preserved. */
+ (tt_lex_form_feed)(); /* XXX: should be skipped */
for (;;);
do
(tt_lex_do) = 3;
diff -r 80785ce34da3 -r 7decdd4042c3 usr.bin/indent/indent.c
--- a/usr.bin/indent/indent.c Sun Oct 24 22:38:20 2021 +0000
+++ b/usr.bin/indent/indent.c Sun Oct 24 22:44:13 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: indent.c,v 1.154 2021/10/24 22:38:20 rillig Exp $ */
+/* $NetBSD: indent.c,v 1.155 2021/10/24 22:44:13 rillig Exp $ */
/*-
* SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@
#include <sys/cdefs.h>
#if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.154 2021/10/24 22:38:20 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.155 2021/10/24 22:44:13 rillig Exp $");
#elif defined(__FreeBSD__)
__FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
#endif
@@ -336,7 +336,7 @@
struct parser_state transient_state;
transient_state = ps;
*ttype = lexi(&transient_state); /* read another token */
- if (*ttype != newline && *ttype != form_feed &&
+ if (*ttype != newline && *ttype != tt_lex_form_feed &&
*ttype != comment && !transient_state.search_brace) {
ps = transient_state;
}
@@ -351,7 +351,7 @@
case newline:
search_brace_newline(force_nl);
break;
- case form_feed:
+ case tt_lex_form_feed:
break;
case comment:
search_brace_comment(comment_buffered);
@@ -1367,7 +1367,8 @@
/* NOTREACHED */
}
- if (ttype == newline || ttype == form_feed || ttype == preprocessing)
+ if (ttype == newline || ttype == tt_lex_form_feed ||
+ ttype == preprocessing)
force_nl = false;
else if (ttype != comment)
process_comment_in_code(ttype, &force_nl);
@@ -1376,7 +1377,7 @@
switch (ttype) {
- case form_feed:
+ case tt_lex_form_feed:
process_form_feed();
break;
diff -r 80785ce34da3 -r 7decdd4042c3 usr.bin/indent/indent.h
--- a/usr.bin/indent/indent.h Sun Oct 24 22:38:20 2021 +0000
+++ b/usr.bin/indent/indent.h Sun Oct 24 22:44:13 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: indent.h,v 1.47 2021/10/24 22:38:20 rillig Exp $ */
+/* $NetBSD: indent.h,v 1.48 2021/10/24 22:44:13 rillig Exp $ */
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -89,7 +89,7 @@
comment,
switch_expr, /* 'switch' '(' <expr> ')' */
preprocessing, /* '#' */
- form_feed,
+ tt_lex_form_feed,
decl,
tt_lex_for,
tt_lex_if,
diff -r 80785ce34da3 -r 7decdd4042c3 usr.bin/indent/lexi.c
--- a/usr.bin/indent/lexi.c Sun Oct 24 22:38:20 2021 +0000
+++ b/usr.bin/indent/lexi.c Sun Oct 24 22:44:13 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lexi.c,v 1.98 2021/10/24 22:38:20 rillig Exp $ */
+/* $NetBSD: lexi.c,v 1.99 2021/10/24 22:44:13 rillig Exp $ */
/*-
* SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@
#include <sys/cdefs.h>
#if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.98 2021/10/24 22:38:20 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.99 2021/10/24 22:44:13 rillig Exp $");
#elif defined(__FreeBSD__)
__FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
#endif
@@ -226,7 +226,7 @@
"unary_op", "binary_op", "postfix_op", "question",
"case_label", "colon",
"semicolon", "lbrace", "rbrace", "ident", "comma",
- "comment", "switch_expr", "preprocessing", "form_feed", "decl",
+ "comment", "switch_expr", "preprocessing", "tt_lex_form_feed", "decl",
"tt_lex_for", "tt_lex_if", "tt_lex_while", "tt_lex_do", "tt_lex_else",
"if_expr", "while_expr", "for_exprs",
"stmt", "stmt_list", "tt_ps_else", "tt_ps_do", "do_stmt",
@@ -588,7 +588,7 @@
unary_delim = state->next_unary;
state->last_nl = true; /* remember this, so we can set 'state->col_1'
* right */
- ttype = form_feed;
+ ttype = tt_lex_form_feed;
break;
case ',':
Home |
Main Index |
Thread Index |
Old Index