@blockml/parser 0.9.3 → 0.9.5
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 +19 -26
- package/blocks/org/blockml/bml/compiler/parser/ParserType.bml +16 -20
- package/blocks/org/blockml/bml/compiler/parser/README.bml +14 -21
- package/blocks/org/blockml/bml/compiler/parser/capability/AssertBlockRoot.bml +23 -21
- package/blocks/org/blockml/bml/compiler/parser/capability/BuildSubBlockIndex.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/capability/CollectLeadingComments.bml +22 -22
- package/blocks/org/blockml/bml/compiler/parser/capability/CollectTrailingComments.bml +22 -22
- package/blocks/org/blockml/bml/compiler/parser/capability/ContainsUnescapedInterpolation.bml +26 -21
- package/blocks/org/blockml/bml/compiler/parser/capability/CreateMapContext.bml +28 -24
- package/blocks/org/blockml/bml/compiler/parser/capability/DetectFormat.bml +19 -21
- package/blocks/org/blockml/bml/compiler/parser/capability/DocumentElement.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/capability/ElementChildren.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/capability/ElementLocalName.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/capability/ElementPrefix.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/capability/ElementSourceLoc.bml +25 -22
- package/blocks/org/blockml/bml/compiler/parser/capability/ElementStartTagIsSelfClosing.bml +23 -22
- package/blocks/org/blockml/bml/compiler/parser/capability/ExpressionFromRaw.bml +22 -21
- package/blocks/org/blockml/bml/compiler/parser/capability/ExtractNamespaceBindings.bml +20 -21
- package/blocks/org/blockml/bml/compiler/parser/capability/FqnToQName.bml +22 -21
- package/blocks/org/blockml/bml/compiler/parser/capability/GetAttribute.bml +22 -21
- package/blocks/org/blockml/bml/compiler/parser/capability/GetCharacterData.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/capability/GetParseErrors.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/capability/HasBmlSemanticQNameBindings.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/capability/InferCardinality.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/capability/IsBooleanLiteral.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/capability/IsCData.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/capability/IsComment.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/capability/IsDocumentRootLocalName.bml +57 -0
- package/blocks/org/blockml/bml/compiler/parser/capability/IsElement.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/capability/IsTextNode.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/capability/IsTypeReferenceEntitySugar.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/capability/MapBlock.bml +22 -22
- package/blocks/org/blockml/bml/compiler/parser/capability/MapBlockInstanceNode.bml +22 -21
- package/blocks/org/blockml/bml/compiler/parser/capability/MapCompositionTemplate.bml +22 -21
- package/blocks/org/blockml/bml/compiler/parser/capability/MapDocumentBlock.bml +25 -23
- package/blocks/org/blockml/bml/compiler/parser/capability/MapTypeReferenceEntityInstance.bml +22 -21
- package/blocks/org/blockml/bml/compiler/parser/capability/MergeSourceInfo.bml +25 -22
- package/blocks/org/blockml/bml/compiler/parser/capability/NormalizeBooleanValue.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/capability/Parse.bml +22 -22
- package/blocks/org/blockml/bml/compiler/parser/capability/ParseBmlMeta.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/capability/ParseBooleanAttribute.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/capability/ParseDirectives.bml +23 -23
- package/blocks/org/blockml/bml/compiler/parser/capability/ParseGenericArgumentList.bml +23 -23
- package/blocks/org/blockml/bml/compiler/parser/capability/ParseGenericsBinding.bml +23 -23
- package/blocks/org/blockml/bml/compiler/parser/capability/ParseMemberValue.bml +35 -27
- package/blocks/org/blockml/bml/compiler/parser/capability/ParseTypeExpression.bml +25 -23
- package/blocks/org/blockml/bml/compiler/parser/capability/ParseVisibilityFromName.bml +19 -21
- package/blocks/org/blockml/bml/compiler/parser/capability/ParseXmlDom.bml +22 -22
- package/blocks/org/blockml/bml/compiler/parser/capability/ResolveBlockReference.bml +25 -23
- package/blocks/org/blockml/bml/compiler/parser/capability/ResolvePrefix.bml +22 -21
- package/blocks/org/blockml/bml/compiler/parser/capability/ResolveTypeName.bml +25 -23
- package/blocks/org/blockml/bml/compiler/parser/capability/SourceLoc.bml +25 -22
- package/blocks/org/blockml/bml/compiler/parser/capability/SplitQName.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/capability/TrimText.bml +23 -20
- package/blocks/org/blockml/bml/compiler/parser/capability/TypeExpressionToString.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/capability/VisibilityPrefix.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/capability/XmlTriviaFromElement.bml +19 -21
- package/blocks/org/blockml/bml/compiler/parser/config/MapTimeDiagnosticCodes.bml +16 -19
- package/blocks/org/blockml/bml/compiler/parser/config/ParserConstants.bml +25 -22
- package/blocks/org/blockml/bml/compiler/parser/documentation/ArchitectureOverview.bml +21 -23
- package/blocks/org/blockml/bml/compiler/parser/documentation/AttributeClassification.bml +18 -23
- package/blocks/org/blockml/bml/compiler/parser/documentation/BlockMetadataMapping.bml +24 -22
- package/blocks/org/blockml/bml/compiler/parser/documentation/DesignDecisions.bml +16 -21
- package/blocks/org/blockml/bml/compiler/parser/documentation/Diagnostics.bml +24 -24
- package/blocks/org/blockml/bml/compiler/parser/documentation/ExpressionCapture.bml +20 -23
- package/blocks/org/blockml/bml/compiler/parser/documentation/Introduction.bml +17 -22
- package/blocks/org/blockml/bml/compiler/parser/documentation/LayerSeparation.bml +19 -24
- package/blocks/org/blockml/bml/compiler/parser/documentation/MappingPrinciples.bml +16 -21
- package/blocks/org/blockml/bml/compiler/parser/documentation/MemberMapping.bml +17 -20
- package/blocks/org/blockml/bml/compiler/parser/documentation/MemberMappingOrder.bml +16 -21
- package/blocks/org/blockml/bml/compiler/parser/documentation/PackageOwnership.bml +17 -22
- package/blocks/org/blockml/bml/compiler/parser/documentation/PublicApi.bml +19 -22
- package/blocks/org/blockml/bml/compiler/parser/documentation/RoundtripContract.bml +16 -21
- package/blocks/org/blockml/bml/compiler/parser/documentation/ScopeExclusions.bml +16 -21
- package/blocks/org/blockml/bml/compiler/parser/documentation/SingleFileScope.bml +16 -21
- package/blocks/org/blockml/bml/compiler/parser/documentation/StructuralGrammar.bml +18 -23
- package/blocks/org/blockml/bml/compiler/parser/documentation/TypeDescriptorParsing.bml +15 -20
- package/blocks/org/blockml/bml/compiler/parser/documentation/V1Scope.bml +18 -21
- package/blocks/org/blockml/bml/compiler/parser/documentation/XmlCommentsParse.bml +18 -21
- package/blocks/org/blockml/bml/compiler/parser/map/BmlMeta.bml +25 -22
- package/blocks/org/blockml/bml/compiler/parser/map/CharacterData.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/map/MapContext.bml +40 -27
- package/blocks/org/blockml/bml/compiler/parser/map/MapContextOptions.bml +31 -24
- package/blocks/org/blockml/bml/compiler/parser/map/QNameParts.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/map/VisibilityParse.bml +19 -20
- package/blocks/org/blockml/bml/compiler/parser/map/XmlDomNode.bml +13 -17
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/map/directives.d.ts.map +1 -1
- package/dist/map/directives.js +2 -2
- package/dist/map/directives.js.map +1 -1
- package/dist/map/interpolation-escape.d.ts +11 -0
- package/dist/map/interpolation-escape.d.ts.map +1 -0
- package/dist/map/interpolation-escape.js +87 -0
- package/dist/map/interpolation-escape.js.map +1 -0
- package/dist/map/map-block.d.ts.map +1 -1
- package/dist/map/map-block.js +102 -6
- package/dist/map/map-block.js.map +1 -1
- package/dist/map/member-value.d.ts +1 -1
- package/dist/map/member-value.d.ts.map +1 -1
- package/dist/map/member-value.js +4 -11
- package/dist/map/member-value.js.map +1 -1
- package/dist/pipeline/namespaces.d.ts.map +1 -1
- package/dist/pipeline/namespaces.js +3 -0
- package/dist/pipeline/namespaces.js.map +1 -1
- package/dist/pipeline/root-type.d.ts +3 -0
- package/dist/pipeline/root-type.d.ts.map +1 -1
- package/dist/pipeline/root-type.js +16 -3
- package/dist/pipeline/root-type.js.map +1 -1
- package/dist/util/xml.d.ts +6 -1
- package/dist/util/xml.d.ts.map +1 -1
- package/dist/util/xml.js +14 -2
- package/dist/util/xml.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
"
|
|
1
|
+
<!--Parser — QNameParts
|
|
2
|
+
FQN: org.blockml.bml.compiler.parser.map.QNameParts-->
|
|
3
|
+
<parmap:QNameParts xmlns="http://blockml.org/bml"
|
|
10
4
|
xmlns:blockml="org.blockml.bml"
|
|
11
5
|
xmlns:bom="org.blockml.bml.bom"
|
|
12
6
|
xmlns:bomapi="org.blockml.bml.bom.api"
|
|
@@ -29,20 +23,25 @@
|
|
|
29
23
|
xmlns:serdocumentation="org.blockml.bml.compiler.serializer.documentation"
|
|
30
24
|
xmlns:valdocumentation="org.blockml.bml.compiler.validator.documentation">
|
|
31
25
|
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<is>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
<baseType>
|
|
27
|
+
parser:ParserType
|
|
28
|
+
</baseType>
|
|
29
|
+
<is>
|
|
30
|
+
Prefix and local name from a QName split
|
|
31
|
+
</is>
|
|
32
|
+
<documentation>
|
|
33
|
+
BML type gap: stands for TypeScript { prefix: string; local: string } from splitQName() (packages/parser/src/util/qname.ts).
|
|
34
|
+
</documentation>
|
|
39
35
|
<properties>
|
|
40
36
|
<prefix type="type:Text">
|
|
41
|
-
<documentation>
|
|
37
|
+
<documentation>
|
|
38
|
+
prefix. TS type: type:Text. (required)
|
|
39
|
+
</documentation>
|
|
42
40
|
</prefix>
|
|
43
41
|
<local type="type:Text">
|
|
44
|
-
<documentation>
|
|
42
|
+
<documentation>
|
|
43
|
+
local. TS type: type:Text. (required)
|
|
44
|
+
</documentation>
|
|
45
45
|
</local>
|
|
46
46
|
</properties>
|
|
47
|
-
|
|
48
|
-
</block>
|
|
47
|
+
</parmap:QNameParts>
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
"
|
|
1
|
+
<!--Parser — VisibilityParse
|
|
2
|
+
FQN: org.blockml.bml.compiler.parser.map.VisibilityParse-->
|
|
3
|
+
<parmap:VisibilityParse xmlns="http://blockml.org/bml"
|
|
10
4
|
xmlns:blockml="org.blockml.bml"
|
|
11
5
|
xmlns:bom="org.blockml.bml.bom"
|
|
12
6
|
xmlns:bomapi="org.blockml.bml.bom.api"
|
|
@@ -29,20 +23,25 @@
|
|
|
29
23
|
xmlns:serdocumentation="org.blockml.bml.compiler.serializer.documentation"
|
|
30
24
|
xmlns:valdocumentation="org.blockml.bml.compiler.validator.documentation">
|
|
31
25
|
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<is>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
<baseType>
|
|
27
|
+
parser:ParserType
|
|
28
|
+
</baseType>
|
|
29
|
+
<is>
|
|
30
|
+
Logical name plus visibility from a localName prefix
|
|
31
|
+
</is>
|
|
32
|
+
<documentation>
|
|
33
|
+
BML type gap: stands for TypeScript { name: string; visibility: string } from parseVisibilityFromName().
|
|
34
|
+
</documentation>
|
|
39
35
|
<properties>
|
|
40
36
|
<name type="type:Text">
|
|
41
|
-
<documentation>
|
|
37
|
+
<documentation>
|
|
38
|
+
name. TS type: type:Text. (required)
|
|
39
|
+
</documentation>
|
|
42
40
|
</name>
|
|
43
41
|
<visibility type="type:Text">
|
|
44
|
-
<documentation>
|
|
42
|
+
<documentation>
|
|
43
|
+
visibility. TS type: type:Text. (required)
|
|
44
|
+
</documentation>
|
|
45
45
|
</visibility>
|
|
46
46
|
</properties>
|
|
47
|
-
|
|
48
|
-
</block>
|
|
47
|
+
</parmap:VisibilityParse>
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
"
|
|
1
|
+
<!--Parser — XmlDomNode
|
|
2
|
+
FQN: org.blockml.bml.compiler.parser.map.XmlDomNode-->
|
|
3
|
+
<parmap:XmlDomNode xmlns="http://blockml.org/bml"
|
|
10
4
|
xmlns:blockml="org.blockml.bml"
|
|
11
5
|
xmlns:bom="org.blockml.bml.bom"
|
|
12
6
|
xmlns:bomapi="org.blockml.bml.bom.api"
|
|
@@ -29,11 +23,13 @@
|
|
|
29
23
|
xmlns:serdocumentation="org.blockml.bml.compiler.serializer.documentation"
|
|
30
24
|
xmlns:valdocumentation="org.blockml.bml.compiler.validator.documentation">
|
|
31
25
|
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<is>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
26
|
+
<baseType>
|
|
27
|
+
parser:ParserType
|
|
28
|
+
</baseType>
|
|
29
|
+
<is>
|
|
30
|
+
Host XML DOM node from @xmldom/xmldom
|
|
31
|
+
</is>
|
|
32
|
+
<documentation>
|
|
33
|
+
BML type gap: stands for TypeScript Node | Element | Document (@xmldom/xmldom). Core has no DOM ValueType; this is a host-boundary type, not a reconstructed DOM struct.
|
|
34
|
+
</documentation>
|
|
35
|
+
</parmap:XmlDomNode>
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { parse } from "./parse.js";
|
|
2
|
+
export { isDocumentRootLocalName, V1_ROOT_ELEMENT, } from "./pipeline/root-type.js";
|
|
3
|
+
export { containsUnescapedInterpolation, escapeInterpolationDelimiters, unescapeInterpolationDelimiters, } from "./map/interpolation-escape.js";
|
|
2
4
|
export { isWellKnownTypeFqn, resolveTypeName, type ImplicitNamespaceContext, } from "./util/qname.js";
|
|
3
5
|
export { parseTypeExpression, parseGenericArgumentList, type ParseGenericArgumentListResult, type TypeExpressionResolveOptions, } from "./map/type-expression.js";
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
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;AACnC,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,KAAK,wBAAwB,GAC9B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,GAClC,MAAM,0BAA0B,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,uBAAuB,EACvB,eAAe,GAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAC7B,+BAA+B,GAChC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,KAAK,wBAAwB,GAC9B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,GAClC,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { parse } from "./parse.js";
|
|
2
|
+
export { isDocumentRootLocalName, V1_ROOT_ELEMENT, } from "./pipeline/root-type.js";
|
|
3
|
+
export { containsUnescapedInterpolation, escapeInterpolationDelimiters, unescapeInterpolationDelimiters, } from "./map/interpolation-escape.js";
|
|
2
4
|
export { isWellKnownTypeFqn, resolveTypeName, } from "./util/qname.js";
|
|
3
5
|
export { parseTypeExpression, parseGenericArgumentList, } from "./map/type-expression.js";
|
|
4
6
|
//# sourceMappingURL=index.js.map
|
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;AACnC,OAAO,EACL,kBAAkB,EAClB,eAAe,GAEhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,mBAAmB,EACnB,wBAAwB,GAGzB,MAAM,0BAA0B,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,uBAAuB,EACvB,eAAe,GAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAC7B,+BAA+B,GAChC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,kBAAkB,EAClB,eAAe,GAEhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,mBAAmB,EACnB,wBAAwB,GAGzB,MAAM,0BAA0B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directives.d.ts","sourceRoot":"","sources":["../../src/map/directives.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAElB,eAAe,EACf,eAAe,EAKhB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"directives.d.ts","sourceRoot":"","sources":["../../src/map/directives.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAElB,eAAe,EACf,eAAe,EAKhB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAa9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,sBAAsB,CAAC;AAY9B,eAAO,MAAM,0BAA0B,GAAI,SAAS,OAAO,KAAG,OAI7D,CAAC;AAEF,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,UAAU,EACf,OAAO,CAAC,EAAE,4BAA4B,GACrC,eAAe,GAAG,SAAS,CAoC7B;AAED,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,4 +1,4 @@
|
|
|
1
|
-
import { containsUnescapedInterpolation, expressionFromRaw } from "./member-value.js";
|
|
1
|
+
import { containsUnescapedInterpolation, expressionFromRaw, unescapeInterpolationDelimiters, } from "./member-value.js";
|
|
2
2
|
import { elementChildren, elementLocalName, elementPrefix, getAttribute, getCharacterData, } from "../util/xml.js";
|
|
3
3
|
import { collectUnknownBmlAttributes, reportDiagnostic } from "./structural.js";
|
|
4
4
|
import { parseGenericArgumentList, } from "./type-expression.js";
|
|
@@ -137,7 +137,7 @@ function parseMetaValue(raw, typeFqn, file, loc) {
|
|
|
137
137
|
}
|
|
138
138
|
return {
|
|
139
139
|
kind: "literal",
|
|
140
|
-
value: raw,
|
|
140
|
+
value: unescapeInterpolationDelimiters(raw),
|
|
141
141
|
typeFqn,
|
|
142
142
|
};
|
|
143
143
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directives.js","sourceRoot":"","sources":["../../src/map/directives.ts"],"names":[],"mappings":"AAWA,OAAO,
|
|
1
|
+
{"version":3,"file":"directives.js","sourceRoot":"","sources":["../../src/map/directives.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,8BAA8B,EAC9B,iBAAiB,EACjB,+BAA+B,GAChC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,wBAAwB,GAEzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEvE,MAAM,MAAM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,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;QACzE,OAAO,EACL,OAAO,KAAK,SAAS;YACnB,CAAC,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC;YAC7C,CAAC,CAAC,SAAS;QACf,IAAI,EACF,IAAI,KAAK,SAAS,CAAC,CAAC,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,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IAC3B,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACzE,IAAI,CAAC,aAAa,IAAI,8BAA8B,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1D,OAAO;YACL,IAAI,EAAE,cAAuB;YAC7B,GAAG;YACH,MAAM,EAAE,GAAG;SACZ,CAAC;IACJ,CAAC;IACD,OAAO;QACL,IAAI,EAAE,SAAkB;QACxB,KAAK,EAAE,+BAA+B,CAAC,GAAG,CAAC;QAC3C,OAAO;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JS-template-like `${` escaping: an opener is escaped when an odd number of
|
|
3
|
+
* backslashes immediately precedes `$`. `\${` → literal `${`; `\\${` → `\` + hole.
|
|
4
|
+
*/
|
|
5
|
+
declare function containsUnescapedInterpolation(raw: string): boolean;
|
|
6
|
+
/** Turn authored `\${` escapes into literal `${` in a value with no holes. */
|
|
7
|
+
declare function unescapeInterpolationDelimiters(raw: string): string;
|
|
8
|
+
/** Inverse of unescapeInterpolationDelimiters — emit literals so parse sees no holes. */
|
|
9
|
+
declare function escapeInterpolationDelimiters(raw: string): string;
|
|
10
|
+
export { containsUnescapedInterpolation, escapeInterpolationDelimiters, unescapeInterpolationDelimiters, };
|
|
11
|
+
//# sourceMappingURL=interpolation-escape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interpolation-escape.d.ts","sourceRoot":"","sources":["../../src/map/interpolation-escape.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,iBAAS,8BAA8B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAqB5D;AAED,8EAA8E;AAC9E,iBAAS,+BAA+B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAoB5D;AAED,yFAAyF;AACzF,iBAAS,6BAA6B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAyB1D;AAED,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAC7B,+BAA+B,GAChC,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JS-template-like `${` escaping: an opener is escaped when an odd number of
|
|
3
|
+
* backslashes immediately precedes `$`. `\${` → literal `${`; `\\${` → `\` + hole.
|
|
4
|
+
*/
|
|
5
|
+
function countBackslashes(raw, start) {
|
|
6
|
+
let n = 0;
|
|
7
|
+
while (start + n < raw.length && raw[start + n] === "\\") {
|
|
8
|
+
n++;
|
|
9
|
+
}
|
|
10
|
+
return n;
|
|
11
|
+
}
|
|
12
|
+
function isDollarBrace(raw, index) {
|
|
13
|
+
return raw[index] === "$" && raw[index + 1] === "{";
|
|
14
|
+
}
|
|
15
|
+
function containsUnescapedInterpolation(raw) {
|
|
16
|
+
let i = 0;
|
|
17
|
+
while (i < raw.length) {
|
|
18
|
+
if (raw[i] === "\\") {
|
|
19
|
+
const n = countBackslashes(raw, i);
|
|
20
|
+
if (isDollarBrace(raw, i + n)) {
|
|
21
|
+
if (n % 2 === 0) {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
i += n + 2;
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
i += n;
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
if (isDollarBrace(raw, i)) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
i++;
|
|
34
|
+
}
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
/** Turn authored `\${` escapes into literal `${` in a value with no holes. */
|
|
38
|
+
function unescapeInterpolationDelimiters(raw) {
|
|
39
|
+
let out = "";
|
|
40
|
+
let i = 0;
|
|
41
|
+
while (i < raw.length) {
|
|
42
|
+
if (raw[i] === "\\") {
|
|
43
|
+
const n = countBackslashes(raw, i);
|
|
44
|
+
if (isDollarBrace(raw, i + n)) {
|
|
45
|
+
out += "\\".repeat(Math.floor(n / 2));
|
|
46
|
+
out += "${";
|
|
47
|
+
i += n + 2;
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
out += raw.slice(i, i + n);
|
|
51
|
+
i += n;
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
out += raw[i];
|
|
55
|
+
i++;
|
|
56
|
+
}
|
|
57
|
+
return out;
|
|
58
|
+
}
|
|
59
|
+
/** Inverse of unescapeInterpolationDelimiters — emit literals so parse sees no holes. */
|
|
60
|
+
function escapeInterpolationDelimiters(raw) {
|
|
61
|
+
let out = "";
|
|
62
|
+
let i = 0;
|
|
63
|
+
while (i < raw.length) {
|
|
64
|
+
if (raw[i] === "\\") {
|
|
65
|
+
const n = countBackslashes(raw, i);
|
|
66
|
+
if (isDollarBrace(raw, i + n)) {
|
|
67
|
+
out += "\\".repeat(2 * n + 1);
|
|
68
|
+
out += "${";
|
|
69
|
+
i += n + 2;
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
out += raw.slice(i, i + n);
|
|
73
|
+
i += n;
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
if (isDollarBrace(raw, i)) {
|
|
77
|
+
out += "\\${";
|
|
78
|
+
i += 2;
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
out += raw[i];
|
|
82
|
+
i++;
|
|
83
|
+
}
|
|
84
|
+
return out;
|
|
85
|
+
}
|
|
86
|
+
export { containsUnescapedInterpolation, escapeInterpolationDelimiters, unescapeInterpolationDelimiters, };
|
|
87
|
+
//# sourceMappingURL=interpolation-escape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interpolation-escape.js","sourceRoot":"","sources":["../../src/map/interpolation-escape.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,SAAS,gBAAgB,CAAC,GAAW,EAAE,KAAa;IAClD,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,OAAO,KAAK,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QACzD,CAAC,EAAE,CAAC;IACN,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,SAAS,aAAa,CAAC,GAAW,EAAE,KAAa;IAC/C,OAAO,GAAG,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC;AACtD,CAAC;AAED,SAAS,8BAA8B,CAAC,GAAW;IACjD,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;QACtB,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YACpB,MAAM,CAAC,GAAG,gBAAgB,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YACnC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,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"map-block.d.ts","sourceRoot":"","sources":["../../src/map/map-block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIV,eAAe,EAKf,UAAU,EAUV,cAAc,EASf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AA88CjE,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,EAC9B,UAAU,CAAC,EAAE,cAAc,GAC1B,eAAe,CAOjB"}
|
package/dist/map/map-block.js
CHANGED
|
@@ -8,13 +8,84 @@ import { parseVisibilityFromName } from "../util/visibility.js";
|
|
|
8
8
|
import { parseBooleanAttribute, isBooleanLiteral } from "../util/boolean.js";
|
|
9
9
|
import { resolveBlockReference, resolvePrefix, resolveTypeName, elementSourceLoc, elementStartTagIsSelfClosing, attributeValueLoc, TYPE_REFERENCE_ENTITY, } from "../util/qname.js";
|
|
10
10
|
import { withElementLocation } from "../util/mapping-error.js";
|
|
11
|
-
import { collectBlockGrammarAttributes, collectIdentityOrSectionAttributes, collectMemberGrammarAttributes, isAllowedRootChild, isCharacterDataHost, reportDuplicateComposition, reportDuplicatePropertyValue, reportStandaloneComposition, reportUnexpectedTextChildren, reportUnknownElement, toUnknownXmlNode, } from "./structural.js";
|
|
11
|
+
import { collectBlockGrammarAttributes, collectIdentityOrSectionAttributes, collectMemberGrammarAttributes, isAllowedRootChild, isCharacterDataHost, reportDiagnostic, reportDuplicateComposition, reportDuplicatePropertyValue, reportStandaloneComposition, reportUnexpectedTextChildren, reportUnknownElement, toUnknownXmlNode, } from "./structural.js";
|
|
12
|
+
import { isDocumentRootLocalName, V1_ROOT_ELEMENT } from "../pipeline/root-type.js";
|
|
12
13
|
const MEMBER_SECTIONS = new Set([
|
|
13
14
|
"properties",
|
|
14
15
|
"aggregations",
|
|
15
16
|
"associations",
|
|
16
17
|
"capabilities",
|
|
17
18
|
]);
|
|
19
|
+
function lastTypeSegment(type) {
|
|
20
|
+
return type.split(".").pop() ?? type;
|
|
21
|
+
}
|
|
22
|
+
function rootTypesAgree(tagType, childType) {
|
|
23
|
+
if (tagType === childType) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
if (tagType.includes(".") && childType.includes(".")) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
return lastTypeSegment(tagType) === lastTypeSegment(childType);
|
|
30
|
+
}
|
|
31
|
+
function preferResolvedType(tagType, childType) {
|
|
32
|
+
if (childType.includes(".") && !tagType.includes(".")) {
|
|
33
|
+
return childType;
|
|
34
|
+
}
|
|
35
|
+
return tagType.includes(".") ? tagType : childType;
|
|
36
|
+
}
|
|
37
|
+
function typeFromRootTag(element, ctx) {
|
|
38
|
+
const local = elementLocalName(element);
|
|
39
|
+
if (local === V1_ROOT_ELEMENT) {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
const prefix = elementPrefix(element);
|
|
43
|
+
if (!prefix) {
|
|
44
|
+
return local;
|
|
45
|
+
}
|
|
46
|
+
return withElementLocation(ctx.filePath, ctx.source, element, () => resolveBlockReference(`${prefix}:${local}`, ctx.bindings, ctx.subBlockIndex, ctx.parentBlockType));
|
|
47
|
+
}
|
|
48
|
+
function applyRootTypeIdentity(element, block, ctx, tagType, missingCode) {
|
|
49
|
+
if (tagType) {
|
|
50
|
+
if (block.type && !rootTypesAgree(tagType, block.type)) {
|
|
51
|
+
reportDiagnostic(ctx, "BML_MAP_ERROR", `BML_MAP_ERROR: tag type ${tagType} disagrees with <type> ${block.type}`, elementSourceLoc(ctx.filePath, ctx.source, element));
|
|
52
|
+
block.type = tagType;
|
|
53
|
+
block.typeSource = elementSourceLoc(ctx.filePath, ctx.source, element);
|
|
54
|
+
}
|
|
55
|
+
else if (block.type) {
|
|
56
|
+
block.type = preferResolvedType(tagType, block.type);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
block.type = tagType;
|
|
60
|
+
block.typeSource = elementSourceLoc(ctx.filePath, ctx.source, element);
|
|
61
|
+
}
|
|
62
|
+
ctx.parentBlockType = block.type;
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (!block.type) {
|
|
66
|
+
const site = missingCode === "BML_MISSING_EMBEDDED_BLOCK_TYPE" ? "embed tag" : "root tag";
|
|
67
|
+
reportDiagnostic(ctx, missingCode, `${missingCode}: neither ${site} nor <type> supplies a type`, elementSourceLoc(ctx.filePath, ctx.source, element));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function applySubBlockIdentity(element, block, ctx, parentType) {
|
|
71
|
+
const local = elementLocalName(element);
|
|
72
|
+
const tagName = local === V1_ROOT_ELEMENT ? undefined : local;
|
|
73
|
+
if (tagName) {
|
|
74
|
+
if (block.name && block.name !== tagName) {
|
|
75
|
+
reportDiagnostic(ctx, "BML_MAP_ERROR", `BML_MAP_ERROR: Sub-Block tag ${tagName} disagrees with <name> ${block.name}`, elementSourceLoc(ctx.filePath, ctx.source, element));
|
|
76
|
+
}
|
|
77
|
+
block.name = tagName;
|
|
78
|
+
}
|
|
79
|
+
if (!block.name) {
|
|
80
|
+
reportDiagnostic(ctx, "BML_MISSING_SUBBLOCK_NAME", "BML_MISSING_SUBBLOCK_NAME: neither element tag nor <name> supplies the local name", elementSourceLoc(ctx.filePath, ctx.source, element));
|
|
81
|
+
}
|
|
82
|
+
if (!block.type && parentType && block.name) {
|
|
83
|
+
block.type = `${parentType}.${block.name}`;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function isDefinitionWrapper(element) {
|
|
87
|
+
return isDocumentRootLocalName(elementLocalName(element));
|
|
88
|
+
}
|
|
18
89
|
function mapBlockDefinition(element, ctx, parentType) {
|
|
19
90
|
const block = {
|
|
20
91
|
name: "",
|
|
@@ -37,6 +108,14 @@ function mapBlockDefinition(element, ctx, parentType) {
|
|
|
37
108
|
if (blockGenerics) {
|
|
38
109
|
block.generics = blockGenerics;
|
|
39
110
|
}
|
|
111
|
+
const local = elementLocalName(element);
|
|
112
|
+
block.wrapperForm = local === V1_ROOT_ELEMENT ? "block" : "type";
|
|
113
|
+
const tagType = ctx.isRoot || ctx.isEmbedded ? typeFromRootTag(element, ctx) : undefined;
|
|
114
|
+
if (tagType) {
|
|
115
|
+
block.type = tagType;
|
|
116
|
+
block.typeSource = elementSourceLoc(ctx.filePath, ctx.source, element);
|
|
117
|
+
ctx.parentBlockType = tagType;
|
|
118
|
+
}
|
|
40
119
|
const childElements = elementChildren(element);
|
|
41
120
|
const subBlocksRaw = [];
|
|
42
121
|
const embeddedRaw = [];
|
|
@@ -59,11 +138,11 @@ function mapBlockDefinition(element, ctx, parentType) {
|
|
|
59
138
|
continue;
|
|
60
139
|
}
|
|
61
140
|
if (local === "subBlocks") {
|
|
62
|
-
subBlocksRaw.push(...elementChildren(child).filter(
|
|
141
|
+
subBlocksRaw.push(...elementChildren(child).filter(isDefinitionWrapper));
|
|
63
142
|
continue;
|
|
64
143
|
}
|
|
65
144
|
if (local === "embeddedBlocks") {
|
|
66
|
-
embeddedRaw.push(...elementChildren(child).filter(
|
|
145
|
+
embeddedRaw.push(...elementChildren(child).filter(isDefinitionWrapper));
|
|
67
146
|
continue;
|
|
68
147
|
}
|
|
69
148
|
if (MEMBER_SECTIONS.has(local)) {
|
|
@@ -88,7 +167,16 @@ function mapBlockDefinition(element, ctx, parentType) {
|
|
|
88
167
|
}
|
|
89
168
|
seedSubBlockIndex(element, block, ctx, parentType, subBlocksRaw);
|
|
90
169
|
mapMetadataFields(element, block, ctx);
|
|
91
|
-
if (
|
|
170
|
+
if (ctx.isRoot) {
|
|
171
|
+
applyRootTypeIdentity(element, block, ctx, tagType, "BML_MISSING_BLOCK_TYPE");
|
|
172
|
+
}
|
|
173
|
+
else if (ctx.isEmbedded) {
|
|
174
|
+
applyRootTypeIdentity(element, block, ctx, tagType, "BML_MISSING_EMBEDDED_BLOCK_TYPE");
|
|
175
|
+
}
|
|
176
|
+
else if (parentType !== undefined) {
|
|
177
|
+
applySubBlockIdentity(element, block, ctx, parentType);
|
|
178
|
+
}
|
|
179
|
+
if (!block.name && (ctx.isRoot || ctx.isEmbedded)) {
|
|
92
180
|
block.name = block.type.split(".").pop() ?? "Block";
|
|
93
181
|
}
|
|
94
182
|
if (ctx.isEmbedded && getAttribute(element, "type")) {
|
|
@@ -97,12 +185,12 @@ function mapBlockDefinition(element, ctx, parentType) {
|
|
|
97
185
|
block.type = withElementLocation(ctx.filePath, ctx.source, element, () => resolveBlockReference(typeText, ctx.bindings, ctx.subBlockIndex, parentType), { name: "type", value: typeText });
|
|
98
186
|
}
|
|
99
187
|
}
|
|
100
|
-
else if (!block.type && parentType) {
|
|
188
|
+
else if (!block.type && parentType && block.name) {
|
|
101
189
|
block.type = `${parentType}.${block.name}`;
|
|
102
190
|
}
|
|
103
191
|
const subBlockElements = [...subBlocksRaw];
|
|
104
192
|
for (const child of childElements) {
|
|
105
|
-
if (elementLocalName(child) ===
|
|
193
|
+
if (elementLocalName(child) === V1_ROOT_ELEMENT) {
|
|
106
194
|
subBlockElements.push(child);
|
|
107
195
|
}
|
|
108
196
|
}
|
|
@@ -429,10 +517,12 @@ function mapMetadataFields(element, block, ctx) {
|
|
|
429
517
|
switch (local) {
|
|
430
518
|
case "name":
|
|
431
519
|
block.name = getTextOrAttr(child) ?? block.name;
|
|
520
|
+
block.authoredNameChild = true;
|
|
432
521
|
break;
|
|
433
522
|
case "type":
|
|
434
523
|
block.type = withElementLocation(ctx.filePath, ctx.source, child, () => resolveBlockReference(getTextOrAttr(child) ?? "", ctx.bindings, ctx.subBlockIndex, ctx.parentBlockType));
|
|
435
524
|
block.typeSource = elementSourceLoc(ctx.filePath, ctx.source, child);
|
|
525
|
+
block.authoredTypeChild = true;
|
|
436
526
|
ctx.parentBlockType = block.type;
|
|
437
527
|
break;
|
|
438
528
|
case "baseType": {
|
|
@@ -588,6 +678,12 @@ function peekSubBlock(element, parentType, ctx, enclosingParent) {
|
|
|
588
678
|
typeText = getTextOrAttr(child);
|
|
589
679
|
}
|
|
590
680
|
}
|
|
681
|
+
if (!name) {
|
|
682
|
+
const local = elementLocalName(element);
|
|
683
|
+
if (local !== V1_ROOT_ELEMENT && isDocumentRootLocalName(local)) {
|
|
684
|
+
name = local;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
591
687
|
if (!name) {
|
|
592
688
|
return undefined;
|
|
593
689
|
}
|