Skip to content

Commit 2a7fade

Browse files
committed
Renamed instructions. dis to dgs and dir to dgr
1 parent db6ba05 commit 2a7fade

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

rust_project/loda-rust-core/src/parser/instruction_id.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ impl fmt::Display for InstructionId {
4444
Self::BitwiseXor => "bxo",
4545
Self::EvalSequence => "seq",
4646
Self::Compare => "cmp",
47-
Self::DigitalRoot => "dir",
48-
Self::DigitSum => "dis",
47+
Self::DigitalRoot => "dgr",
48+
Self::DigitSum => "dgs",
4949
Self::Divide => "div",
5050
Self::DivideIf => "dif",
5151
Self::Equal => "equ",

rust_project/loda-rust-core/src/parser/parse_instruction_id.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ impl ParseInstructionId for InstructionId {
2929
"bxo" => Ok(Self::BitwiseXor),
3030
"cmp" => Ok(Self::Compare),
3131
"dif" => Ok(Self::DivideIf),
32-
"dir" => Ok(Self::DigitalRoot),
33-
"dis" => Ok(Self::DigitSum),
32+
"dgr" => Ok(Self::DigitalRoot),
33+
"dgs" => Ok(Self::DigitSum),
3434
"div" => Ok(Self::Divide),
3535
"equ" => Ok(Self::Equal),
3636
"gcd" => Ok(Self::GCD),
@@ -111,9 +111,13 @@ mod tests {
111111
assert_eq!(instruction_id, InstructionId::NthRoot);
112112
}
113113
{
114-
let instruction_id: InstructionId = InstructionId::parse("dis", 1).expect("InstructionId");
114+
let instruction_id: InstructionId = InstructionId::parse("dgs", 1).expect("InstructionId");
115115
assert_eq!(instruction_id, InstructionId::DigitSum);
116116
}
117+
{
118+
let instruction_id: InstructionId = InstructionId::parse("dgr", 1).expect("InstructionId");
119+
assert_eq!(instruction_id, InstructionId::DigitalRoot);
120+
}
117121
{
118122
let instruction_id: InstructionId = InstructionId::parse("lps", 1).expect("InstructionId");
119123
assert_eq!(instruction_id, InstructionId::UnofficialLoopBeginSubtract);

rust_project/loda-rust-web/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!doctype html><html lang="en"><head><meta charset="utf-8">
22
<meta name="robots" content="noindex">
3-
<!-- LODA-RUST WASM project was last updated: 2024 Dec 12. -->
3+
<!-- LODA-RUST WASM project was last updated: 2025 Jan 19. -->
44
<title>Edit</title>
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66
<meta name="format-detection" content="telephone=no">

rust_project/loda-rust-web/web/codemirror_mode_loda.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
{regex: /[$][$]\d+/, token: "number"},
1616
{regex: /[$]\d+/, token: "number"},
1717
{regex: /-?\d+/, token: "number"},
18-
{regex: /\s*(?:mov|add|sub|trn|mul|div|dif|mod|pow|gcd|bin|cmp|min|max|log|lpb|lpe|nrt|dis|dir|equ|neq|leq|geq|ban|bor|bxo|seq|lps|f\d\d)\b/,
18+
{regex: /\s*(?:mov|add|sub|trn|mul|div|dif|mod|pow|gcd|bin|cmp|min|max|log|lpb|lpe|nrt|dgs|dgr|equ|neq|leq|geq|ban|bor|bxo|seq|lps|f\d\d)\b/,
1919
token: "keyword", sol: true },
2020
{regex: /#offset\s+(0|-?[1-9]\d*)$/, token: "keyword", sol: true},
2121
{regex: /;.*/, token: "comment"},

0 commit comments

Comments
 (0)