@aftertext/compiler 0.0.0-stage → 0.1.1
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.
- package/LICENSE +21 -0
- package/README.md +68 -2
- package/dist/ast/expression.d.ts +55 -0
- package/dist/ast/expression.d.ts.map +1 -0
- package/dist/ast/expression.js +2 -0
- package/dist/ast/expression.js.map +1 -0
- package/dist/ast/index.d.ts +6 -0
- package/dist/ast/index.d.ts.map +1 -0
- package/dist/ast/index.js +2 -0
- package/dist/ast/index.js.map +1 -0
- package/dist/ast/inline.d.ts +39 -0
- package/dist/ast/inline.d.ts.map +1 -0
- package/dist/ast/inline.js +2 -0
- package/dist/ast/inline.js.map +1 -0
- package/dist/ast/presentation.d.ts +41 -0
- package/dist/ast/presentation.d.ts.map +1 -0
- package/dist/ast/presentation.js +8 -0
- package/dist/ast/presentation.js.map +1 -0
- package/dist/ast/span.d.ts +19 -0
- package/dist/ast/span.d.ts.map +1 -0
- package/dist/ast/span.js +2 -0
- package/dist/ast/span.js.map +1 -0
- package/dist/ast/story.d.ts +354 -0
- package/dist/ast/story.d.ts.map +1 -0
- package/dist/ast/story.js +2 -0
- package/dist/ast/story.js.map +1 -0
- package/dist/compile.d.ts +25 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +19 -0
- package/dist/compile.js.map +1 -0
- package/dist/diagnostics/codes.d.ts +26 -0
- package/dist/diagnostics/codes.d.ts.map +1 -0
- package/dist/diagnostics/codes.js +69 -0
- package/dist/diagnostics/codes.js.map +1 -0
- package/dist/diagnostics/index.d.ts +3 -0
- package/dist/diagnostics/index.d.ts.map +1 -0
- package/dist/diagnostics/index.js +2 -0
- package/dist/diagnostics/index.js.map +1 -0
- package/dist/diagnostics/types.d.ts +19 -0
- package/dist/diagnostics/types.d.ts.map +1 -0
- package/dist/diagnostics/types.js +2 -0
- package/dist/diagnostics/types.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/parser/blocks.d.ts +40 -0
- package/dist/parser/blocks.d.ts.map +1 -0
- package/dist/parser/blocks.js +927 -0
- package/dist/parser/blocks.js.map +1 -0
- package/dist/parser/directive-line.d.ts +21 -0
- package/dist/parser/directive-line.d.ts.map +1 -0
- package/dist/parser/directive-line.js +50 -0
- package/dist/parser/directive-line.js.map +1 -0
- package/dist/parser/document.d.ts +13 -0
- package/dist/parser/document.d.ts.map +1 -0
- package/dist/parser/document.js +28 -0
- package/dist/parser/document.js.map +1 -0
- package/dist/parser/expression-lexer.d.ts +44 -0
- package/dist/parser/expression-lexer.d.ts.map +1 -0
- package/dist/parser/expression-lexer.js +166 -0
- package/dist/parser/expression-lexer.js.map +1 -0
- package/dist/parser/expression-parser.d.ts +13 -0
- package/dist/parser/expression-parser.d.ts.map +1 -0
- package/dist/parser/expression-parser.js +201 -0
- package/dist/parser/expression-parser.js.map +1 -0
- package/dist/parser/frontmatter.d.ts +23 -0
- package/dist/parser/frontmatter.d.ts.map +1 -0
- package/dist/parser/frontmatter.js +158 -0
- package/dist/parser/frontmatter.js.map +1 -0
- package/dist/parser/index.d.ts +2 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/parser/index.js +2 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/parser/lexical-primitives.d.ts +38 -0
- package/dist/parser/lexical-primitives.d.ts.map +1 -0
- package/dist/parser/lexical-primitives.js +46 -0
- package/dist/parser/lexical-primitives.js.map +1 -0
- package/dist/parser/lines.d.ts +32 -0
- package/dist/parser/lines.d.ts.map +1 -0
- package/dist/parser/lines.js +60 -0
- package/dist/parser/lines.js.map +1 -0
- package/dist/parser/markdown.d.ts +19 -0
- package/dist/parser/markdown.d.ts.map +1 -0
- package/dist/parser/markdown.js +221 -0
- package/dist/parser/markdown.js.map +1 -0
- package/dist/parser/serializer-safety.d.ts +57 -0
- package/dist/parser/serializer-safety.d.ts.map +1 -0
- package/dist/parser/serializer-safety.js +66 -0
- package/dist/parser/serializer-safety.js.map +1 -0
- package/dist/validation/index.d.ts +2 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +2 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/validate.d.ts +4 -0
- package/dist/validation/validate.d.ts.map +1 -0
- package/dist/validation/validate.js +221 -0
- package/dist/validation/validate.js.map +1 -0
- package/package.json +43 -4
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { SceneNode, StoryBlock } from "../ast/story.js";
|
|
2
|
+
import type { Diagnostic } from "../diagnostics/types.js";
|
|
3
|
+
import { type SourceLine } from "./lines.js";
|
|
4
|
+
interface BlockSequenceResult {
|
|
5
|
+
readonly blocks: StoryBlock[];
|
|
6
|
+
readonly nextIndex: number;
|
|
7
|
+
/** Directive name that stopped the sequence (a terminator, or "scene"), or null at EOF. */
|
|
8
|
+
readonly stoppedBy: string | null;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Parses a run of lines into StoryBlocks until either a directive in
|
|
12
|
+
* `terminators` is reached, a `@scene` line is reached (scenes always
|
|
13
|
+
* bound any enclosing construct), or the input is exhausted.
|
|
14
|
+
*
|
|
15
|
+
* This single function drives every nesting level (scene bodies,
|
|
16
|
+
* conditional/variant branch bodies) — nesting falls out of recursive
|
|
17
|
+
* calls to parseConditional/parseVariant/parseChoice below.
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseBlockSequence(lines: readonly SourceLine[], start: number, diagnostics: Diagnostic[], terminators: ReadonlySet<string>): BlockSequenceResult;
|
|
20
|
+
/**
|
|
21
|
+
* The deterministic id used for content appearing before the first explicit
|
|
22
|
+
* `@scene` directive — including an entire `@scene`-less prose-only
|
|
23
|
+
* document, where it becomes the only scene. If the author also declares
|
|
24
|
+
* an explicit `@scene main`, that is treated like any other id collision:
|
|
25
|
+
* the existing duplicate-scene validation (AT1003) reports it rather than
|
|
26
|
+
* silently producing two scenes that share an id.
|
|
27
|
+
*/
|
|
28
|
+
export declare const SYNTHETIC_LEADING_SCENE_ID = "main";
|
|
29
|
+
/**
|
|
30
|
+
* Splits the story body into scenes. Content appearing before the first
|
|
31
|
+
* `@scene` directive is collected into a leading scene with id
|
|
32
|
+
* `SYNTHETIC_LEADING_SCENE_ID` ("main"). A document with no leading
|
|
33
|
+
* content and no explicit `@scene` at all — including a completely empty
|
|
34
|
+
* source — still gets an (empty) synthetic main scene, so `StoryDocument`
|
|
35
|
+
* always contains at least one scene and `entryScene` always resolves to
|
|
36
|
+
* a real one.
|
|
37
|
+
*/
|
|
38
|
+
export declare function parseScenes(lines: readonly SourceLine[], diagnostics: Diagnostic[]): SceneNode[];
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=blocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../src/parser/blocks.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAQV,SAAS,EAET,UAAU,EAGX,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAQ1D,OAAO,EAAgD,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAgB3F,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,2FAA2F;IAC3F,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAi3BD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,SAAS,UAAU,EAAE,EAC5B,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,UAAU,EAAE,EACzB,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,GAC/B,mBAAmB,CAoHrB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,SAAS,CAAC;AAwBjD;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,SAAS,EAAE,CA8ChG"}
|