Skip to content

Commit

Permalink
Update to moonc v0.1.20240809+5c355ddde
Browse files Browse the repository at this point in the history
Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
  • Loading branch information
gmlewis committed Aug 12, 2024
1 parent 5125af9 commit 156cd06
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,8 @@ The code has been updated to support compiler:

```bash
$ moon version --all
moon 0.1.20240807 (235e4bc 2024-08-07) ~/.moon/bin/moon
moonc v0.1.20240807+41236f720 ~/.moon/bin/moonc
moon 0.1.20240809 (e6f8c24 2024-08-09) ~/.moon/bin/moon
moonc v0.1.20240809+5c355ddde ~/.moon/bin/moonc
moonrun 0.1.20240716 (08bce9c 2024-07-16) ~/.moon/bin/moonrun
```

Expand Down
8 changes: 4 additions & 4 deletions examples/arrays/all-three.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ pub impl @jsonutil.ToJson for AllThree with to_json(self) {
}

/// `process_all_three` processes all three array types.
pub fn process_all_three(in : AllThree) -> AllThree {
pub fn process_all_three(all3 : AllThree) -> AllThree {
{
ints: process_ints(in.ints),
floats: process_floats(in.floats),
strings: process_strings(in.strings),
ints: process_ints(all3.ints),
floats: process_floats(all3.floats),
strings: process_strings(all3.strings),
}
}
2 changes: 1 addition & 1 deletion moon.mod.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "extism/moonbit-pdk",
"version": "0.32.0",
"version": "0.33.0",
"deps": {
"gmlewis/jsonutil": "0.22.0"
},
Expand Down
7 changes: 4 additions & 3 deletions pdk/host/memory.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ pub fn to_string(self : Memory) -> String {
/// to a MoonBit Int.
pub fn to_int(self : Memory) -> Int {
let bytes = self.to_bytes()
bytes[0].to_int() + bytes[1].to_int().lsl(8) + bytes[2].to_int().lsl(16) + bytes[3]
.to_int()
.lsl(24)
bytes[0].to_int() +
bytes[1].to_int().lsl(8) +
bytes[2].to_int().lsl(16) +
bytes[3].to_int().lsl(24)
}

/// `to_bytes` reads the (unprocessed) bytes residing in the host memory
Expand Down

0 comments on commit 156cd06

Please sign in to comment.