Skip to content
This repository has been archived by the owner on Sep 23, 2023. It is now read-only.

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nyzd committed Sep 11, 2023
1 parent 8a654f2 commit 10bb645
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 27 deletions.
19 changes: 0 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,6 @@ Just a stack based language

```./target/debug/jsl source.jsl```

# Debug
Show the final stack with `--stack` flag

example:

```./target/debug/jsl source.jsl --stack```

this will return 0..8 of stack if you want more or less you can specify size

example:

```./target/debug/jsl source.jsl --stack 32```

Or if you want to debug a memory(variables) you can use `--memory` flag instead of `--stack`

for example:

```./target/debug/jsl source.jsl --memory```

# Functions
Functions can defined with `fn` keyword, for example

Expand Down
4 changes: 2 additions & 2 deletions editors/code/jsl/syntaxes/jsl.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"keywords": {
"patterns": [{
"name": "keyword.control.jsl",
"match": "\\b(macro|end|times|done|import|let|lets|ok|fn|do)\\b"
"match": "\\b(}|times|import|let|lets|fn|{)\\b"
}]
}
},
"scopeName": "source.jsl"
}
}
14 changes: 8 additions & 6 deletions examples/fib.jsl
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
fn fib n do
0 0 1 lets num1 num2 num3 ok
fn fib n -> {
1 let num1
0 let num2
0 let num3

n times
n times {
num1 num2 add set num3
num2 set num1
num3 set num2

num3 put
done
end
}
}

100 fib
100 call fib

0 comments on commit 10bb645

Please sign in to comment.