@jhlagado/azm 0.2.9 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +21 -9
  2. package/dist/src/core/compile.js +97 -1
  3. package/dist/src/expansion/op-expansion.js +47 -9
  4. package/dist/src/outputs/d8-files.js +1 -0
  5. package/dist/src/outputs/types.d.ts +1 -0
  6. package/dist/src/register-contracts/report.js +15 -3
  7. package/dist/src/register-contracts/smartCommentParsing.d.ts +1 -0
  8. package/dist/src/register-contracts/smartCommentParsing.js +42 -7
  9. package/dist/src/register-contracts/smartComments.d.ts +2 -2
  10. package/dist/src/register-contracts/smartComments.js +3 -4
  11. package/dist/src/source/instruction-chain.d.ts +5 -0
  12. package/dist/src/source/instruction-chain.js +75 -0
  13. package/dist/src/syntax/names.d.ts +18 -0
  14. package/dist/src/syntax/names.js +44 -0
  15. package/dist/src/syntax/parse-data-directives.d.ts +17 -0
  16. package/dist/src/syntax/parse-data-directives.js +147 -0
  17. package/dist/src/syntax/parse-declaration-directives.d.ts +18 -0
  18. package/dist/src/syntax/parse-declaration-directives.js +90 -0
  19. package/dist/src/syntax/parse-diagnostics.d.ts +8 -0
  20. package/dist/src/syntax/parse-diagnostics.js +15 -0
  21. package/dist/src/syntax/parse-directive-statement.d.ts +1 -5
  22. package/dist/src/syntax/parse-directive-statement.js +19 -259
  23. package/dist/src/syntax/parse-instruction-chain.d.ts +22 -0
  24. package/dist/src/syntax/parse-instruction-chain.js +62 -0
  25. package/dist/src/syntax/parse-layout-declarations.js +9 -18
  26. package/dist/src/syntax/parse-layout-expression.js +4 -3
  27. package/dist/src/syntax/parse-line.js +20 -31
  28. package/dist/src/syntax/parse-location-directives.d.ts +7 -0
  29. package/dist/src/syntax/parse-location-directives.js +15 -0
  30. package/dist/src/syntax/statement-classification.d.ts +2 -0
  31. package/dist/src/syntax/statement-classification.js +24 -0
  32. package/dist/src/tooling/case-style.js +42 -26
  33. package/docs/codebase/02-source-loading-and-parsing.md +28 -8
  34. package/docs/codebase/04-ops-and-register-contracts.md +24 -3
  35. package/docs/codebase/05-interfaces-and-output-artifacts.md +10 -0
  36. package/docs/codebase/06-verification-and-maintenance.md +9 -3
  37. package/docs/codebase/appendices/a-directory-file-reference.md +17 -10
  38. package/docs/codebase/appendices/b-compile-flow-reference.md +3 -2
  39. package/docs/codebase/index.md +4 -0
  40. package/package.json +1 -1
@@ -74,6 +74,11 @@ These tests compare AZM behaviour against ASM80 expectations, lowered output and
74
74
  real-program fixtures. For an assembler, a one-byte difference is a behavioural
75
75
  change.
76
76
 
77
+ The chained-instruction feature currently lives in `test/asm80/` because it
78
+ crosses parser, op expansion, D8 map output and case-style linting in one user
79
+ visible source shape. `multi_instruction_lines.test.ts` is the focused
80
+ acceptance suite for that contract.
81
+
77
82
  ## Fixtures and Helpers
78
83
 
79
84
  `test/fixtures/` contains small source programs named after the issue or
@@ -115,11 +120,11 @@ Use this map when choosing a verification lane:
115
120
 
116
121
  | Change | Tests |
117
122
  | --------------------------- | -------------------------------------------------------------------- |
118
- | Parser or expression syntax | `test/unit/syntax/**`, relevant integration tests. |
123
+ | Parser or expression syntax | `test/unit/syntax/**`, relevant integration tests and `test/asm80/multi_instruction_lines.test.ts` when the change affects chained physical lines. |
119
124
  | Source loading or tooling provenance | `test/integration/stage-11-tooling-api.test.ts`, relevant unit tests in `test/unit/source/**`. |
120
125
  | Z80 instruction support | `test/unit/z80/**`, diagnostic matrices, ASM80 parity when relevant. |
121
126
  | Layout semantics | layout integration tests and output tests. |
122
- | Ops | `test/unit/expansion/**`, op integration tests. |
127
+ | Ops | `test/unit/expansion/**`, op integration tests and `test/asm80/multi_instruction_lines.test.ts` for chained bodies and invocation segments. |
123
128
  | Register contracts | register contract unit, integration and CLI tests. |
124
129
  | CLI options | `test/cli/**`. |
125
130
  | Output artifacts | `test/unit/outputs/**`, CLI artifact tests. |
@@ -145,7 +150,8 @@ Ask what kind of fact the change affects:
145
150
  `core/compile.ts`.
146
151
  - Assembler-time facts belong in `assembly/` and `semantics/`.
147
152
  - Instruction forms belong in `z80/`.
148
- - Inline source generation belongs in `expansion/`.
153
+ - Instruction-chain splitting belongs in `source/`, while inline source
154
+ generation and op template expansion belong in `expansion/`.
149
155
  - Routine contracts and liveness belong in `register-contracts/`.
150
156
  - Artifact shape belongs in `outputs/`.
