Fixed bug in parsing of variables.

master
Rohan Jacob-Rao 9 years ago
parent 5169419216
commit 51ebf2493e

@ -150,9 +150,9 @@ rule token = parse
(*| "va_arg" { VA_ARG }*) (*| "va_arg" { VA_ARG }*)
(*| "landingpad" { LANDINGPAD }*) (*| "landingpad" { LANDINGPAD }*)
(* identifiers - make this complete *) (* identifiers *)
| '@' { AT } | '@' (id as str) { GLOBAL str }
| '%' { PERCENT } | '%' (id as str) { LOCAL str }
| id as str { IDENT str } | id as str { IDENT str }
| eof { EOF } | eof { EOF }

@ -27,8 +27,6 @@
%token EQUALS %token EQUALS
%token STAR %token STAR
%token X %token X
%token AT
%token PERCENT
(* TYPES *) (* TYPES *)
%token VOID %token VOID
@ -127,6 +125,8 @@
(*%token VA_ARG*) (*%token VA_ARG*)
(*%token LANDINGPAD*) (*%token LANDINGPAD*)
%token <string> GLOBAL
%token <string> LOCAL
%token <string> IDENT %token <string> IDENT
%token EOF %token EOF
@ -238,8 +238,8 @@ operand:
| const=constant { Const const } | const=constant { Const const }
variable: variable:
| AT id=IDENT { Global id } | id=GLOBAL { Global id }
| PERCENT id=IDENT { Local id } | id=LOCAL { Local id }
constant: constant:
| i=CONSTINT { Cint i } | i=CONSTINT { Cint i }

Loading…
Cancel
Save