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: make grammar f...
details: https://anonhg.NetBSD.org/src/rev/0200d2d21bb3
branches: trunk
changeset: 959322:0200d2d21bb3
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Feb 07 20:48:07 2021 +0000
description:
tests/libcurses: make grammar for test cases conflict-free
No functional change.
diffstat:
tests/lib/libcurses/director/testlang_parse.y | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diffs (43 lines):
diff -r 86daae2a45fa -r 0200d2d21bb3 tests/lib/libcurses/director/testlang_parse.y
--- a/tests/lib/libcurses/director/testlang_parse.y Sun Feb 07 20:40:05 2021 +0000
+++ b/tests/lib/libcurses/director/testlang_parse.y Sun Feb 07 20:48:07 2021 +0000
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: testlang_parse.y,v 1.32 2021/02/07 20:40:05 rillig Exp $ */
+/* $NetBSD: testlang_parse.y,v 1.33 2021/02/07 20:48:07 rillig Exp $ */
/*-
* Copyright 2009 Brett Lymn <blymn%NetBSD.org@localhost>
@@ -253,7 +253,7 @@
char_vals : numeric {
add_to_vals(data_number, $1);
}
- | LBRACK array RBRACK
+ | LBRACK array_elements RBRACK
| VARIABLE {
add_to_vals(data_var, $1);
}
@@ -485,10 +485,13 @@
}
;
-array : numeric {
+array_elements : array_element
+ | array_element COMMA array_elements
+ ;
+
+array_element : numeric {
$<vals>$ = add_to_vals(data_number, $1);
}
- ; /* XXX: extra semicolon; yacc seems to ignore this. */
| VARIABLE {
$<vals>$ = add_to_vals(data_number,
get_numeric_var($1));
@@ -535,7 +538,6 @@
(void *) $1);
}
}
- | array COMMA array
;
expr : numeric
Home |
Main Index |
Thread Index |
Old Index