tests/libcurses: use consistent indentation for grammar rules

This commit is contained in:
rillig 2021-02-08 20:55:42 +00:00
parent 91cc09774d
commit facc9c9e92
1 changed files with 25 additions and 9 deletions

View File

@ -1,5 +1,5 @@
%{
/* $NetBSD: testlang_parse.y,v 1.41 2021/02/08 20:39:33 rillig Exp $ */
/* $NetBSD: testlang_parse.y,v 1.42 2021/02/08 20:55:42 rillig Exp $ */
/*-
* Copyright 2009 Brett Lymn <blymn@NetBSD.org>
@ -333,14 +333,30 @@ result : returns
| reference
;
returns : numeric { assign_rets(data_number, $1); }
| LPAREN expr RPAREN { assign_rets(data_number, $2); }
| STRING { assign_rets(data_string, $1); }
| BYTE { assign_rets(data_byte, (void *) $1); }
| ERR_RET { assign_rets(data_err, NULL); }
| OK_RET { assign_rets(data_ok, NULL); }
| NULL_RET { assign_rets(data_null, NULL); }
| NON_NULL { assign_rets(data_nonnull, NULL); }
returns : numeric {
assign_rets(data_number, $1);
}
| LPAREN expr RPAREN {
assign_rets(data_number, $2);
}
| STRING {
assign_rets(data_string, $1);
}
| BYTE {
assign_rets(data_byte, (void *) $1);
}
| ERR_RET {
assign_rets(data_err, NULL);
}
| OK_RET {
assign_rets(data_ok, NULL);
}
| NULL_RET {
assign_rets(data_null, NULL);
}
| NON_NULL {
assign_rets(data_nonnull, NULL);
}
| var
;