set register value of current context
(self, line: str)
| 128 | return res |
| 129 | |
| 130 | def handle_set(self, line: str) -> Tuple[str, int]: |
| 131 | """ |
| 132 | set register value of current context |
| 133 | """ |
| 134 | # set $a = b |
| 135 | |
| 136 | m = re.match(r'\s*\$(?P<reg>\w+)\s*=\s*(?P<expr>.+)', line) |
| 137 | |
| 138 | if m is None: |
| 139 | raise SyntaxError('illegal command syntax') |
| 140 | |
| 141 | if not m['reg']: |
| 142 | raise KeyError('error parsing input: invalid lhand expression') |
| 143 | |
| 144 | if not m['expr']: |
| 145 | raise SyntaxError('error parsing input: invalid rhand expression') |
| 146 | |
| 147 | reg = self.unalias(m['reg']) |
| 148 | expr = self.resolve_expr(m['expr']) |
| 149 | |
| 150 | self.write_reg(reg, expr) |
| 151 | |
| 152 | return (reg, expr) |
| 153 | |
| 154 | def handle_i(self, addr: int, count: int) -> List[InsnLike]: |
| 155 | result = [] |
no test coverage detected