tests/libcurses: use more common abbreviations for tokens

This commit is contained in:
rillig 2021-02-07 17:32:55 +00:00
parent d3b5ee28db
commit 1398f05953
2 changed files with 16 additions and 16 deletions

View File

@ -1,5 +1,5 @@
%{
/* $NetBSD: testlang_conf.l,v 1.11 2021/02/07 12:05:36 rillig Exp $ */
/* $NetBSD: testlang_conf.l,v 1.12 2021/02/07 17:32:55 rillig Exp $ */
/*-
* Copyright 2009 Brett Lymn <blymn@NetBSD.org>
@ -159,10 +159,10 @@ CCHAR [cC][cC][hH][aA][rR]
WCHAR [wW][cC][hH][aA][rR]
BYTE BYTE
OR \|
LHB \(
RHB \)
LHSB \[
RHSB \]
LPAREN \(
RPAREN \)
LBRACK \[
RBRACK \]
MULTIPLIER \*
%x incl
@ -248,10 +248,10 @@ include BEGIN(incl);
{CCHAR} return CCHAR;
{WCHAR} return WCHAR;
{OR} return OR;
{LHB} return LHB;
{RHB} return RHB;
{LHSB} return LHSB;
{RHSB} return RHSB;
{LPAREN} return LPAREN;
{RPAREN} return RPAREN;
{LBRACK} return LBRACK;
{RBRACK} return RBRACK;
{HEX} {
/* Hex value, convert to decimal and return numeric */

View File

@ -1,5 +1,5 @@
%{
/* $NetBSD: testlang_parse.y,v 1.26 2021/02/07 17:26:15 rillig Exp $ */
/* $NetBSD: testlang_parse.y,v 1.27 2021/02/07 17:32:55 rillig Exp $ */
/*-
* Copyright 2009 Brett Lymn <blymn@NetBSD.org>
@ -189,7 +189,7 @@ extern saved_data_t saved_output;
%token <string> ASSIGN
%token <string> CCHAR
%token <string> WCHAR
%token EOL CALL CHECK NOINPUT OR MULTIPLIER LHB RHB LHSB RHSB
%token EOL CALL CHECK NOINPUT OR MULTIPLIER LPAREN RPAREN LBRACK RBRACK
%token CALL2 CALL3 CALL4 DRAIN
%nonassoc OR
@ -219,7 +219,7 @@ statement : assign
assign : ASSIGN VARNAME numeric {
set_var(data_number, $2, $3);
}
| ASSIGN VARNAME LHB expr RHB {
| ASSIGN VARNAME LPAREN expr RPAREN {
set_var(data_number, $2, $<string>4);
}
| ASSIGN VARNAME STRING {
@ -241,7 +241,7 @@ wchar : WCHAR VARNAME char_vals {
;
attributes : numeric
| LHB expr RHB {
| LPAREN expr RPAREN {
$<string>$ = $<string>2;
}
| VARIABLE {
@ -252,7 +252,7 @@ attributes : numeric
char_vals : numeric {
add_to_vals(data_number, $1);
}
| LHSB array RHSB
| LBRACK array RBRACK
| VARIABLE {
add_to_vals(data_var, $1);
}
@ -451,7 +451,7 @@ result : returns
;
returns : numeric { assign_rets(data_number, $1); }
| LHB expr RHB { assign_rets(data_number, $<string>2); }
| LPAREN expr RPAREN { assign_rets(data_number, $<string>2); }
| STRING { assign_rets(data_string, $1); }
| BYTE { assign_rets(data_byte, (void *) $1); }
| ERR_RET { assign_rets(data_err, NULL); }
@ -549,7 +549,7 @@ args : /* empty */
| arg args
;
arg : LHB expr RHB {
arg : LPAREN expr RPAREN {
assign_arg(data_static, $<string>2);
}
| numeric {