@fluixi/template-parser 0.1.0-alpha.4 → 1.0.0-alpha.100

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.
@@ -0,0 +1,27 @@
1
+ /**
2
+ * The structural layer: recursive-descent parser over the {@link Reader},
3
+ * producing a located {@link RootNode} plus recovered diagnostics.
4
+ *
5
+ * It stays close to the proven single-pass scanner it replaces (so lowering can
6
+ * stay byte-identical) but with three differences that make it a real
7
+ * foundation: every node carries a span, malformed input is recovered from
8
+ * (never throws, never stalls), and attribute semantics are delegated to the
9
+ * directive registry so new syntax doesn't touch this file.
10
+ */
11
+ import { type ParseResult } from './ast.cjs';
12
+ import { Reader } from './reader.cjs';
13
+ import { type DirectiveDescriptor } from './directives.cjs';
14
+ export interface ParserOptions {
15
+ /** `svg\`\`` root: the whole subtree lives in the SVG namespace. */
16
+ svg?: boolean;
17
+ /** Override/extend the directive set (downstream tools prepend their own). */
18
+ directives?: DirectiveDescriptor[];
19
+ /**
20
+ * Report accessibility warnings. On by default: a barrier you aren't told about
21
+ * is one you ship. Set `false` where diagnostics aren't wanted at all, the
22
+ * compiler's own lowering path, for instance.
23
+ */
24
+ accessibility?: boolean;
25
+ }
26
+ /** Parse a piece list into a Template AST. Never throws; recovers + reports. */
27
+ export declare function parseTemplate(pieces: ConstructorParameters<typeof Reader>[0], opts?: ParserOptions): ParseResult;
package/dist/parser.d.ts CHANGED
@@ -12,13 +12,13 @@ import { type ParseResult } from './ast.js';
12
12
  import { Reader } from './reader.js';
13
13
  import { type DirectiveDescriptor } from './directives.js';
14
14
  export interface ParserOptions {
15
- /** `svg\`\`` root — the whole subtree lives in the SVG namespace. */
15
+ /** `svg\`\`` root: the whole subtree lives in the SVG namespace. */
16
16
  svg?: boolean;
17
17
  /** Override/extend the directive set (downstream tools prepend their own). */
18
18
  directives?: DirectiveDescriptor[];
19
19
  /**
20
20
  * Report accessibility warnings. On by default: a barrier you aren't told about
21
- * is one you ship. Set `false` where diagnostics aren't wanted at all — the
21
+ * is one you ship. Set `false` where diagnostics aren't wanted at all, the
22
22
  * compiler's own lowering path, for instance.
23
23
  */
24
24
  accessibility?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAYL,KAAK,WAAW,EAQjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAEL,KAAK,mBAAmB,EAGzB,MAAM,iBAAiB,CAAC;AAMzB,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,8EAA8E;IAC9E,UAAU,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACnC;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AA2ZD,gFAAgF;AAChF,wBAAgB,aAAa,CAC3B,MAAM,EAAE,qBAAqB,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,EAC/C,IAAI,GAAE,aAAkB,GACvB,WAAW,CAEb"}
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAYL,KAAK,WAAW,EAQjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAEL,KAAK,mBAAmB,EAGzB,MAAM,iBAAiB,CAAC;AAMzB,MAAM,WAAW,aAAa;IAC5B,oEAAoE;IACpE,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,8EAA8E;IAC9E,UAAU,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACnC;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AA2ZD,gFAAgF;AAChF,wBAAgB,aAAa,CAC3B,MAAM,EAAE,qBAAqB,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,EAC/C,IAAI,GAAE,aAAkB,GACvB,WAAW,CAEb"}
package/dist/parser.js CHANGED
Binary file