Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libcurses/director tests/libcurses: clean up test ...



details:   https://anonhg.NetBSD.org/src/rev/fb38b08d8fdc
branches:  trunk
changeset: 1018552:fb38b08d8fdc
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Feb 07 12:24:18 2021 +0000

description:
tests/libcurses: clean up test case grammar for statements

Previously, each statement ended with 'eol'.  This was unnecessarily
verbose since the 'eol' is not really part of the statement, it's part
of a line.

No functional change.

diffstat:

 tests/lib/libcurses/director/testlang_parse.y |  42 +++++++++++++-------------
 1 files changed, 21 insertions(+), 21 deletions(-)

diffs (130 lines):

diff -r 525018ad6a1c -r fb38b08d8fdc tests/lib/libcurses/director/testlang_parse.y
--- a/tests/lib/libcurses/director/testlang_parse.y     Sun Feb 07 12:16:26 2021 +0000
+++ b/tests/lib/libcurses/director/testlang_parse.y     Sun Feb 07 12:24:18 2021 +0000
@@ -1,5 +1,5 @@
 %{
-/*     $NetBSD: testlang_parse.y,v 1.21 2021/02/07 12:16:26 rillig Exp $       */
+/*     $NetBSD: testlang_parse.y,v 1.22 2021/02/07 12:24:18 rillig Exp $       */
 
 /*-
  * Copyright 2009 Brett Lymn <blymn%NetBSD.org@localhost>
@@ -197,7 +197,7 @@
 %%
 
 statements     : /* empty */
-               | statement statements
+               | statement eol statements
                ;
 
 statement      : assign
@@ -213,22 +213,22 @@
                | comparend
                | cchar
                | wchar
-               | eol
+               | /* empty */
                ;
 
-assign         : ASSIGN VARNAME numeric {set_var(data_number, $2, $3);} eol
-               | ASSIGN VARNAME LHB expr RHB {set_var(data_number, $2, $<string>4);} eol
-               | ASSIGN VARNAME STRING {set_var(data_string, $2, $3);} eol
-               | ASSIGN VARNAME BYTE {set_var(data_byte, $2, $3);} eol
+assign         : ASSIGN VARNAME numeric {set_var(data_number, $2, $3);}
+               | ASSIGN VARNAME LHB expr RHB {set_var(data_number, $2, $<string>4);}
+               | ASSIGN VARNAME STRING {set_var(data_string, $2, $3);}
+               | ASSIGN VARNAME BYTE {set_var(data_byte, $2, $3);}
                ;
 
-cchar          : CCHAR VARNAME attributes char_vals eol
+cchar          : CCHAR VARNAME attributes char_vals
                        {
                                set_cchar($2, $<string>3);
                        }
                ;
 
-wchar          : WCHAR VARNAME char_vals eol
+wchar          : WCHAR VARNAME char_vals
                        {
                                set_wchar($2);
                        }
@@ -252,27 +252,27 @@
                        { add_to_vals(data_byte, $1); }
                ;
 
-call           : CALL result fn_name args eol {
+call           : CALL result fn_name args {
        do_function_call(1);
 }
                ;
 
-call2          : CALL2 result result fn_name args eol {
+call2          : CALL2 result result fn_name args {
        do_function_call(2);
 }
                ;
 
-call3          : CALL3 result result result fn_name args eol {
+call3          : CALL3 result result result fn_name args {
        do_function_call(3);
 }
                ;
 
-call4          : CALL4 result result result result fn_name args eol {
+call4          : CALL4 result result result result fn_name args {
        do_function_call(4);
  }
                ;
 
-check          : CHECK var returns eol {
+check          : CHECK var returns {
        ct_data_t retvar;
        var_t *vptr;
 
@@ -366,7 +366,7 @@
  }
        ;
 
-delay          : DELAY numeric eol {
+delay          : DELAY numeric {
        /* set the inter-character delay */
        if (sscanf($2, "%d", &input_delay) == 0)
                err(1, "delay specification %s could not be converted to "
@@ -394,7 +394,7 @@
  }
        ;
 
-input          : INPUT STRING eol {
+input          : INPUT STRING {
        if (input_str != NULL) {
                warnx("%s, %zu: Discarding unused input string",
                    cur_file, line);
@@ -409,7 +409,7 @@
        ;
 
 
-noinput                : NOINPUT eol {
+noinput                : NOINPUT {
        if (input_str != NULL) {
                warnx("%s, %zu: Discarding unused input string",
                    cur_file, line);
@@ -419,16 +419,16 @@
        no_input = true;
  }
 
-compare                : COMPARE PATH eol
-               | COMPARE FILENAME eol
+compare                : COMPARE PATH
+               | COMPARE FILENAME
 {
        compare_streams($2, true);
 }
        ;
 
 
-comparend      : COMPAREND PATH eol
-               | COMPAREND FILENAME eol
+comparend      : COMPAREND PATH
+               | COMPAREND FILENAME
 {
        compare_streams($2, false);
 }



Home | Main Index | Thread Index | Old Index