Skip to content

Commit

Permalink
Add codepoint ops
Browse files Browse the repository at this point in the history
  • Loading branch information
Spect COW authored and Spect COW committed Oct 9, 2024
1 parent 84191c7 commit 03c907a
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "soakvm",
"version": "1.0.4",
"description": "A Universal General Purpose Virtual Machine written in Sakura/Oaklang",
"main": "dist/soak.js",
"files": [
"dist",
"test",
"src",
"main.js",
"SPEC.md",
"THANKS.md",
"README.md",
"LICENSE"
],
"scripts": {
"test": "node main.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/spcfork/soak.git"
},
"keywords": [
"vm",
"oak",
"oaklang",
"cli",
"binary",
"web"
],
"author": "SpcFORK",
"license": "DWTFYW",
"bugs": {
"url": "https://github.com/spcfork/soak/issues"
},
"homepage": "https://github.com/spcfork/soak#readme"
}
8 changes: 7 additions & 1 deletion src/static.oak
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ Prims := {
't': fn(s, c) true |> s.add()
'f': fn(s, c) false |> s.add()

'#': fn(s, c) c.args.0 |> int() |> s.add()
'$': fn(s, c) c.args.0 |> s.add()
':': fn(s, c) c.args.0 |> atom() |> s.add()
'#': fn(s, c) c.args.0 |> int() |> s.add()
'#.': fn(s, c) c.args.0 |> float() |> s.add()

'()': fn(s, c) s.add(fn {})

Expand Down Expand Up @@ -493,7 +495,10 @@ TransferOps := {

CastOps := {
toint: fn(s, c) s.add(_ioarg(s, c, 0) |> int())
tosym: fn(s, c) s.add(_ioarg(s, c, 0) |> atom())
tostr: fn(s, c) s.add(_ioarg(s, c, 0) |> string())
tochr: fn(s, c) s.add(_ioarg(s, c, 0) |> char())
topoint: fn(s, c) s.add(_ioarg(s, c, 0) |> codepoint())
tobool: fn(s, c) s.add(_ioarg(s, c, 0) |> bool())
tofloat: fn(s, c) s.add(_ioarg(s, c, 0) |> float())
}
Expand Down Expand Up @@ -683,6 +688,7 @@ Importing := {
}

Env := std.merge(
Spawning
ReturnAddr
Prims
Stack
Expand Down

0 comments on commit 03c907a

Please sign in to comment.