fixed register ref in grammar
This commit is contained in:
parent
d8ed110400
commit
8b192bf02e
@ -97,7 +97,7 @@ arg:
|
||||
REGISTER_REF {
|
||||
char* tmp = "";
|
||||
char *index_str = strdup($1 + 3); // copy from 4th char
|
||||
asprintf(&tmp, "('%c', '%c', '%c', %s)", $1[1], index_str, $1[2], $1[0]);
|
||||
asprintf(&tmp, "('%c', %s, '%c', '%c')", $1[1], index_str, $1[2], $1[0]);
|
||||
// r@i1 -> r register, index in i1
|
||||
// Python args: type_register, index, ref_origin, ref_target
|
||||
// r@i1 -> ('@', '1', 'i', 'r')
|
||||
|
@ -2,3 +2,4 @@
|
||||
ADD(i0 ,1 ,r0)
|
||||
SUB(i1,3,r1)
|
||||
MULT(r1,r0,o1)
|
||||
ADD(5, i@i2, o2)
|
||||
|
Loading…
x
Reference in New Issue
Block a user