feat: add borrow test example, fix borrow &mut parsing order

- examples/borrow.bux: working borrow expression example
- tests/borrow_test.nim: add 4 new tests for borrow & @[Shared]
- parser.nim: fix borrow parsing order (& before mut)
- Build verified: example compiles and runs
This commit is contained in:
2026-06-07 17:50:27 +03:00
parent 46814b2abc
commit bfe87a8acb
5 changed files with 37 additions and 1 deletions
+4
View File
@@ -124,6 +124,7 @@ type
ekUnwrap ## expr! — unwrap or panic
ekSpawn ## spawn expr — create a new task
ekAwait ## expr.await — suspend until future resolves
ekBorrow ## borrow &mut expr — explicit borrow expression
ekBlock
ekMatch
@@ -210,6 +211,9 @@ type
exprSpawnAsync*: bool
of ekAwait:
exprAwaitOperand*: Expr
of ekBorrow:
exprBorrowOperand*: Expr
exprBorrowMutable*: bool
of ekBlock:
exprBlock*: Block
of ekMatch: