summaryrefslogtreecommitdiff
path: root/x2p/a2p.y
diff options
context:
space:
mode:
authorBrendan O'Dea <bod@debian.org>2005-09-12 05:43:14 +1000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-09-21 13:12:33 +0000
commit4cec2b33f0aa04d807b9b31c6b4212fe462cd7d4 (patch)
treee74192c7f4eef0e92145a3fae2ccc544961a093c /x2p/a2p.y
parent2f47ab8edd56c5955eeed9457c1ac240743f9f69 (diff)
downloadperl-4cec2b33f0aa04d807b9b31c6b4212fe462cd7d4.tar.gz
misc a2p fixes
Message-ID: <20050911094314.GA15155@londo.c47.org> and remove the check_byacc target from the x2p makefile p4raw-id: //depot/perl@25534
Diffstat (limited to 'x2p/a2p.y')
-rw-r--r--x2p/a2p.y47
1 files changed, 37 insertions, 10 deletions
diff --git a/x2p/a2p.y b/x2p/a2p.y
index 8ae8953ee4..74c42d8c19 100644
--- a/x2p/a2p.y
+++ b/x2p/a2p.y
@@ -44,7 +44,7 @@ int ends = Nullop;
%left NOT
%right '^'
%left INCR DECR
-%left FIELD VFIELD
+%left FIELD VFIELD SVFIELD
%%
@@ -137,11 +137,12 @@ expr : term
| expr '?' expr ':' expr
{ $$ = oper3(OCOND,$1,$3,$5); }
| variable ASGNOP cond
- { $$ = oper3(OASSIGN,$2,$1,$3);
- if ((ops[$1].ival & 255) == OFLD)
- lval_field = TRUE;
- if ((ops[$1].ival & 255) == OVFLD)
- lval_field = TRUE;
+ {
+ $$ = oper3(OASSIGN,$2,$1,$3);
+ if ((ops[$1].ival & 255) == OFLD)
+ lval_field = TRUE;
+ else if ((ops[$1].ival & 255) == OVFLD)
+ lval_field = TRUE;
}
;
@@ -169,13 +170,37 @@ term : variable
| term IN VAR
{ $$ = oper2(ODEFINED,aryrefarg($3),$1); }
| variable INCR
- { $$ = oper1(OPOSTINCR,$1); }
+ {
+ $$ = oper1(OPOSTINCR,$1);
+ if ((ops[$1].ival & 255) == OFLD)
+ lval_field = TRUE;
+ else if ((ops[$1].ival & 255) == OVFLD)
+ lval_field = TRUE;
+ }
| variable DECR
- { $$ = oper1(OPOSTDECR,$1); }
+ {
+ $$ = oper1(OPOSTDECR,$1);
+ if ((ops[$1].ival & 255) == OFLD)
+ lval_field = TRUE;
+ else if ((ops[$1].ival & 255) == OVFLD)
+ lval_field = TRUE;
+ }
| INCR variable
- { $$ = oper1(OPREINCR,$2); }
+ {
+ $$ = oper1(OPREINCR,$2);
+ if ((ops[$2].ival & 255) == OFLD)
+ lval_field = TRUE;
+ else if ((ops[$2].ival & 255) == OVFLD)
+ lval_field = TRUE;
+ }
| DECR variable
- { $$ = oper1(OPREDECR,$2); }
+ {
+ $$ = oper1(OPREDECR,$2);
+ if ((ops[$2].ival & 255) == OFLD)
+ lval_field = TRUE;
+ else if ((ops[$2].ival & 255) == OVFLD)
+ lval_field = TRUE;
+ }
| '-' term %prec UMINUS
{ $$ = oper1(OUMINUS,$2); }
| '+' term %prec UMINUS
@@ -252,6 +277,8 @@ variable: VAR
{ $$ = oper2(OVAR,aryrefarg($1),$3); }
| FIELD
{ $$ = oper1(OFLD,$1); }
+ | SVFIELD
+ { $$ = oper1(OVFLD,oper1(OVAR,$1)); }
| VFIELD term
{ $$ = oper1(OVFLD,$2); }
;