@blockml/parser 0.3.0 → 0.5.0
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/blocks/org/blockml/bml/compiler/parser/Library.bml +2 -1
- package/blocks/org/blockml/bml/compiler/parser/capability/CreateMapContext.bml +1 -1
- package/blocks/org/blockml/bml/compiler/parser/capability/ParseXmlDom.bml +3 -0
- package/blocks/org/blockml/bml/compiler/parser/config/MapTimeDiagnosticCodes.bml +1 -1
- package/blocks/org/blockml/bml/compiler/parser/documentation/AttributeClassification.bml +4 -4
- package/blocks/org/blockml/bml/compiler/parser/documentation/DesignDecisions.bml +1 -1
- package/blocks/org/blockml/bml/compiler/parser/documentation/Diagnostics.bml +7 -0
- package/blocks/org/blockml/bml/compiler/parser/documentation/PublicApi.bml +3 -1
- package/blocks/org/blockml/bml/compiler/parser/documentation/StructuralGrammar.bml +60 -0
- package/blocks/org/blockml/bml/compiler/parser/documentation/TypeDescriptorParsing.bml +2 -1
- package/blocks/org/blockml/bml/compiler/parser/documentation/V1Scope.bml +1 -1
- package/blocks/org/blockml/bml/compiler/parser/map/MapContext.bml +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/map/context.d.ts +3 -0
- package/dist/map/context.d.ts.map +1 -1
- package/dist/map/context.js +1 -0
- package/dist/map/context.js.map +1 -1
- package/dist/map/directives.d.ts +2 -1
- package/dist/map/directives.d.ts.map +1 -1
- package/dist/map/directives.js +5 -1
- package/dist/map/directives.js.map +1 -1
- package/dist/map/map-block.d.ts +2 -2
- package/dist/map/map-block.d.ts.map +1 -1
- package/dist/map/map-block.js +114 -81
- package/dist/map/map-block.js.map +1 -1
- package/dist/map/map-composition.d.ts.map +1 -1
- package/dist/map/map-composition.js +14 -17
- package/dist/map/map-composition.js.map +1 -1
- package/dist/map/structural.d.ts +17 -0
- package/dist/map/structural.d.ts.map +1 -0
- package/dist/map/structural.js +249 -0
- package/dist/map/structural.js.map +1 -0
- package/dist/map/type-expression.d.ts +5 -1
- package/dist/map/type-expression.d.ts.map +1 -1
- package/dist/map/type-expression.js +99 -34
- package/dist/map/type-expression.js.map +1 -1
- package/dist/parse.d.ts.map +1 -1
- package/dist/parse.js +36 -14
- package/dist/parse.js.map +1 -1
- package/dist/pipeline/xml-dom.d.ts +10 -1
- package/dist/pipeline/xml-dom.d.ts.map +1 -1
- package/dist/pipeline/xml-dom.js +55 -3
- package/dist/pipeline/xml-dom.js.map +1 -1
- package/dist/util/mapping-error.d.ts +17 -0
- package/dist/util/mapping-error.d.ts.map +1 -0
- package/dist/util/mapping-error.js +110 -0
- package/dist/util/mapping-error.js.map +1 -0
- package/dist/util/qname.d.ts +14 -0
- package/dist/util/qname.d.ts.map +1 -1
- package/dist/util/qname.js +64 -2
- package/dist/util/qname.js.map +1 -1
- package/package.json +3 -3
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
(@blockml/bom). Membership is defined exclusively by this blocks list.
|
|
39
39
|
</documentation>
|
|
40
40
|
|
|
41
|
-
<version>0.
|
|
41
|
+
<version>0.5.0</version>
|
|
42
42
|
|
|
43
43
|
<language>
|
|
44
44
|
<English />
|
|
@@ -126,6 +126,7 @@
|
|
|
126
126
|
<composition><pardocumentation:MappingPrinciples /></composition>
|
|
127
127
|
<composition><pardocumentation:MemberMappingOrder /></composition>
|
|
128
128
|
<composition><pardocumentation:AttributeClassification /></composition>
|
|
129
|
+
<composition><pardocumentation:StructuralGrammar /></composition>
|
|
129
130
|
<composition><pardocumentation:XmlCommentsParse /></composition>
|
|
130
131
|
<composition><pardocumentation:TypeDescriptorParsing /></composition>
|
|
131
132
|
<composition><pardocumentation:BlockMetadataMapping /></composition>
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
<documentation>bindings. TS type: type:Text. (required)</documentation>
|
|
47
47
|
</bindings>
|
|
48
48
|
<options type="core:Any">
|
|
49
|
-
<documentation>subBlockIndex, parentBlockType, isRoot, isEmbedded. (optional)</documentation>
|
|
49
|
+
<documentation>subBlockIndex, parentBlockType, isRoot, isEmbedded, diagnostics. (optional)</documentation>
|
|
50
50
|
</options>
|
|
51
51
|
<context type="parmap:MapContext">
|
|
52
52
|
<documentation>context. TS type: parmap:MapContext. (required)</documentation>
|
|
@@ -39,6 +39,9 @@
|
|
|
39
39
|
<source type="type:Text">
|
|
40
40
|
<documentation>source. TS type: type:Text. (required)</documentation>
|
|
41
41
|
</source>
|
|
42
|
+
<filePath type="type:Text">
|
|
43
|
+
<documentation>filePath. TS type: type:Text. (optional) Used in XML diagnostics instead of xmldom @#.</documentation>
|
|
44
|
+
</filePath>
|
|
42
45
|
<document type="core:Any">
|
|
43
46
|
<documentation>DOM Document (required)</documentation>
|
|
44
47
|
</document>
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
<properties>
|
|
35
35
|
<codes type="type:Text[]">
|
|
36
|
-
<documentation>Ordered: BML_UNSUPPORTED_FORMAT, BML_MALFORMED_XML, BML_MISSING_ROOT, BML_INVALID_ROOT, BML_MAP_ERROR, BML_UNKNOWN_NAMESPACE_PREFIX, BML_UNQUALIFIED_BLOCK_REFERENCE, BML_UNKNOWN_TYPE (required)</documentation>
|
|
36
|
+
<documentation>Ordered: BML_UNSUPPORTED_FORMAT, BML_MALFORMED_XML, BML_MISSING_ROOT, BML_INVALID_ROOT, BML_MAP_ERROR, BML_UNKNOWN_NAMESPACE_PREFIX, BML_UNQUALIFIED_BLOCK_REFERENCE, BML_UNKNOWN_TYPE, BML_INVALID_TYPE_REFERENCE, BML_UNKNOWN_ELEMENT, BML_UNKNOWN_ATTRIBUTE, BML_UNKNOWN_DIRECTIVE (required)</documentation>
|
|
37
37
|
</codes>
|
|
38
38
|
</properties>
|
|
39
39
|
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
• Directives (bml:each, bml:if, …) → directives[]
|
|
43
43
|
• Unknown bml:* → BML_UNKNOWN_DIRECTIVE (error at map time — B2)
|
|
44
44
|
|
|
45
|
-
Rule 3 —
|
|
46
|
-
•
|
|
47
|
-
• ${ expr } → ExpressionValue { raw } (B4)
|
|
45
|
+
Rule 3 — Grammar vs instance:
|
|
46
|
+
• On definition/grammar nodes, remaining attributes are closed. Unknown → BML_UNKNOWN_ATTRIBUTE (structural error); preserved as unknownAttributes.
|
|
47
|
+
• On block instances, remaining attributes → memberValues[name] (camelCase); ${ expr } → ExpressionValue { raw } (B4). Unknown members are a validator error.
|
|
48
48
|
|
|
49
49
|
Serialize side of Rule 1 (B25 re-emit) → @blockml/serializer.</documentation>
|
|
50
50
|
|
|
51
51
|
<references>
|
|
52
|
-
<see type="pardocumentation:
|
|
52
|
+
<see type="pardocumentation:StructuralGrammar" relation="ReadNext"></see>
|
|
53
53
|
<see type="parcap:ParseDirectives" relation="SeeAlso"></see>
|
|
54
54
|
</references>
|
|
55
55
|
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<baseType>core:Documentation</baseType>
|
|
31
31
|
<is>Normative parser design decisions</is>
|
|
32
32
|
|
|
33
|
-
<documentation>B2: unknown bml:* → error at map; unknown
|
|
33
|
+
<documentation>B2: unknown bml:* → error at map (BML_UNKNOWN_DIRECTIVE); unknown instance members → validator error (BML_UNKNOWN_PROPERTY).
|
|
34
34
|
B3: inputType/outputType → TypeExpression at map time.
|
|
35
35
|
B4: ExpressionValue.raw only; AST via core utility.
|
|
36
36
|
B5: single-file parser scope.
|
|
@@ -40,6 +40,13 @@
|
|
|
40
40
|
Map-time codes (mapper modules):
|
|
41
41
|
• BML_UNKNOWN_NAMESPACE_PREFIX, BML_UNQUALIFIED_BLOCK_REFERENCE
|
|
42
42
|
• BML_UNKNOWN_TYPE — type expression parse failure
|
|
43
|
+
• BML_INVALID_TYPE_REFERENCE — ill-formed type expression (ungrouped stacked multiplicity)
|
|
44
|
+
• BML_UNKNOWN_ELEMENT — child not in closed Block grammar (structural)
|
|
45
|
+
• BML_UNKNOWN_ATTRIBUTE — attribute not allowed on a grammar node (structural)
|
|
46
|
+
• BML_UNKNOWN_DIRECTIVE — unknown bml:* attribute (B2)
|
|
47
|
+
|
|
48
|
+
Map-time diagnostics attach Diagnostic.source to the use-site token when known
|
|
49
|
+
(attribute value or first occurrence in the throwing element), not the document root.
|
|
43
50
|
|
|
44
51
|
Host policy: whether to abort after diagnostics is orchestrator decision.
|
|
45
52
|
Diagnostic type: org.blockml.bml.bom.common.Diagnostic.</documentation>
|
|
@@ -44,7 +44,9 @@
|
|
|
44
44
|
Behaviour:
|
|
45
45
|
• B24 detect → [2] xmldom → [3]–[5] map
|
|
46
46
|
• Hard fail → document: null (unsupported format, missing root, invalid root)
|
|
47
|
-
• Mapping errors →
|
|
47
|
+
• Mapping errors → inner BML_* code with use-site Diagnostic.source when MappingError
|
|
48
|
+
carries a span; otherwise BML_MAP_ERROR at 1:1. continueOnError still returns
|
|
49
|
+
document when possible
|
|
48
50
|
• Sync only; no throw on recoverable errors
|
|
49
51
|
• Does NOT call validator; does NOT expand directives</documentation>
|
|
50
52
|
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Parser Documentation — StructuralGrammar
|
|
3
|
+
FQN: org.blockml.bml.compiler.parser.documentation.StructuralGrammar
|
|
4
|
+
-->
|
|
5
|
+
<block
|
|
6
|
+
xmlns="http://blockml.org/bml"
|
|
7
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
8
|
+
xsi:schemaLocation="http://blockml.org/bml https://blockml.org/schemas/bml.xsd
|
|
9
|
+
"
|
|
10
|
+
xmlns:blockml="org.blockml.bml"
|
|
11
|
+
xmlns:bom="org.blockml.bml.bom"
|
|
12
|
+
xmlns:bomapi="org.blockml.bml.bom.api"
|
|
13
|
+
xmlns:bomblock="org.blockml.bml.bom.block"
|
|
14
|
+
xmlns:bomcommon="org.blockml.bml.bom.common"
|
|
15
|
+
xmlns:bomcomp="org.blockml.bml.bom.composition"
|
|
16
|
+
xmlns:bomdoc="org.blockml.bml.bom.document"
|
|
17
|
+
xmlns:bomtype="org.blockml.bml.bom.type"
|
|
18
|
+
xmlns:core="org.blockml.bml.core"
|
|
19
|
+
xmlns:def="org.blockml.bml.definition"
|
|
20
|
+
xmlns:parser="org.blockml.bml.compiler.parser"
|
|
21
|
+
xmlns:parcap="org.blockml.bml.compiler.parser.capability"
|
|
22
|
+
xmlns:parconfig="org.blockml.bml.compiler.parser.config"
|
|
23
|
+
xmlns:pardocumentation="org.blockml.bml.compiler.parser.documentation"
|
|
24
|
+
xmlns:parmap="org.blockml.bml.compiler.parser.map"
|
|
25
|
+
xmlns:type="org.blockml.bml.type"
|
|
26
|
+
xmlns:doc="org.blockml.bml.documentation"
|
|
27
|
+
xmlns:valdocumentation="org.blockml.bml.compiler.validator.documentation">
|
|
28
|
+
|
|
29
|
+
<name>StructuralGrammar</name>
|
|
30
|
+
<type>pardocumentation:StructuralGrammar</type>
|
|
31
|
+
<baseType>core:Documentation</baseType>
|
|
32
|
+
<is>Closed root vocabulary and preserve-on-error for structural BML errors</is>
|
|
33
|
+
|
|
34
|
+
<documentation>A document is valid BlockML if it is well-formed XML, structurally conforms
|
|
35
|
+
to the BlockML definitions, and passes semantic validation against a complete registry.
|
|
36
|
+
XSD is not part of this definition.
|
|
37
|
+
|
|
38
|
+
Error classes: XML Syntax Error (malformed XML; document may be null);
|
|
39
|
+
Structural BML Error (unknown Gerüst tag/attribute/directive — this package);
|
|
40
|
+
Semantic BML Error (unknown type/member/library — @blockml/validator).
|
|
41
|
+
|
|
42
|
+
Root children are closed: only identity and container names from the effective
|
|
43
|
+
Block / document grammar (name, type, baseType, properties, aggregations, …).
|
|
44
|
+
Direct aggregations at root are not allowed. User content lives only inside
|
|
45
|
+
predefined containers and members.
|
|
46
|
+
|
|
47
|
+
Preserve-on-error: invalid authored constructs that can be represented are stored
|
|
48
|
+
as unknownElements / unknownAttributes residuals. Diagnostics MUST NOT require
|
|
49
|
+
destructive recovery. An error invalidates validity, not the whole BOM.
|
|
50
|
+
|
|
51
|
+
Definition/grammar nodes: unknown children/attributes → BML_UNKNOWN_ELEMENT /
|
|
52
|
+
BML_UNKNOWN_ATTRIBUTE. Unknown bml:* → BML_UNKNOWN_DIRECTIVE.
|
|
53
|
+
Block instances: extra attributes stay in memberValues for semantic checking.</documentation>
|
|
54
|
+
|
|
55
|
+
<references>
|
|
56
|
+
<see type="pardocumentation:AttributeClassification" relation="SeeAlso"></see>
|
|
57
|
+
<see type="valdocumentation:ValidityContract" relation="SeeAlso"></see>
|
|
58
|
+
</references>
|
|
59
|
+
|
|
60
|
+
</block>
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
<documentation>Parse type attribute strings into BOM TypeExpression shapes (defined in @blockml/bom).
|
|
34
34
|
|
|
35
35
|
• Named type refs → resolved FQN via namespace bindings + implicit namespaces
|
|
36
|
-
• Union (A | B), struct ({ a: T }), multiplicity, generics, self refs
|
|
36
|
+
• Union (A | B), struct ({ a: T }), multiplicity, nested (T[])[], generics (including unions as arguments), self refs
|
|
37
|
+
• Ungrouped stacked multiplicity Integer[][] → BML_INVALID_TYPE_REFERENCE
|
|
37
38
|
• Boolean.True/Boolean.False preserved as type refs (B16) — not rewritten to literals
|
|
38
39
|
• Boolean values normalized to lowercase (B15)
|
|
39
40
|
• Failure → BML_UNKNOWN_TYPE
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<documentation>V1 (Phase A) parser implements:
|
|
34
34
|
• Hardcoded BML → BOM mapper for <block> root documents
|
|
35
35
|
• Single-file scope (B5) — no TypeRegistry bootstrap in parse()
|
|
36
|
-
• Stage 1
|
|
36
|
+
• Stage 1 structural BML validation (unknown Gerüst tags/attributes/directives); no TypeRegistry semantic checks (B8: XSD not Stage 1)
|
|
37
37
|
• JSON BML authoring not planned (B6)
|
|
38
38
|
• Tolerant parse by default (continueOnError: true)
|
|
39
39
|
|
|
@@ -53,6 +53,9 @@
|
|
|
53
53
|
<isEmbedded type="type:Boolean">
|
|
54
54
|
<documentation>isEmbedded. TS type: type:Boolean. (required)</documentation>
|
|
55
55
|
</isEmbedded>
|
|
56
|
+
<diagnostics type="bomcommon:Diagnostic[]">
|
|
57
|
+
<documentation>Shared map-time diagnostics; structural errors append here without aborting. (required)</documentation>
|
|
58
|
+
</diagnostics>
|
|
56
59
|
</properties>
|
|
57
60
|
|
|
58
61
|
</block>
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,KAAK,wBAAwB,GAC9B,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EACL,kBAAkB,EAClB,eAAe,GAEhB,MAAM,iBAAiB,CAAC"}
|
package/dist/map/context.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Diagnostic } from "@blockml/bom";
|
|
1
2
|
export interface MapContext {
|
|
2
3
|
filePath: string;
|
|
3
4
|
source: string;
|
|
@@ -6,11 +7,13 @@ export interface MapContext {
|
|
|
6
7
|
parentBlockType?: string;
|
|
7
8
|
isRoot: boolean;
|
|
8
9
|
isEmbedded: boolean;
|
|
10
|
+
diagnostics: Diagnostic[];
|
|
9
11
|
}
|
|
10
12
|
export declare function createMapContext(filePath: string, source: string, bindings: Record<string, string>, options?: {
|
|
11
13
|
subBlockIndex?: Map<string, string>;
|
|
12
14
|
parentBlockType?: string;
|
|
13
15
|
isRoot?: boolean;
|
|
14
16
|
isEmbedded?: boolean;
|
|
17
|
+
diagnostics?: Diagnostic[];
|
|
15
18
|
}): MapContext;
|
|
16
19
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/map/context.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/map/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B;AAED,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,OAAO,GAAE;IACP,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;CACvB,GACL,UAAU,CAcZ"}
|
package/dist/map/context.js
CHANGED
|
@@ -6,6 +6,7 @@ export function createMapContext(filePath, source, bindings, options = {}) {
|
|
|
6
6
|
subBlockIndex: options.subBlockIndex ?? new Map(),
|
|
7
7
|
isRoot: options.isRoot ?? false,
|
|
8
8
|
isEmbedded: options.isEmbedded ?? false,
|
|
9
|
+
diagnostics: options.diagnostics ?? [],
|
|
9
10
|
};
|
|
10
11
|
if (options.parentBlockType !== undefined) {
|
|
11
12
|
ctx.parentBlockType = options.parentBlockType;
|
package/dist/map/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/map/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/map/context.ts"],"names":[],"mappings":"AAaA,MAAM,UAAU,gBAAgB,CAC9B,QAAgB,EAChB,MAAc,EACd,QAAgC,EAChC,UAMI,EAAE;IAEN,MAAM,GAAG,GAAe;QACtB,QAAQ;QACR,MAAM;QACN,QAAQ;QACR,aAAa,EAAE,OAAO,CAAC,aAAa,IAAI,IAAI,GAAG,EAAE;QACjD,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,KAAK;QAC/B,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,KAAK;QACvC,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,EAAE;KACvC,CAAC;IACF,IAAI,OAAO,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;QAC1C,GAAG,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAChD,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/map/directives.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { DirectiveAttribute, ExpressionValue } from "@blockml/bom";
|
|
2
2
|
import type { Element } from "@xmldom/xmldom";
|
|
3
3
|
import type { SourceLocation } from "@blockml/bom";
|
|
4
|
-
|
|
4
|
+
import type { MapContext } from "./context.js";
|
|
5
|
+
export declare function parseDirectives(element: Element, loc: SourceLocation, ctx?: MapContext): DirectiveAttribute[];
|
|
5
6
|
export declare function parseBmlMeta(element: Element, typeFqn: string, file: string, loc: SourceLocation): {
|
|
6
7
|
id: ExpressionValue | {
|
|
7
8
|
kind: "literal";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directives.d.ts","sourceRoot":"","sources":["../../src/map/directives.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAElB,eAAe,EAKhB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"directives.d.ts","sourceRoot":"","sources":["../../src/map/directives.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAElB,eAAe,EAKhB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAY/C,wBAAgB,eAAe,CAC7B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,cAAc,EACnB,GAAG,CAAC,EAAE,UAAU,GACf,kBAAkB,EAAE,CAgEtB;AAED,wBAAgB,YAAY,CAC1B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,cAAc;;;;;;;;;;;;;;;;;EAiBpB"}
|
package/dist/map/directives.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { expressionFromRaw } from "./member-value.js";
|
|
2
2
|
import { getAttribute } from "../util/xml.js";
|
|
3
|
+
import { collectUnknownBmlAttributes } from "./structural.js";
|
|
3
4
|
const BML_NS = "http://blockml.org/bml";
|
|
4
5
|
function bmlAttr(element, local) {
|
|
5
6
|
return (getAttribute(element, `bml:${local}`) ??
|
|
6
7
|
getAttribute(element, `${BML_NS}:${local}`));
|
|
7
8
|
}
|
|
8
|
-
export function parseDirectives(element, loc) {
|
|
9
|
+
export function parseDirectives(element, loc, ctx) {
|
|
9
10
|
const directives = [];
|
|
11
|
+
if (ctx) {
|
|
12
|
+
collectUnknownBmlAttributes(element, ctx);
|
|
13
|
+
}
|
|
10
14
|
const each = bmlAttr(element, "each");
|
|
11
15
|
if (each !== undefined) {
|
|
12
16
|
const colon = each.indexOf(":");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directives.js","sourceRoot":"","sources":["../../src/map/directives.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,MAAM,MAAM,GAAG,wBAAwB,CAAC;AAExC,SAAS,OAAO,CAAC,OAAgB,EAAE,KAAa;IAC9C,OAAO,CACL,YAAY,CAAC,OAAO,EAAE,OAAO,KAAK,EAAE,CAAC;QACrC,YAAY,CAAC,OAAO,EAAE,GAAG,MAAM,IAAI,KAAK,EAAE,CAAC,CAC5C,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,OAAgB,EAChB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AAC,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;QAC3E,KAAK;KACN,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CACrB,GAAW,EACX,OAAe,EACf,IAAY,EACZ,GAAmB;IAEnB,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9C,OAAO,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACrC,CAAC;IACD,OAAO;QACL,IAAI,EAAE,SAAkB;QACxB,KAAK,EAAE,GAAG;QACV,OAAO;KACR,CAAC;AACJ,CAAC"}
|
package/dist/map/map-block.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { BlockDefinition } from "@blockml/bom";
|
|
1
|
+
import type { BlockDefinition, Diagnostic } from "@blockml/bom";
|
|
2
2
|
import type { Element } from "@xmldom/xmldom";
|
|
3
3
|
import { type MapContext } from "./context.js";
|
|
4
4
|
export declare function mapBlock(element: Element, ctx: MapContext): BlockDefinition;
|
|
5
|
-
export declare function mapDocumentBlock(element: Element, filePath: string, source: string, bindings: Record<string, string
|
|
5
|
+
export declare function mapDocumentBlock(element: Element, filePath: string, source: string, bindings: Record<string, string>, diagnostics?: Diagnostic[]): BlockDefinition;
|
|
6
6
|
//# sourceMappingURL=map-block.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-block.d.ts","sourceRoot":"","sources":["../../src/map/map-block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIV,eAAe,
|
|
1
|
+
{"version":3,"file":"map-block.d.ts","sourceRoot":"","sources":["../../src/map/map-block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIV,eAAe,EAKf,UAAU,EAiBX,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AA6hCjE,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,GAAG,eAAe,CAE3E;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,WAAW,GAAE,UAAU,EAAO,GAC7B,eAAe,CAGjB"}
|