@@ -73,6 +73,7 @@ import {
73
73
LiquidHtmlConcreteNode ,
74
74
ConcreteLiquidTagBaseCase ,
75
75
ConcreteLiquidTagContentForMarkup ,
76
+ LiquidDocCST ,
76
77
} from './stage-1-cst' ;
77
78
import { Comparators , NamedTags , NodeTypes , nonTraversableProperties , Position } from './types' ;
78
79
import { assertNever , deepGet , dropLast } from './utils' ;
@@ -107,7 +108,8 @@ export type LiquidHtmlNode =
107
108
| RenderVariableExpression
108
109
| LiquidLogicalExpression
109
110
| LiquidComparison
110
- | TextNode ;
111
+ | TextNode
112
+ | LiquidDocParamNode ;
111
113
112
114
/** The root node of all LiquidHTML ASTs. */
113
115
export interface DocumentNode extends ASTNode < NodeTypes . Document > {
@@ -754,6 +756,10 @@ export interface TextNode extends ASTNode<NodeTypes.TextNode> {
754
756
value : string ;
755
757
}
756
758
759
+ export interface LiquidDocParamNode extends ASTNode < NodeTypes . LiquidDocParamNode > {
760
+ name : string ;
761
+ }
762
+
757
763
export interface ASTNode < T > {
758
764
/**
759
765
* The type of the node, as a string.
@@ -1103,7 +1109,7 @@ export function cstToAst(
1103
1109
}
1104
1110
1105
1111
function buildAst (
1106
- cst : LiquidHtmlCST | LiquidCST | ConcreteAttributeNode [ ] ,
1112
+ cst : LiquidHtmlCST | LiquidCST | LiquidDocCST | ConcreteAttributeNode [ ] ,
1107
1113
options : ASTBuildOptions ,
1108
1114
) {
1109
1115
const builder = new ASTBuilder ( cst [ 0 ] . source ) ;
@@ -1268,6 +1274,16 @@ function buildAst(
1268
1274
break ;
1269
1275
}
1270
1276
1277
+ case ConcreteNodeTypes . LiquidDocParamNode : {
1278
+ builder . push ( {
1279
+ type : NodeTypes . LiquidDocParamNode ,
1280
+ name : node . name ,
1281
+ position : position ( node ) ,
1282
+ source : node . source ,
1283
+ } ) ;
1284
+ break ;
1285
+ }
1286
+
1271
1287
default : {
1272
1288
assertNever ( node ) ;
1273
1289
}
0 commit comments