Skip to content

V2#38

Merged
lucassus merged 84 commits into
masterfrom
refactor-grammar
May 28, 2026
Merged

V2#38
lucassus merged 84 commits into
masterfrom
refactor-grammar

Conversation

@lucassus

Copy link
Copy Markdown
Owner

No description provided.

lucassus added 30 commits May 12, 2026 18:43
…ze bytecode structure, and enhance test coverage.
…tch` function in VM, and integrate `ohm` grammar compilation process
…update grammar, compiler, VM, and tests accordingly
…and tests, along with precedence and keyword collision handling.
… update grammar, compiler, parser, and tests accordingly.
…am termination, and refactor stack handling.
…nts into assignment expressions, and update bundle definitions.
…mmar, update bytecode with `JMP` opcode, and simplify type definitions in generated parser bundle.
… jump instructions and targets, and add comprehensive tests for behavior.
…ion with conditional jumps (`JMP_IF_ZERO`), remove `AND` and `OR` opcodes, and update tests and README accordingly.
… compiler, update parser bundle types, and implement loop-related bytecode instructions.
…pass compilation, and frame-based VM. Update grammar, bytecode, and tests.
lucassus added 25 commits May 21, 2026 21:27
- Introduce array literals (`[]`, `[e1, ...]`), indexed read/write (`arr[i] = x`), and mutators (`push`, `pop`, etc.).
- Add new `Value` kind (`array`), VM opcodes (`MAKE_ARRAY`, `INDEX_GET`, ...), and runtime checks.
- Update grammar, AST, compiler, and runtime to support arrays.
- Include tests and roadmap updates for arrays.
…ing support

- Introduce `none` and boolean (`true`/`false`) Value kinds with singletons (`NONE_VALUE`, `TRUE_VALUE`, `FALSE_VALUE`).
- Canonicalize truthiness rule: only `none` and `false` are falsy; update `if`/`while`/`not` behavior.
- Replace `JMP_IF_ZERO` with `JMP_IF_FALSY`.
- Update comparison operators (`==`, `!=`, `<`, `>`, etc.) and `not` to return booleans (`true`/`false`) instead of numbers (`0`/`1`).
- Enable negative array indexing (`arr[-1]`) with wrapping for indexed reads and writes; OOB reads return `none`, writes raise `TypeMismatch`.
- Modify grammar, AST, compiler, VM
…olUse` hook and manual regeneration instructions
…s for `none`/`true`/`false`, and ensure exhaustive `switch` guards in specs and runtime
…ith `NoneValue` and `BooleanValue` kinds and singletons, and update truthiness handling
…ime state handling, and replace inline swaps with encapsulated methods.
… `by` literal step, `break`/`continue` compatibility, and compile-time rejection of `by 0`.
…`len`, and `str` built-ins; extend constant pool, opcodes, and feature tests
…constant pool for deduplication of numeric literals.
…ents.test.ts`, `functions.test.ts`) to align with updated directory structure.
…introduce `args` global, and implement `num` built-in for numeric string conversion
…-in; add CLI tests, fixtures, and error handling logic
…ER_NEXT_OR_END` opcodes, and `ArrayIter` implementation; update `for-in` lowering and tests.
…ge loop state, enforce `JMP` type for loop-control jumps, and update related compiler logic and tests
…ive (`...`) range operators, supporting optional `step` keyword.
…Args`, `Params`) using new `ListSep` production.
…` type and construction; update grammar file.
…ethods, and enforce fail-fast access

- Introduced `PropertyAccess` grammar and AST node for `expr.ident` syntax.
- Added `GET_PROPERTY` opcode and a per-kind method registry in the runtime.
- Replaced global functions like `len`, `push`, `num` with methods (e.g., `arr.length`, `arr.push()`, `"123".to_number()`).
- Introduced `bound_native` Value kind for bound methods.
- Enforced strict out-of-bounds and missing property access with `IndexError` and `NoSuchProperty`.
- Updated tests, documentation, and examples for the new behavior and API.
- Removed outdated globals and improved runtime consistency.
@lucassus lucassus self-assigned this May 28, 2026
@lucassus lucassus merged commit 9e5d117 into master May 28, 2026
1 check passed
@lucassus lucassus deleted the refactor-grammar branch May 28, 2026 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant