@platformos/liquid-html-parser 0.0.9 → 0.0.10
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/dist/stage-1-cst.d.ts
CHANGED
|
@@ -343,7 +343,7 @@ export interface ConcreteLiquidTagContentForMarkup extends ConcreteBasicNode<Con
|
|
|
343
343
|
contentForType: ConcreteStringLiteral;
|
|
344
344
|
}
|
|
345
345
|
export interface ConcreteLiquidTagRenderMarkup extends ConcreteBasicNode<ConcreteNodeTypes.RenderMarkup> {
|
|
346
|
-
|
|
346
|
+
partial: ConcreteStringLiteral | ConcreteLiquidVariableLookup;
|
|
347
347
|
variable: ConcreteRenderVariableExpression | null;
|
|
348
348
|
alias: ConcreteRenderAliasExpression | null;
|
|
349
349
|
renderArguments: ConcreteLiquidNamedArgument[];
|
package/dist/stage-1-cst.js
CHANGED
|
@@ -466,7 +466,7 @@ function toCST(source /* the original file */, grammars, grammar, cstMappings, m
|
|
|
466
466
|
contentForType: 0,
|
|
467
467
|
liquidTagRenderMarkup: {
|
|
468
468
|
type: ConcreteNodeTypes.RenderMarkup,
|
|
469
|
-
|
|
469
|
+
partial: 0,
|
|
470
470
|
variable: 1,
|
|
471
471
|
alias: 2,
|
|
472
472
|
renderArguments: 3,
|
|
@@ -611,7 +611,7 @@ function toCST(source /* the original file */, grammars, grammar, cstMappings, m
|
|
|
611
611
|
.toAST(self.args.mapping)
|
|
612
612
|
.concat(variableLookup.sourceString === '' ? [] : variableLookup.toAST(self.args.mapping));
|
|
613
613
|
},
|
|
614
|
-
|
|
614
|
+
partialExpression: 0,
|
|
615
615
|
renderVariableExpression: {
|
|
616
616
|
type: ConcreteNodeTypes.RenderVariableExpression,
|
|
617
617
|
kind: 1,
|
package/dist/stage-2-ast.d.ts
CHANGED
|
@@ -264,8 +264,8 @@ export interface ContentForMarkup extends ASTNode<NodeTypes.ContentForMarkup> {
|
|
|
264
264
|
}
|
|
265
265
|
/** {% render 'partial' [(with|for) variable [as alias]], [...namedArguments] %} */
|
|
266
266
|
export interface RenderMarkup extends ASTNode<NodeTypes.RenderMarkup> {
|
|
267
|
-
/** {% render
|
|
268
|
-
|
|
267
|
+
/** {% render 'partial' %} */
|
|
268
|
+
partial: LiquidString | LiquidVariableLookup;
|
|
269
269
|
/** {% render 'partial' with thing as alias %} */
|
|
270
270
|
alias: RenderAliasExpression | null;
|
|
271
271
|
/** {% render 'partial' [with variable] %} */
|
|
@@ -281,7 +281,7 @@ export interface RenderMarkup extends ASTNode<NodeTypes.RenderMarkup> {
|
|
|
281
281
|
}
|
|
282
282
|
/** {% function res = 'partial', [...namedArguments] %} */
|
|
283
283
|
export interface FunctionMarkup extends ASTNode<NodeTypes.FunctionMarkup> {
|
|
284
|
-
/** {%
|
|
284
|
+
/** {% function res = 'partial' %} */
|
|
285
285
|
name: string;
|
|
286
286
|
partial: LiquidString | LiquidVariableLookup;
|
|
287
287
|
/**
|
|
@@ -295,7 +295,7 @@ export interface FunctionMarkup extends ASTNode<NodeTypes.FunctionMarkup> {
|
|
|
295
295
|
}
|
|
296
296
|
/** {% graphql res = 'path/to/graphql/file', [...namedArguments] %} (file-based) */
|
|
297
297
|
export interface GraphQLMarkup extends ASTNode<NodeTypes.GraphQLMarkup> {
|
|
298
|
-
/** {% graphql res =
|
|
298
|
+
/** {% graphql res = 'path/to/graphql/file' %} */
|
|
299
299
|
name: string;
|
|
300
300
|
graphql: LiquidString | LiquidVariableLookup;
|
|
301
301
|
/**
|
|
@@ -417,7 +417,7 @@ export interface RenderVariableExpression extends ASTNode<NodeTypes.RenderVariab
|
|
|
417
417
|
}
|
|
418
418
|
/** Represents the `as name` expressions in render nodes */
|
|
419
419
|
export interface RenderAliasExpression extends ASTNode<NodeTypes.RenderAliasExpression> {
|
|
420
|
-
/** {% render 'partial' for array as name %}` or `{% render '
|
|
420
|
+
/** {% render 'partial' for array as name %}` or `{% render 'partial' with object as name %} */
|
|
421
421
|
value: string;
|
|
422
422
|
}
|
|
423
423
|
/** The union type of the strictly and loosely typed LiquidBranch nodes */
|
package/dist/stage-2-ast.js
CHANGED
|
@@ -1026,14 +1026,14 @@ function toContentForMarkup(node) {
|
|
|
1026
1026
|
function toRenderMarkup(node) {
|
|
1027
1027
|
return {
|
|
1028
1028
|
type: types_1.NodeTypes.RenderMarkup,
|
|
1029
|
-
|
|
1029
|
+
partial: toExpression(node.partial),
|
|
1030
1030
|
alias: toRenderAliasExpression(node.alias),
|
|
1031
1031
|
variable: toRenderVariableExpression(node.variable),
|
|
1032
1032
|
/**
|
|
1033
1033
|
* When we're in completion mode we won't necessarily have valid named
|
|
1034
1034
|
* arguments so we need to call toLiquidArgument instead of toNamedArgument.
|
|
1035
1035
|
* We cast using `as` so that this doesn't affect the type system used in
|
|
1036
|
-
* other areas (like
|
|
1036
|
+
* other areas (like platformos-check) for a scenario that only occurs in
|
|
1037
1037
|
* completion mode. This means that our types are *wrong* in completion mode
|
|
1038
1038
|
* but this is the compromise we're making to get completions to work.
|
|
1039
1039
|
*/
|
|
@@ -1051,7 +1051,7 @@ function toFunctionMarkup(node) {
|
|
|
1051
1051
|
* When we're in completion mode we won't necessarily have valid named
|
|
1052
1052
|
* arguments so we need to call toLiquidArgument instead of toNamedArgument.
|
|
1053
1053
|
* We cast using `as` so that this doesn't affect the type system used in
|
|
1054
|
-
* other areas (like
|
|
1054
|
+
* other areas (like platformos-check) for a scenario that only occurs in
|
|
1055
1055
|
* completion mode. This means that our types are *wrong* in completion mode
|
|
1056
1056
|
* but this is the compromise we're making to get completions to work.
|
|
1057
1057
|
*/
|
|
@@ -1069,7 +1069,7 @@ function toGraphQLMarkup(node) {
|
|
|
1069
1069
|
* When we're in completion mode we won't necessarily have valid named
|
|
1070
1070
|
* arguments so we need to call toLiquidArgument instead of toNamedArgument.
|
|
1071
1071
|
* We cast using `as` so that this doesn't affect the type system used in
|
|
1072
|
-
* other areas (like
|
|
1072
|
+
* other areas (like platformos-check) for a scenario that only occurs in
|
|
1073
1073
|
* completion mode. This means that our types are *wrong* in completion mode
|
|
1074
1074
|
* but this is the compromise we're making to get completions to work.
|
|
1075
1075
|
*/
|
|
@@ -1086,7 +1086,7 @@ function toGraphQLInlineMarkup(node) {
|
|
|
1086
1086
|
* When we're in completion mode we won't necessarily have valid named
|
|
1087
1087
|
* arguments so we need to call toLiquidArgument instead of toNamedArgument.
|
|
1088
1088
|
* We cast using `as` so that this doesn't affect the type system used in
|
|
1089
|
-
* other areas (like
|
|
1089
|
+
* other areas (like platformos-check) for a scenario that only occurs in
|
|
1090
1090
|
* completion mode. This means that our types are *wrong* in completion mode
|
|
1091
1091
|
* but this is the compromise we're making to get completions to work.
|
|
1092
1092
|
*/
|
|
@@ -204,17 +204,17 @@ Liquid <: Helpers {
|
|
|
204
204
|
liquidTagInclude = liquidTagRule<"include", liquidTagRenderMarkup>
|
|
205
205
|
liquidTagRender = liquidTagRule<"render", liquidTagRenderMarkup>
|
|
206
206
|
liquidTagRenderMarkup =
|
|
207
|
-
|
|
207
|
+
partialExpression renderVariableExpression? renderAliasExpression? renderArguments
|
|
208
208
|
|
|
209
209
|
liquidTagFunction = liquidTagRule<"function", liquidTagFunctionMarkup>
|
|
210
|
-
liquidTagFunctionMarkup = variableSegment space* "=" space*
|
|
210
|
+
liquidTagFunctionMarkup = variableSegment space* "=" space* partialExpression renderArguments
|
|
211
211
|
|
|
212
212
|
liquidTagGraphQL = liquidTagRule<"graphql", liquidTagGraphQLMarkup>
|
|
213
|
-
liquidTagGraphQLMarkup = variableSegment space* "=" space*
|
|
213
|
+
liquidTagGraphQLMarkup = variableSegment space* "=" space* partialExpression graphqlRenderArguments
|
|
214
214
|
|
|
215
215
|
// platformos simple tags
|
|
216
216
|
liquidTagBackground = liquidTagRule<"background", liquidTagBackgroundMarkup>
|
|
217
|
-
liquidTagBackgroundMarkup = variableSegment space* "=" space*
|
|
217
|
+
liquidTagBackgroundMarkup = variableSegment space* "=" space* partialExpression renderArguments
|
|
218
218
|
|
|
219
219
|
liquidTagOpenBackground = liquidTagOpenRule<"background", liquidTagBackgroundInlineMarkup>
|
|
220
220
|
// Use negative lookahead to exclude file-based syntax (with "=")
|
|
@@ -261,7 +261,7 @@ Liquid <: Helpers {
|
|
|
261
261
|
liquidTagRedirectToMarkup = liquidExpression<delimTag> renderArguments
|
|
262
262
|
|
|
263
263
|
liquidTagIncludeForm = liquidTagRule<"include_form", liquidTagIncludeFormMarkup>
|
|
264
|
-
liquidTagIncludeFormMarkup =
|
|
264
|
+
liquidTagIncludeFormMarkup = partialExpression renderArguments
|
|
265
265
|
|
|
266
266
|
liquidTagSpamProtection = liquidTagRule<"spam_protection", liquidTagSpamProtectionMarkup>
|
|
267
267
|
liquidTagSpamProtectionMarkup = liquidExpression<delimTag> renderArguments
|
|
@@ -278,7 +278,6 @@ Liquid <: Helpers {
|
|
|
278
278
|
|
|
279
279
|
renderArguments = (argumentSeparatorOptionalComma tagArguments) (space* ",")? space*
|
|
280
280
|
completionModeRenderArguments = (argumentSeparatorOptionalComma tagArguments) (space* ",")? space* (argumentSeparator? liquidVariableLookup<delimTag> space*)?
|
|
281
|
-
snippetExpression = liquidString<delimTag> | variableSegmentAsLookup
|
|
282
281
|
partialExpression = liquidString<delimTag> | variableSegmentAsLookup
|
|
283
282
|
renderVariableExpression = space+ ("for" | "with") space+ liquidExpression<delimTag>
|
|
284
283
|
renderAliasExpression = space+ "as" space+ variableSegment
|
|
@@ -731,7 +730,7 @@ StrictLiquidHTML <: LiquidHTML {
|
|
|
731
730
|
WithPlaceholderLiquid <: Liquid {
|
|
732
731
|
liquidFilter<delim> := space* "|" space* identifier (space* ":" space* filterArguments<delim> (space* ",")?)?
|
|
733
732
|
liquidTagRenderMarkup :=
|
|
734
|
-
|
|
733
|
+
partialExpression renderVariableExpression? renderAliasExpression? completionModeRenderArguments
|
|
735
734
|
liquidTagName := (letter | "█") (alnum | "_")*
|
|
736
735
|
variableSegment := (letter | "_" | "█") (identifierCharacter | "█")*
|
|
737
736
|
liquidDoc :=
|
|
@@ -743,7 +742,7 @@ WithPlaceholderLiquid <: Liquid {
|
|
|
743
742
|
WithPlaceholderLiquidStatement <: LiquidStatement {
|
|
744
743
|
liquidFilter<delim> := space* "|" space* identifier (space* ":" space* filterArguments<delim> (space* ",")?)?
|
|
745
744
|
liquidTagRenderMarkup :=
|
|
746
|
-
|
|
745
|
+
partialExpression renderVariableExpression? renderAliasExpression? completionModeRenderArguments
|
|
747
746
|
liquidTagName := (letter | "█") (alnum | "_")*
|
|
748
747
|
variableSegment := (letter | "_" | "█") (identifierCharacter | "█")*
|
|
749
748
|
liquidDoc :=
|
|
@@ -755,7 +754,7 @@ WithPlaceholderLiquidStatement <: LiquidStatement {
|
|
|
755
754
|
WithPlaceholderLiquidHTML <: LiquidHTML {
|
|
756
755
|
liquidFilter<delim> := space* "|" space* identifier (space* ":" space* filterArguments<delim> (space* ",")?)?
|
|
757
756
|
liquidTagRenderMarkup :=
|
|
758
|
-
|
|
757
|
+
partialExpression renderVariableExpression? renderAliasExpression? completionModeRenderArguments
|
|
759
758
|
liquidTagName := (letter | "█") (alnum | "_")*
|
|
760
759
|
variableSegment := (letter | "_" | "█") (identifierCharacter | "█")*
|
|
761
760
|
leadingTagNameTextNode := (letter | "█") (alnum | "-" | ":" | "█")*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformos/liquid-html-parser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "Liquid HTML parser for platformOS",
|
|
5
5
|
"author": "platformOS",
|
|
6
6
|
"homepage": "https://github.com/Platform-OS/platformos-tools/tree/master/packages/liquid-html-parser#readme",
|