Module Name: src
Committed By: rillig
Date: Mon Oct 25 20:16:16 UTC 2021
Modified Files:
src/tests/usr.bin/indent: token_lparen.c
Log Message:
tests/indent: clean up test for lbrace
After splitting token_type into separate types, want_blank_before_lparen
cannot depend on a parser_symbol anymore.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/indent/token_lparen.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.6 src/tests/usr.bin/indent/token_lparen.c:1.7
--- src/tests/usr.bin/indent/token_lparen.c:1.6 Sun Oct 24 22:44:13 2021
+++ src/tests/usr.bin/indent/token_lparen.c Mon Oct 25 20:16:16 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: token_lparen.c,v 1.6 2021/10/24 22:44:13 rillig Exp $ */
+/* $NetBSD: token_lparen.c,v 1.7 2021/10/25 20:16:16 rillig Exp $ */
/* $FreeBSD$ */
/*
@@ -96,10 +96,6 @@ int array[] = {
/*
* Test want_blank_before_lparen for all possible token types.
- *
- * FIXME: As a side effect, this test demonstrates that line_no counting is
- * broken. lparen_or_lbracket is in line 5, but during debugging it is said
- * to be in line 4.
*/
#indent input
void cover_want_blank_before_lparen(void)
@@ -130,30 +126,12 @@ void cover_want_blank_before_lparen(void
switch (expr) {}
#define preprocessing
(preprocessing)();
- /* $ XXX: tt_lex_form_feed should be skipped, just as newline. */
- (tt_lex_form_feed)(); /* XXX: should be skipped */
+ /* $ XXX: lsym_form_feed should be skipped, just as newline. */
+ (lsym_form_feed)(); /* XXX: should be skipped */
for(;;);
- do(tt_lex_do)=3;while(0);
- // $ TODO: is if_expr possible?
- if(cond)(if_expr)();
- // $ TODO: is while_expr possible?
- while(cond)(while_expr)();
- // $ TODO: is for_exprs possible?
- for(;;)(for_exprs)();
- // $ TODO: is stmt possible?
- (stmt);
- // $ TODO: is stmt_list possible?
- (stmt_list);
- // $ TODO: is tt_ps_else possible? tt_lex_else is.
- if(cond);else(tt_ps_else)();
- // $ TODO: is tt_ps_do possible? tt_lex_do is.
- do(tt_ps_do);while(0);
- // The following line would generate 'Statement nesting error'.
- // do stmt;(do_stmt());while(0);
- // $ TODO: is if_expr_stmt possible?
- if(cond)stmt;(if_expr_stmt)();
- // $ TODO: is if_expr_stmt_else possible?
- if(cond)stmt;else(if_expr_stmt_else());
+ do(lsym_do)=3;while(0);
+ if(cond);else(lsym_else)();
+ do(lsym_do);while(0);
str.(member); /* syntax error */
L("string_prefix"); /* impossible */
static (int)storage_class; /* syntax error */
@@ -198,34 +176,17 @@ cover_want_blank_before_lparen(void)
(preprocessing)();
/* $ XXX: Where has the '\f' gone? It should have been preserved. */
- (tt_lex_form_feed)(); /* XXX: should be skipped */
+ (lsym_form_feed)(); /* XXX: should be skipped */
for (;;);
do
- (tt_lex_do) = 3;
+ (lsym_do) = 3;
while (0);
- if (cond)
- (if_expr)();
- while (cond)
- (while_expr)();
- for (;;)
- (for_exprs)();
- (stmt);
- (stmt_list);
if (cond);
else
- (tt_ps_else)();
+ (lsym_else)();
do
- (tt_ps_do);
+ (lsym_do);
while (0);
- // The following line would generate 'Statement nesting error'.
- // do stmt;(do_stmt());while(0);
- if (cond)
- stmt;
- (if_expr_stmt)();
- if (cond)
- stmt;
- else
- (if_expr_stmt_else());
str.(member); /* syntax error */
L("string_prefix"); /* impossible */
static (int)storage_class; /* syntax error */