This commit is contained in:
agra
2026-02-12 16:23:42 +02:00
parent 1087bd1977
commit dab162bfe4
13 changed files with 1190 additions and 775 deletions

View File

@@ -20,10 +20,31 @@ Line comments start with `//` and extend to end of line.
| Integer | `0`, `42`, `0xFF`, `0b1010` | `s64` |
| Float | `0.3`, `0.9` | `f32` |
| String | `"Hello"`, `"z: {z}"` | `string` |
| Multi-line String | `` `line1\nline2` `` | `string` |
| Heredoc String | `#string END`...`END` | `string` |
| Boolean | `true`, `false` | `bool` |
| Enum | `.variant1` | inferred from context |
| Undefined | `---` | context-dependent |
**Multi-line strings** use backtick delimiters (`` ` ``). They may span multiple lines and support the same escape sequences as regular strings (`\n`, `\t`, `\r`, `\\`, `\"`, `` \` ``, `\0`). Content between backticks is taken verbatim (no indentation stripping).
```sx
shader_src := `#version 330 core
void main() {
gl_Position = vec4(0.0);
}
`;
```
**Heredoc strings** use `#string DELIMITER` syntax (inspired by Jai). Content is completely raw — no escape processing. The delimiter is any identifier. Content starts after the newline following the delimiter and ends when the delimiter appears at column 0 of a line.
```sx
vert_src := #string GLSL
#version 330 core
void main() {
gl_Position = vec4(aPos, 1.0);
}
GLSL;
```
### Keywords
`if`, `else`, `then`, `while`, `break`, `continue`, `true`, `false`, `enum`, `struct`, `union`, `case`, `return`, `defer`, `xx`, `and`, `or`