Skip to content

Commit

Permalink
feat: ternary-if, strings, array subscript, unary operators
Browse files Browse the repository at this point in the history
  • Loading branch information
midouest committed Mar 3, 2021
1 parent 33c2c67 commit 6a7b5ed
Show file tree
Hide file tree
Showing 16 changed files with 1,984 additions and 990 deletions.
7 changes: 7 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
UseTab: Never
IndentWidth: 4
BreakBeforeBraces: Allman
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
ColumnLimit: 80
AccessModifierOffset: -4
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ endif()
# test_bytebeat target
if(TEST)
set(test_cpp_files
test/test_expression.cpp
test/test_ast.cpp
test/test_lex.cpp
test/test_parse.cpp
)
Expand Down
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ $ cmake --build build/ --target install

- One expression only
- Only one pre-defined variable: `t`
- Integers (+/-), strings
- Mathematic operators: ​`(), +, -, *, /, %`
- Bitwise operators: ​`&, |, ^, <<, >>`
- Relational operators: `<, >, <=, >=, ==, !=`
- Bitwise operators: ​`&, |, ^, <<, >>, ~`
- Relational operators: `<, >, <=, >=, ==, !=, !`
- Array subscript operator: `[]`
- Ternary if operator: `?, :`

## SuperCollider Usage

Expand Down Expand Up @@ -75,13 +78,13 @@ benchmark name samples iterations estimated
mean low mean high mean
std dev low std dev high std dev
-------------------------------------------------------------------------------
parse crowd 100 5 1.7205 ms
4.06055 us 3.81938 us 4.37245 us
1.38736 us 1.14322 us 1.68179 us
parse crowd 100 7 1.8942 ms
2.82587 us 2.79468 us 2.97907 us
305.722 ns 7.57781 ns 729.356 ns
eval crowd 100 615 1.6605 ms
27.3658 ns 27.3508 ns 27.382 ns
0.0791974 ns 0.0684235 ns 0.0937675 ns
eval crowd 100 456 1.6872 ms
36.8993 ns 36.8727 ns 36.9713 ns
0.208576 ns 0.0980819 ns 0.445346 ns
```

Host: Raspberry Pi 3 Model B+
Expand Down
Loading

0 comments on commit 6a7b5ed

Please sign in to comment.