Compiler in Rust (lexer, parser, checker, C codegen), maps, chars, dino fmt, dino lsp (diagnostics, formatting, outline, definition, hover, completion, signature help), docs, examples, VS Code/Vim files. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
31 lines
460 B
Plaintext
31 lines
460 B
Plaintext
1 + 2 * 3
|
|
= 7.0
|
|
(1 + 2) * 3
|
|
= 9.0
|
|
-2 ^ 2
|
|
= -4.0
|
|
2 ^ 3 ^ 2
|
|
= 512.0
|
|
x = 10 / 4
|
|
= 2.5
|
|
x * 2 + pi
|
|
= 8.14159265358979
|
|
sqrt(16) + abs(-3)
|
|
= 7.0
|
|
max(2, 7) % 4
|
|
= 3.0
|
|
y
|
|
error: unknown variable `y`
|
|
1 / 0
|
|
error: division by zero
|
|
foo(1)
|
|
error: unknown function `foo`
|
|
sqrt(1, 2)
|
|
error: `sqrt` takes 1 argument(s), but 2 given
|
|
3 +
|
|
error: the calculation ends too early (column 4)
|
|
4 $ 4
|
|
error: unexpected `$` at column 3
|
|
sum(1, 2, 3) * x
|
|
= 15.0
|