...
This commit is contained in:
9
specs.md
9
specs.md
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user