commit 4ab6f49ca80e367e4b226591468781b95579ec17
parent ff7d31971e81ad9a878548ec864a5b972d9a943f
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Sat, 16 Dec 2017 08:12:54 +0100
[as] Fix string and iden parser
After the last changes string() didn't parsed the full string
and iden would consume the full input string.
Diffstat:
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/as/expr.c b/as/expr.c
@@ -195,10 +195,11 @@ iden(void)
case '$':
continue;
default:
- break;
+ goto out_loop;
}
}
+out_loop:
tok2str();
yylval.sym = lookup(yytext);
@@ -236,8 +237,10 @@ string(void)
int c;
char *p;
- while (*endp != '"')
- ++endp;
+ for (++endp; *endp++ != '"'; )
+ ;
+ tok2str();
+
return STRING;
}