151
157
  - User commands belong in `cli/`.
@@ -172,21 +172,28 @@ you need to find the owner of a behaviour quickly.
172
172
  | `logical-lines.ts` | Splits source text into logical line records. |
173
173
  | `source-span.ts` | Defines source span shape. |
174
174
  | `line-comment-scanner.ts` | Finds semicolon comments while respecting quoted text. |
175
+ | `instruction-chain.ts` | Splits spaced-backslash instruction lines into segments. |
175
176
  | `strip-line-comment.ts` | Removes semicolon comments while respecting quoted text. |
176
177
 
177
178
  ## `src/syntax/`
178
179
 
179
180
  | File | Role |
180
181
  | ------------------------------ | ----------------------------------------------------- |
181
- | `parse-line.ts` | Parses single logical lines into source items. |
182
- | `expression-tokenizer.ts` | Tokenizes expression text. |
183
- | `parse-token-expression.ts` | Parses tokenized expressions into ASTs. |
184
- | `parse-expression.ts` | Public expression parse wrapper. |
185
- | `parse-directive-statement.ts` | Parses directive statements with structured operands. |
186
- | `parse-layout-declarations.ts` | Parses layout declaration forms. |
187
- | `parse-layout-expression.ts` | Parses layout type expressions. |
188
- | `parse-diagnostics.ts` | Shared parse diagnostic helpers. |
189
- | `directive-aliases.ts` | Built-in and project directive alias policy. |
182
+ | `parse-line.ts` | Parses single logical lines into source items. |
183
+ | `expression-tokenizer.ts` | Tokenizes expression text. |
184
+ | `parse-token-expression.ts` | Parses tokenized expressions into ASTs. |
185
+ | `parse-expression.ts` | Public expression parse wrapper. |
186
+ | `names.ts` | Shared identifier, label and entry-label parsing primitives. |
187
+ | `parse-instruction-chain.ts` | Parses spaced-backslash chained instruction segments. |
188
+ | `statement-classification.ts` | Shared chained-line and op-invocation classification helpers. |
189
+ | `parse-directive-statement.ts` | Dispatches directive statements to focused directive parsers. |
190
+ | `parse-data-directives.ts` | Parses `.db`, `.dw`, `.ds`, `.cstr`, `.pstr` and `.istr`. |
191
+ | `parse-declaration-directives.ts` | Parses `.equ`, `.enum` and quoted declaration payloads. |
192
+ | `parse-location-directives.ts` | Parses `.org`, `.align`, `.binfrom` and `.binto`. |
193
+ | `parse-layout-declarations.ts` | Parses layout declaration forms. |
194
+ | `parse-layout-expression.ts` | Parses layout type expressions. |
195
+ | `parse-diagnostics.ts` | Shared parse diagnostic helpers. |
196
+ | `directive-aliases.ts` | Built-in and project directive alias policy. |
190
197
 
191
198
  ## `src/tooling/`
192
199
 
@@ -232,7 +239,7 @@ you need to find the owner of a behaviour quickly.
232
239
  | `test/integration/` | Cross-stage compiler tests. |
233
240
  | `test/integration/register-contracts/` | End-to-end register contract tests. |
234
241
  | `test/cli/` | CLI option, artifact and exit-code contracts. |
235
- | `test/asm80/` | ASM80 compatibility and real-program acceptance. |
242
+ | `test/asm80/` | ASM80 compatibility, real-program acceptance and chained-line behaviour. |
236
243
  | `test/differential/` | Differential comparison fixtures and runners. |
237
244
  | `test/fixtures/` | Source fixture programs. |
238
245
  | `test/helpers/` | Shared test setup and helpers. |
@@ -30,9 +30,10 @@ compile(entryFile, options, deps)
30
30
  parseNextSourceItems()
31
31
  applyConditionalAssembly()
32
32
  collect op definitions
33
+ expand op invocations
34
+ split chained instruction lines
33
35
  tokenize and parse expressions
34
36
  parse layouts, aliases, enums, directives and instructions
35
- expand op invocations
36
37
  analyzeProgramNext()
37
38
  assembleProgram() for symbols
38
39
  lintCaseStyleNext()
@@ -98,6 +99,6 @@ tooling integrations that still use the older name.
98
99
  | Parsing | logical lines | source items |
99
100
  | Analysis | source items | diagnostics, symbols |
100
101
  | Register contracts | loaded program | summaries, conflicts, reports |
101
- | Assembly | source items | byte map, symbols, source segments |
102
+ | Assembly | source items | byte map, symbols, source segments with per-item columns |
102
103
  | Outputs | byte map and symbols | artifacts |
103
104
  | CLI | artifacts | files on disk |
@@ -44,3 +44,7 @@ modules. The directory appendix is the current file map for those modules.
44
44
  - [Appendix A - Directory and File Reference](appendices/a-directory-file-reference.md)
45
45
  - [Appendix B - Compile Flow Reference](appendices/b-compile-flow-reference.md)
46
46
  - [Appendix C - Public Surface Reference](appendices/c-public-surface-reference.md)
47
+
48
+ ## Related References
49
+
50
+ - [AZM Grammar Reference](../reference/azm-grammar.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jhlagado/azm",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "AZM assembler for the Z80 family (Node.js CLI)",
5
5
  "license": "GPL-3.0-only",
6
6
  "engines": {