diff options
author | markm <markm@FreeBSD.org> | 2000-06-25 11:04:01 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2000-06-25 11:04:01 +0000 |
commit | 2618fad5bbb2d0182eb31ed805c41b543c513940 (patch) | |
tree | 52ba93338b13aefd02a0055304a9eccfa0e049f5 /contrib/perl5/x2p/a2p.y | |
parent | 77644ee620b6a79cf8c538abaf7cd301a875528d (diff) | |
download | FreeBSD-src-2618fad5bbb2d0182eb31ed805c41b543c513940.zip FreeBSD-src-2618fad5bbb2d0182eb31ed805c41b543c513940.tar.gz |
Vendor import of Perl 5.006
Diffstat (limited to 'contrib/perl5/x2p/a2p.y')
-rw-r--r-- | contrib/perl5/x2p/a2p.y | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/contrib/perl5/x2p/a2p.y b/contrib/perl5/x2p/a2p.y index 2d3f239..da9b628 100644 --- a/contrib/perl5/x2p/a2p.y +++ b/contrib/perl5/x2p/a2p.y @@ -21,7 +21,7 @@ int ends = Nullop; %token REGEX %token SEMINEW NEWLINE COMMENT %token FUN1 FUNN GRGR -%token PRINT PRINTF SPRINTF SPLIT +%token PRINT PRINTF SPRINTF_OLD SPRINTF_NEW SPLIT %token IF ELSE WHILE FOR IN %token EXIT NEXT BREAK CONTINUE RET %token GETLINE DO SUB GSUB MATCH @@ -144,6 +144,9 @@ expr : term } ; +sprintf : SPRINTF_NEW + | SPRINTF_OLD ; + term : variable { $$ = $1; } | NUMBER @@ -204,7 +207,9 @@ term : variable { $$ = oper1($1,$3); } | USERFUN '(' expr_list ')' { $$ = oper2(OUSERFUN,$1,$3); } - | SPRINTF expr_list + | SPRINTF_NEW '(' expr_list ')' + { $$ = oper1(OSPRINTF,$3); } + | sprintf expr_list { $$ = oper1(OSPRINTF,$2); } | SUBSTR '(' expr ',' expr ',' expr ')' { $$ = oper3(OSUBSTR,$3,$5,$7); } @@ -394,6 +399,6 @@ compound %% -int yyparse _((void)); +int yyparse (void); #include "a2py.c" |