who knows
This commit is contained in:
@@ -1,3 +1,13 @@
|
|||||||
|
trait Add {
|
||||||
|
fn add(self, other: Self) -> Self
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Add for b32 {
|
||||||
|
asm fn add(self, other) {
|
||||||
|
add {out}, {self}, {other}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
asm {
|
asm {
|
||||||
li a0, 3
|
li a0, 3
|
||||||
|
|||||||
2
src/compiler/instruction.rs
Normal file
2
src/compiler/instruction.rs
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
pub enum Instruction {
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@ mod elf;
|
|||||||
mod program;
|
mod program;
|
||||||
pub mod riscv64;
|
pub mod riscv64;
|
||||||
mod target;
|
mod target;
|
||||||
|
mod instruction;
|
||||||
|
|
||||||
pub use program::*;
|
pub use program::*;
|
||||||
|
|
||||||
|
|||||||
0
src/ir/lvl2/mod.rs
Normal file
0
src/ir/lvl2/mod.rs
Normal file
@@ -1,8 +1,9 @@
|
|||||||
mod namespace;
|
mod namespace;
|
||||||
mod structure;
|
mod lvl1;
|
||||||
|
mod lvl2;
|
||||||
mod file;
|
mod file;
|
||||||
|
|
||||||
pub use namespace::*;
|
pub use namespace::*;
|
||||||
pub use structure::*;
|
pub use lvl1::*;
|
||||||
pub use file::*;
|
pub use file::*;
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ impl Debug for Statement {
|
|||||||
match self {
|
match self {
|
||||||
Statement::Let(n, e) => {
|
Statement::Let(n, e) => {
|
||||||
f.write_str("let ")?;
|
f.write_str("let ")?;
|
||||||
n.fmt(f);
|
n.fmt(f)?;
|
||||||
f.write_str(" = ")?;
|
f.write_str(" = ")?;
|
||||||
e.fmt(f)?;
|
e.fmt(f)?;
|
||||||
f.write_char(';')?;
|
f.write_char(';')?;
|
||||||
|
|||||||
Reference in New Issue
Block a user