Repository navigation
Commit 6553c17
committed
feat: port own-syntax to Rust (lexer + parser + AST) with shared error-parity fixtures
P-022 migration step 2. The crate mirrors ownlang/{lexer,parser,ast_nodes}.py
method for method; LexError/ParseError Display byte-identically to Python's
str() (including a CPython repr() emulation for the quoted-token part).
Parity is asserted from both sides of one corpus,
tests/fixtures/syntax_parity.json: tests/test_syntax_fixtures.py is
authoritative (regenerates via --write, fails when stale, runs in
run_tests.py), and rust/crates/own-syntax/tests/parity.rs replays every case
— exact error strings for rejections, a shared structural digest for accepts
(full AST parity arrives with the CFG port and the oracle seam).
Recorded divergences, both loud: digits are ASCII-only (Python's str.isdigit
quirk not reproduced), integer literals cap at u64 (reject instead of
truncate).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TSqD7TSzxAnGWszaFwTZVt1 parent 1c481e9 commit 6553c17
12 files changed
Lines changed: 2342 additions & 2 deletions
File tree
- rust
- crates/own-syntax
- src
- tests
- tests
- fixtures
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
0 commit comments