mirror of
https://github.com/hazemKrimi/hack-assembler.git
synced 2026-05-02 02:30:28 +00:00
Update A instruction parsing condition
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@ use regex::Regex;
|
|||||||
pub fn parse(instruction: &String) -> Instruction {
|
pub fn parse(instruction: &String) -> Instruction {
|
||||||
let mut cloned = instruction.clone();
|
let mut cloned = instruction.clone();
|
||||||
|
|
||||||
if cloned.chars().nth(0).unwrap() == '@' {
|
if cloned.starts_with('@') {
|
||||||
cloned.remove(0);
|
cloned.remove(0);
|
||||||
|
|
||||||
return Instruction::AInstruction(AInstruction {
|
return Instruction::AInstruction(AInstruction {
|
||||||
|
|||||||
Reference in New Issue
Block a user