Mercurial > hg > index.cgi
comparison lwasm/insn_rlist.c @ 404:f6e03c2cebfb
Fix "rlist" to recognize comments as end of operand
Fix "rlist" to recognize comments as the end of the operand instead of
trying to parse a comment character as an additional register specification.
author | William Astle <lost@l-w.ca> |
---|---|
date | Thu, 15 Oct 2015 23:21:26 -0600 |
parents | b20f14edda5a |
children | f9ffd1935cee |
comparison
equal
deleted
inserted
replaced
403:f5a88f147fae | 404:f6e03c2cebfb |
---|---|
31 { | 31 { |
32 int rb = 0; | 32 int rb = 0; |
33 int rn; | 33 int rn; |
34 static const char *regs = "CCA B DPX Y U PCD S "; | 34 static const char *regs = "CCA B DPX Y U PCD S "; |
35 | 35 |
36 while (**p && !isspace(**p)) | 36 while (**p && !isspace(**p) && **p != ';' && **p != '*') |
37 { | 37 { |
38 rn = lwasm_lookupreg2(regs, p); | 38 rn = lwasm_lookupreg2(regs, p); |
39 if (rn < 0) | 39 if (rn < 0) |
40 { | 40 { |
41 lwasm_register_error2(as, l, E_REGISTER_BAD, "'%s'", *p); | 41 lwasm_register_error2(as, l, E_REGISTER_BAD, "'%s'", *p); |
42 return; | 42 return; |
43 } | 43 } |
44 lwasm_skip_to_next_token(l, p); | 44 lwasm_skip_to_next_token(l, p); |
45 if (**p && **p != ',' && !isspace(**p)) | 45 if (**p && **p != ',' && !isspace(**p) && **p != ';' && **p != '*') |
46 { | 46 { |
47 lwasm_register_error(as, l, E_OPERAND_BAD); | 47 lwasm_register_error(as, l, E_OPERAND_BAD); |
48 } | 48 } |
49 if (**p == ',') | 49 if (**p == ',') |
50 { | 50 { |