generated from oovm/RustTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
90 additions
and
675 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
18 changes: 18 additions & 0 deletions
18
packages/valkyrie-experiment/source/geometry/point/Point3D.valkyrie
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class Point3D⟨T⟩ { | ||
x: T, | ||
y: T, | ||
z: T, | ||
constructor(x: T, y: T, z: T) { | ||
@bind_fields(x, y, z) | ||
} | ||
} | ||
|
||
class Complex⟨T⟩ { | ||
re: T, | ||
im: T, | ||
constructor(real: T, imaginary: T) { | ||
this.re = real; | ||
this.im = imaginary; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,3 @@ trait Text { | |
} | ||
|
||
|
||
trait MutableText: Text { | ||
|
||
} | ||
|
||
|
8 changes: 0 additions & 8 deletions
8
packages/valkyrie-standard/source/geometry/point/Point3D.valkyrie
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
126 changes: 2 additions & 124 deletions
126
packages/valkyrie-standard/source/primitive/i16.valkyrie
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,126 +1,4 @@ | ||
namespace package.primitive; | ||
|
||
↯primitive(u32) | ||
class u32 {} | ||
|
||
↯derive(Operators) | ||
imply u32 { | ||
# ↯specialized(0) | ||
# infix `+`(self, rhs: u32) { | ||
# | ||
# } | ||
# ↯specialized(-100) | ||
# infix `+`(self, rhs: i32) { | ||
# | ||
# } | ||
↯unchecked | ||
↯instruction(i32.div_u) | ||
add_unchecked(self, rhs: u32) -> u32 { | ||
""" | ||
(param $self) | ||
(param $rhs) | ||
(result i32) | ||
(i32.div_s | ||
local.get $self | ||
local.get $rhs | ||
) | ||
""" | ||
} | ||
# ↯specialized(0) | ||
# infix `-`(self, rhs: u32) { | ||
# | ||
# } | ||
# ↯specialized(-100) | ||
# infix `-`(self, rhs: i32) { | ||
# | ||
# } | ||
# infix `/=`(mut self, rhs: u32) { | ||
# self = self / rhs | ||
# } | ||
# infix `/`(self, rhs: u32)-> u32 { | ||
# if rhs == 0 { | ||
# raise DivideByZero(rhs) | ||
# } | ||
# else { | ||
# self.div_unchecked(rhs) | ||
# } | ||
# } | ||
↯unchecked | ||
↯instruction(i32.div_u) | ||
div_unchecked(self, rhs: u32) -> u32 { | ||
""" | ||
(param $self) | ||
(param $rhs) | ||
(result i32) | ||
(i32.div_s | ||
local.get $self | ||
local.get $rhs | ||
) | ||
""" | ||
} | ||
} | ||
|
||
↯derive(Converters) | ||
imply u32 { | ||
↯specialized(0) | ||
explicit into(self) -> i32 { | ||
""" | ||
(param $self) | ||
(param $rhs) | ||
(result i32) | ||
(i32.div_s | ||
local.get $self | ||
local.get $rhs | ||
) | ||
""" | ||
} | ||
↯specialized(-100) | ||
implicit into(self) -> u64 { | ||
""" | ||
(param $self) | ||
(result i64) | ||
(i32.div_s | ||
local.get $self | ||
local.get $rhs | ||
) | ||
""" | ||
} | ||
} | ||
|
||
↯derive(From, Into) | ||
imply bool { | ||
↯asm | ||
explicit from(value: u16) { | ||
""" | ||
(param $value i32) | ||
(result i32) | ||
local.get $self | ||
i32.eqz | ||
""" | ||
} | ||
↯asm | ||
explicit into(self) -> u16 { | ||
""" | ||
(param $self i32) | ||
(result i32) | ||
local.get $self | ||
""" | ||
} | ||
↯asm | ||
explicit from(value: i16) { | ||
""" | ||
(param $value i32) | ||
(result i32) | ||
local.get $self | ||
i32.eqz | ||
""" | ||
} | ||
↯asm | ||
explicit into(self) -> i16 { | ||
""" | ||
(param $self i32) | ||
(result i32) | ||
local.get $self | ||
""" | ||
} | ||
} | ||
↯primitive(i32) | ||
class i16 {} |
Oops, something went wrong.