This commit is contained in:
agra
2026-02-16 01:58:30 +02:00
parent b20676375d
commit c8ceceed0f
6 changed files with 104 additions and 236 deletions

View File

@@ -19,20 +19,19 @@ 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` |
| String | `"Hello"`, `"z: {z}"` | `string` (may span multiple lines) |
| 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).
String literals support escape sequences (`\n`, `\t`, `\r`, `\\`, `\"`, `\0`) and may span multiple lines directly:
```sx
shader_src := `#version 330 core
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.