Stub stuff out. Include markdown discussion
This commit is contained in:
parent
8bca6e1f20
commit
d1491ec5e6
8 changed files with 302 additions and 0 deletions
16
SOURCE_REGION_EXPERIMENTS.md
Normal file
16
SOURCE_REGION_EXPERIMENTS.md
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# Source Region Parser Experiment Notes
|
||||
|
||||
## Current Parser Experiment
|
||||
|
||||
- The parser works directly with `CodePointIndex` and `CodePointSpan`; rich `Span` conversion is intentionally left to rendering or reporting code.
|
||||
- Structured errors are currently enough to identify the failing region and the syntactic fact that failed, without committing to message text.
|
||||
- Empty documents are valid because the document grammar is a sequence of expressions.
|
||||
|
||||
## Source Region Observations
|
||||
|
||||
- `SourceText.getSpan(CodePointSpan)` is the key boundary operation: parsers can stay low-level, while diagnostics can opt into line and column information later.
|
||||
- Zero-width EOF spans are important for parse errors such as an unclosed list. The existing `eofSpan` support fits this well.
|
||||
- Parser clients still need a few tiny local span helpers, such as current-code-point span and EOF cursor span.
|
||||
- `renderSpan` returning structured `LineView` data works well for UI rendering because the application can choose its own DOM and styling without reimplementing line slicing.
|
||||
|
||||
## Potential Nice-To-Haves
|
||||
Loading…
Add table
Add a link
Reference in a new issue