@@ -73,7 +73,6 @@ import {
73
73
LiquidHtmlConcreteNode ,
74
74
ConcreteLiquidTagBaseCase ,
75
75
ConcreteLiquidTagContentForMarkup ,
76
- ConcreteLiquidDocParamDescription ,
77
76
} from './stage-1-cst' ;
78
77
import { Comparators , NamedTags , NodeTypes , nonTraversableProperties , Position } from './types' ;
79
78
import { assertNever , deepGet , dropLast } from './utils' ;
@@ -762,19 +761,10 @@ export interface LiquidDocParamNode extends ASTNode<NodeTypes.LiquidDocParamNode
762
761
/** The name of the parameter (e.g. "product") */
763
762
paramName : TextNode ;
764
763
/** Optional description of the parameter in a Liquid doc comment (e.g. "The product title") */
765
- paramDescription : LiquidDocParamDescription | null ;
764
+ paramDescription : TextNode | null ;
766
765
/** Optional type annotation for the parameter (e.g. "{string}", "{number}") */
767
766
paramType : TextNode | null ;
768
767
}
769
-
770
- export interface LiquidDocParamDescription extends ASTNode < NodeTypes . TextNode > {
771
- /** Whether the parameter description is dash-separated (e.g. "paramName - paramDescription") */
772
- dashSeparated : boolean ;
773
-
774
- /** The body of the description */
775
- value : string ;
776
- }
777
-
778
768
export interface ASTNode < T > {
779
769
/**
780
770
* The type of the node, as a string.
@@ -1301,8 +1291,8 @@ function buildAst(
1301
1291
position : position ( node . paramName ) ,
1302
1292
source : node . paramName . source ,
1303
1293
} ,
1304
- paramDescription : toParamDescription ( node . paramDescription ) ,
1305
- paramType : toParamType ( node . paramType ) ,
1294
+ paramDescription : toNullableTextNode ( node . paramDescription ) ,
1295
+ paramType : toNullableTextNode ( node . paramType ) ,
1306
1296
} ) ;
1307
1297
break ;
1308
1298
}
@@ -1983,6 +1973,11 @@ function toHtmlSelfClosingElement(
1983
1973
} ;
1984
1974
}
1985
1975
1976
+ function toNullableTextNode ( node : ConcreteTextNode | null ) : TextNode | null {
1977
+ if ( ! node ) return null ;
1978
+ return toTextNode ( node ) ;
1979
+ }
1980
+
1986
1981
function toTextNode ( node : ConcreteTextNode ) : TextNode {
1987
1982
return {
1988
1983
type : NodeTypes . TextNode ,
@@ -2087,26 +2082,3 @@ function getUnclosed(node?: ParentNode, parentNode?: ParentNode): UnclosedNode |
2087
2082
blockStartPosition : 'blockStartPosition' in node ? node . blockStartPosition : node . position ,
2088
2083
} ;
2089
2084
}
2090
-
2091
- function toParamDescription (
2092
- node : ConcreteLiquidDocParamDescription | null ,
2093
- ) : LiquidDocParamDescription | null {
2094
- if ( ! node ) return null ;
2095
- return {
2096
- type : NodeTypes . TextNode ,
2097
- value : node . value ,
2098
- position : position ( node ) ,
2099
- source : node . source ,
2100
- dashSeparated : node . dashSeparated ,
2101
- } ;
2102
- }
2103
-
2104
- function toParamType ( node : ConcreteTextNode | null ) : TextNode | null {
2105
- if ( ! node ) return null ;
2106
- return {
2107
- type : NodeTypes . TextNode ,
2108
- value : node . value ,
2109
- position : position ( node ) ,
2110
- source : node . source ,
2111
- } ;
2112
- }
0 commit comments