diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-11-26 14:14:53 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-11-26 14:14:53 +0000 |
commit | 1537738cd9023b08d8730a56eb7bc1e1cab0dc90 (patch) | |
tree | 9413bf04a7937f557cd9691d3cfa0031d3adda5a /perl_checker.src/lexer.mll | |
parent | 431db26a9d138a21e17caf3affe5d2131387b69f (diff) | |
download | perl-MDK-Common-1537738cd9023b08d8730a56eb7bc1e1cab0dc90.tar perl-MDK-Common-1537738cd9023b08d8730a56eb7bc1e1cab0dc90.tar.gz perl-MDK-Common-1537738cd9023b08d8730a56eb7bc1e1cab0dc90.tar.bz2 perl-MDK-Common-1537738cd9023b08d8730a56eb7bc1e1cab0dc90.tar.xz perl-MDK-Common-1537738cd9023b08d8730a56eb7bc1e1cab0dc90.zip |
*** empty log message ***
Diffstat (limited to 'perl_checker.src/lexer.mll')
-rw-r--r-- | perl_checker.src/lexer.mll | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/perl_checker.src/lexer.mll b/perl_checker.src/lexer.mll index cfd7af9..1e1c875 100644 --- a/perl_checker.src/lexer.mll +++ b/perl_checker.src/lexer.mll @@ -22,8 +22,8 @@ type raw_token = | POD of (string * raw_pos) | LABEL of (string * raw_pos) | COMMAND_STRING of (raw_interpolated_string * raw_pos) - | PRINT_TO_STAR of (string * raw_pos) - | PRINT_TO_SCALAR of (string * raw_pos) + | PRINT_TO_STAR of ((string * string) * raw_pos) + | PRINT_TO_SCALAR of ((string * string) * raw_pos) | QUOTEWORDS of (string * raw_pos) | COMPACT_HASH_SUBSCRIPT of (string * raw_pos) | RAW_HERE_DOC of ((string * raw_pos) ref * raw_pos) @@ -411,6 +411,7 @@ rule token = parse | "BEGIN" { BEGIN(pos lexbuf) } | "END" { END(pos lexbuf) } | "print" { PRINT(lexeme lexbuf, pos lexbuf) } +| "printf" { PRINT(lexeme lexbuf, pos lexbuf) } | "new" { NEW(pos lexbuf) } | "format" { let _ = raw_here_doc_next_line "." in FORMAT(pos lexbuf) } | "defined" { ONE_SCALAR_PARA(lexeme lexbuf, pos lexbuf) } @@ -420,11 +421,19 @@ rule token = parse | "print " ['A'-'Z'] ['A'-'Z' '0'-'9']* ['\n' ' '] { putback lexbuf 1; - PRINT_TO_STAR(skip_n_char 6 (lexeme lexbuf), pos lexbuf) + PRINT_TO_STAR(("print", skip_n_char 6 (lexeme lexbuf)), pos lexbuf) } | "print $" ident ['\n' ' '] { putback lexbuf 1; - PRINT_TO_SCALAR(skip_n_char 7 (lexeme lexbuf), pos lexbuf); + PRINT_TO_SCALAR(("print", skip_n_char 7 (lexeme lexbuf)), pos lexbuf); + } +| "printf " ['A'-'Z'] ['A'-'Z' '0'-'9']* ['\n' ' '] { + putback lexbuf 1; + PRINT_TO_STAR(("printf", skip_n_char 7 (lexeme lexbuf)), pos lexbuf) + } +| "printf $" ident ['\n' ' '] { + putback lexbuf 1; + PRINT_TO_SCALAR(("printf", skip_n_char 8 (lexeme lexbuf)), pos lexbuf); } | ident ' '* "=>" { (* needed so that (if => 1) works *) |