From 042adba204adeb8599e6ce516e0615f9a7b1f9c0 Mon Sep 17 00:00:00 2001 From: Adrien Plazas Date: Wed, 11 Aug 2021 09:57:56 +0200 Subject: Make the flex test case work This adds the noyywrap option so flex doesn't wait for more input once we reached EOF. This also adds the nounput and noinput options to fix compilation warnings. We can now run the test as expected. --- test cases/frameworks/8 flex/lexer.l | 4 +++- test cases/frameworks/8 flex/prog.c | 10 ---------- 2 files changed, 3 insertions(+), 11 deletions(-) (limited to 'test cases/frameworks') diff --git a/test cases/frameworks/8 flex/lexer.l b/test cases/frameworks/8 flex/lexer.l index 952eeea..8ea7df8 100644 --- a/test cases/frameworks/8 flex/lexer.l +++ b/test cases/frameworks/8 flex/lexer.l @@ -6,6 +6,8 @@ extern int yylex(void); extern int yyerror(); %} -%% +%option noyywrap nounput noinput + +%% ("true"|"false") {return BOOLEAN;} . { yyerror(); } diff --git a/test cases/frameworks/8 flex/prog.c b/test cases/frameworks/8 flex/prog.c index 0b84d18..d94d7b1 100644 --- a/test cases/frameworks/8 flex/prog.c +++ b/test cases/frameworks/8 flex/prog.c @@ -9,7 +9,6 @@ extern int yyparse(); int main(int argc, char **argv) { - /* int input; if(argc != 2) { printf("%s "); @@ -19,15 +18,6 @@ int main(int argc, char **argv) { dup2(input, STDIN_FILENO); close(input); return yyparse(); - */ - /* We really should test that the - * generated parser works with input - * but it froze and I don't want to waste - * time debugging that. For this test what - * we care about is that it compiles and links. - */ - void* __attribute__((unused)) dummy = (void*)yyparse; - return 0; } int yywrap(void) { -- cgit v1.1