Add bit operators, defer, list methods, rand, assert and rex test

- Bit operators & | ^ ~ << >> and their op= forms (Go precedence),
  plus hex, binary and octal literals (0xff, 0b1010, 0o755)
- defer stmt / defer { ... }: runs when the block ends, last first,
  also on return, ?, break and continue
- List methods insert, remove, clear, contains, index_of, reverse,
  sort and sort_by (stable merge sort)
- rand module: int(a, b), float(), seed(n)
- assert(cond[, msg]) and `rex test`, which runs each test_ function
  in its own process
- rex.toml marks a project's top folder: imports count from there
- Docs, formatter, LSP completions and editor grammars updated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Your NameandClaude Opus 5.5 committed 2026-11-12 23:30:05 +01:00
1 parent 910bde692a
commit 300d767124
28 files changed
+1373 -65

No files matched your search

+2 -2
View File
@@ -62,7 +62,7 @@
},
"keywords": {
"patterns": [
{ "name": "keyword.control.rex", "match": "\\b(if|else|for|in|step|match|return|break|continue)\\b" },
{ "name": "keyword.control.rex", "match": "\\b(if|else|for|in|step|match|return|break|continue|defer)\\b" },
{ "name": "keyword.declaration.rex", "match": "\\b(func|var|const|import|struct|enum|interface|pub)\\b" },
{ "name": "storage.modifier.rex", "match": "\\b(shared|weak)\\b" }
]
@@ -73,7 +73,7 @@
},
"numbers": {
"name": "constant.numeric.rex",
"match": "\\b[0-9][0-9_]*(?:\\.[0-9][0-9_]*)?\\b"
"match": "\\b(?:0[xX][0-9a-fA-F_]+|0[bB][01_]+|0[oO][0-7_]+|[0-9][0-9_]*(?:\\.[0-9][0-9_]*)?)\\b"
},
"types": {
"patterns": [