From: Paul Eggert Date: Tue, 12 Nov 2002 07:28:25 +0000 (+0000) Subject: (Torturing the Scanner): Add tests that @oline@, X-Git-Tag: BISON-1_875~302 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/5b7f88c7f24c3ca04bbb00860f5c429096ee8ce7?ds=sidebyside (Torturing the Scanner): Add tests that @oline@, __oline__, #output, $@, and @{ do not have unintended meanings. --- diff --git a/tests/input.at b/tests/input.at index 7b6c35a4..9ca58c2d 100644 --- a/tests/input.at +++ b/tests/input.at @@ -151,13 +151,17 @@ static int yylex (void); %% /* Exercise M4 quoting: '@:>@@:>@', @<:@, 1. */ -exp: '@<:@' '\1' '\x000000000000000000000000000000000000000000000000002' +exp: '@<:@' '\1' two '$' '@' '{' oline output { /* Exercise quotes in braces. */ char tmp[] = "@<:@%c@:>@,\n"; printf (tmp, $1); } ; + +two: '\x000000000000000000000000000000000000000000000000000000000000000000002'; +oline: '@' 'o' 'l' 'i' 'n' 'e' '@' '_' '_' 'o' 'l' 'i' 'n' 'e' '_' '_'; +output: '#' 'o' 'u' 't' 'p' 'u' 't' ' '; %% /* Exercise M4 quoting: '@:>@@:>@', @<:@, 2. */ @@ -172,7 +176,9 @@ value_t_as_yystype (value_t val) static int yylex (void) { - static const char *input = "@<:@\1\2"; + static const char *input = "@<:@\1\2$@{@oline@__@&t@oline__\ +#output "; /* " + */ yylval = value_t_as_yystype (*input); return *input++; }