Author: kjs
Date: Mon Mar 26 04:31:25 2007
New Revision: 17765
Modified:
trunk/compilers/pirc/src/pirlexer.c
trunk/compilers/pirc/src/pirparser.c
Log:
compilers/pirc:
* fixed wrong argument to unread_char in lexer.
Modified: trunk/compilers/pirc/src/pirlexer.c
==============================================================================
--- trunk/compilers/pirc/src/pirlexer.c (original)
+++ trunk/compilers/pirc/src/pirlexer.c Mon Mar 26 04:31:25 2007
@@ -942,6 +942,7 @@
return T_INTEGER_CONSTANT;
}
else { /* 1 digit */
+ unread_char(lexer->curfile);
return T_INTEGER_CONSTANT;
}
Modified: trunk/compilers/pirc/src/pirparser.c
==============================================================================
--- trunk/compilers/pirc/src/pirparser.c (original)
+++ trunk/compilers/pirc/src/pirparser.c Mon Mar 26 04:31:25 2007
@@ -50,6 +50,9 @@
/* call next() to get the next token from the lexer */ /* NOTE: it's calling
pirout() */
+
+/* #define next(P) P->curtoken = next_token(P->lexer) */
+
#define next(P) do { pirout(P); P->curtoken = next_token(P->lexer); } while(0)
@@ -584,8 +587,8 @@
| 'global' stringconstant
| heredocstring
| methodcall
- | 'null' )
- '\n'
+ | 'null'
+ )
unop -> '-' | '!' | '~'
@@ -653,7 +656,6 @@
arith_expression(p);
break;
}
- match(p, T_NEWLINE);
}
/*
@@ -1168,7 +1170,7 @@
=item target_statement()
- target_statement -> target '=' assignment
+ target_statement -> target '=' assignment '\n'
| target augmented_op expression '\n'
| target keylist '=' expression '\n'
| target '->' (stringconstant|IDENT) arguments '\n'
@@ -1188,6 +1190,7 @@
switch(p->curtoken) {
case T_ASSIGN: /* target '=' expression */
assignment(p);
+ match(p, T_NEWLINE);
break;
case T_PLUS_ASSIGN: /* target '+=' simple_expr '\n' (and '-=' etc.) */
case T_MINUS_ASSIGN: