Feat: add mutable pointer type *mut T and *mut opaque

- Grammar: update pointer_type to support optional mut keyword;
  LL(1) verified (56 named rules, no conflicts)
- AST: update Type enum with mutable: bool field for Pointer and
  OpaquePointer variants
- Parser: consume optional mut token in parse_type; update all
  existing pointer tests; add 4 new mut pointer tests (85 pass)
- VSCode extension: add *mut capture-group pattern for syntax
  highlighting; update SYNTAX.md with pointer mutability table

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 10:37:21 +01:00
parent 53c66a3d03
commit 7cdcad7df3
5 changed files with 97 additions and 29 deletions

View File

@@ -180,6 +180,14 @@
"name": "keyword.operator.assignment.flux",
"match": "(?<![=!<>+\\-*/%&|^])=(?!=)"
},
{
"comment": "Mutable pointer type prefix *mut — must precede arithmetic *",
"match": "(\\*)(mut)\\b",
"captures": {
"1": { "name": "keyword.operator.type.pointer.flux" },
"2": { "name": "storage.modifier.mut.flux" }
}
},
{
"comment": "Arithmetic: + - * / %",
"name": "keyword.operator.arithmetic.flux",