Skip to content

Commit

Permalink
Release 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
TaromaruYuki committed Oct 10, 2023
1 parent 40c39d0 commit da9bb8d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.26)
project(Doggoscript VERSION 0.2.0)
project(Doggoscript VERSION 0.3.0)

set("IS_DEBUG" 0)

Expand Down
28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,25 @@
- [x] Control Statements
- [x] Comments
- [X] Scopes (outside a function)
- [ ] Classes
- [X] Classes
- [X] Modules
- [ ] Error Handling
- [X] Maps / Dicts
- [X] File IO
- [ ] List Indexing
- [ ] Assignment Operators

## Example

```
// This is a comment :)
incl "math"
fn join($elements, $seperator) {
val $result is ""
val $len is len($elements)
val $len is $elements->length()
for $i in 0..$len {
val $obj is str(get($elements, $i))
$result is $result + $obj
$result is $result + str($elements->at($i))
if $i != $len - 1 {
$result is $result + $seperator
Expand All @@ -52,7 +51,7 @@ fn fibonacci($n) {
val $result is []
for $i in 0..$n {
append($result, $a)
$result->append($a)
val $temp is $a
$a is $b
Expand All @@ -62,11 +61,22 @@ fn fibonacci($n) {
return $result
}
print("Calculating fibonacci sequence up to 100...")
val $res is "Calculating fibonacci sequence up to 100...\n\n"
print($res)
val $fib is fibonacci(100)
print(join($fib, " "))
print(join(fibonacci(100), " "))
$res is $res + join($fib, " ")
print("10 + 20 is...")
print(add(10, 20))
val $file_str is load_file("hello.txt")
print("File 'hello.txt' content: " + $file_str)
save_file("save.txt", $res)
```

View `grammar.txt` to view the grammar

0 comments on commit da9bb8d

Please sign in to comment.