Skip to content

Commit 3053d0e

Browse files
committed
parser: add parser, sample for test_print
1 parent 96b6b06 commit 3053d0e

File tree

5 files changed

+873
-3
lines changed

5 files changed

+873
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ edition = "2021"
66
[dependencies]
77
strum = "0.21.0"
88
strum_macros = "0.21.1"
9+
regex = "1.10.4"

src/instruction.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ impl Default for ArmInstruction {
426426
}
427427
}
428428

429-
#[derive(Debug)]
429+
#[derive(Debug, PartialEq, Eq, Clone)]
430430
pub enum RiscVVal {
431431
RiscVRegister(RiscVRegister),
432432
Immediate(i32),
@@ -449,7 +449,7 @@ impl Default for RiscVVal {
449449

450450
/// RISC-V Registers
451451
/// https://msyksphinz-self.github.io/riscv-isadoc/html/regs.html
452-
#[derive(Debug, EnumString, Default)]
452+
#[derive(Debug, EnumString, Default, PartialEq, Eq, Clone)]
453453
pub enum RiscVRegister {
454454
#[default]
455455
#[strum(serialize = "x0")]

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
pub mod instruction;
2+
pub mod parser;
23
pub mod translate;
34
pub mod utils;

0 commit comments

Comments
 (0)