Module Name:    src
Committed By:   rillig
Date:           Sun Oct 24 22:44:13 UTC 2021

Modified Files:
        src/tests/usr.bin/indent: token_lparen.c
        src/usr.bin/indent: indent.c indent.h lexi.c

Log Message:
indent: rename form_feed to tt_lex_form_feed

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/indent/token_lparen.c
cvs rdiff -u -r1.154 -r1.155 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.98 -r1.99 src/usr.bin/indent/lexi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/indent/token_lparen.c
diff -u src/tests/usr.bin/indent/token_lparen.c:1.5 src/tests/usr.bin/indent/token_lparen.c:1.6
--- src/tests/usr.bin/indent/token_lparen.c:1.5	Sun Oct 24 22:28:06 2021
+++ src/tests/usr.bin/indent/token_lparen.c	Sun Oct 24 22:44:13 2021
@@ -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 @@ void cover_want_blank_before_lparen(void
 	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 @@ cover_want_blank_before_lparen(void)
 #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;

Index: src/usr.bin/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.154 src/usr.bin/indent/indent.c:1.155
--- src/usr.bin/indent/indent.c:1.154	Sun Oct 24 22:38:20 2021
+++ src/usr.bin/indent/indent.c	Sun Oct 24 22:44:13 2021
@@ -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 @@ static char sccsid[] = "@(#)indent.c	5.1
 
 #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 @@ search_brace_lookahead(token_type *ttype
     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 @@ search_brace(token_type *ttype, bool *fo
 	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 @@ main_loop(void)
 	    /* 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 @@ main_loop(void)
 
 	switch (ttype) {
 
-	case form_feed:
+	case tt_lex_form_feed:
 	    process_form_feed();
 	    break;
 

Index: src/usr.bin/indent/indent.h
diff -u src/usr.bin/indent/indent.h:1.47 src/usr.bin/indent/indent.h:1.48
--- src/usr.bin/indent/indent.h:1.47	Sun Oct 24 22:38:20 2021
+++ src/usr.bin/indent/indent.h	Sun Oct 24 22:44:13 2021
@@ -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 @@ typedef enum token_type {
     comment,
     switch_expr,		/* 'switch' '(' <expr> ')' */
     preprocessing,		/* '#' */
-    form_feed,
+    tt_lex_form_feed,
     decl,
     tt_lex_for,
     tt_lex_if,

Index: src/usr.bin/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.98 src/usr.bin/indent/lexi.c:1.99
--- src/usr.bin/indent/lexi.c:1.98	Sun Oct 24 22:38:20 2021
+++ src/usr.bin/indent/lexi.c	Sun Oct 24 22:44:13 2021
@@ -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 @@ static char sccsid[] = "@(#)lexi.c	8.1 (
 
 #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 @@ token_type_name(token_type ttype)
 	"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 @@ lexi(struct parser_state *state)
 	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 ',':

Reply via email to