From db77e78355a112fe4c55dce258775cefa48cffd2 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 25 Nov 2005 15:59:43 +0000 Subject: - make <<"EOF" a warning, not an error (and adapt test for it) - fix warning "Trailing spaces after HERE-document mark" (was on stderr) --- perl_checker.src/lexer.mll | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'perl_checker.src/lexer.mll') diff --git a/perl_checker.src/lexer.mll b/perl_checker.src/lexer.mll index 7de0f13..389a179 100644 --- a/perl_checker.src/lexer.mll +++ b/perl_checker.src/lexer.mll @@ -677,16 +677,19 @@ rule token = parse not_ok_for_match := lexeme_end lexbuf; HERE_DOC(here_doc_next_line (skip_n_char 2 (lexeme lexbuf)), pos lexbuf) } +| "<<\"" ident "\"" { + warn_with_pos [Warn_suggest_simpler] (lexeme_start lexbuf + 2, lexeme_end lexbuf) "Don't use <<\"MARK\", use < !current_here_doc_mark then next_s s here_doc lexbuf - else if s <> !current_here_doc_mark then Printf.eprintf "%sTrailing spaces after HERE-document mark\n" (pos2sfull lexbuf) + else if s <> !current_here_doc_mark then warn_with_pos [Warn_traps] (pos lexbuf) "Trailing spaces after HERE-document mark" } | '\n' { add_a_new_line(lexeme_end lexbuf); @@ -893,7 +896,7 @@ and raw_here_doc = parse let s = lexeme lexbuf in if chomps s <> !current_here_doc_mark then next_s s raw_here_doc lexbuf - else if s <> !current_here_doc_mark then Printf.eprintf "%sTrailing spaces after HERE-document mark\n" (pos2sfull lexbuf) + else if s <> !current_here_doc_mark then warn_with_pos [Warn_traps] (pos lexbuf) "Trailing spaces after HERE-document mark" } | '\n' { add_a_new_line(lexeme_end lexbuf); -- cgit v1.2.1