Commit 43b186f
feat(python): enforce ERR_RESERVED_ATTR in parser (ADR-0006 §D1)
Adds inline detection of @-prefixed reserved structural keys (name, package,
extends, abstract, overlay, isArray, children, value) during parse. Any
such key emits ERR_RESERVED_ATTR with the offending node and key in the
message — matches the TS parser-core behaviour.
The reserved-key tuple lives in parser.py and is built from the existing
shared.structural KEY_* constants — single source of truth.
Migrates two codegen golden fixtures (nested-array, scalars) from the
deprecated @isarray attribute form to the bare isArray structural key per
ADR-0006 §D1.
Ledger: un-gates error-reserved-word-as-attr.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 0e94f59 commit 43b186f
4 files changed
Lines changed: 27 additions & 3 deletions
File tree
- server/python
- src/metaobjects
- tests
- codegen/golden
- nested-array
- scalars
- conformance
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
24 | 37 | | |
25 | 38 | | |
26 | 39 | | |
| |||
99 | 112 | | |
100 | 113 | | |
101 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
102 | 127 | | |
103 | 128 | | |
104 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
0 commit comments