Skip to content

Commit

Permalink
Fix - pass 'param' as node name to stage 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmengo committed Jan 14, 2025
1 parent 4e69c7c commit c132c46
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/liquid-html-parser/src/stage-1-cst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1330,6 +1330,7 @@ function toLiquidDocAST(source: string, matchingSource: string, offset: number)
},
paramNode: {
type: ConcreteNodeTypes.LiquidDocParamNode,
name: 'param',
locStart,
locEnd,
source,
Expand Down
4 changes: 2 additions & 2 deletions packages/liquid-html-parser/src/stage-2-ast.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1239,13 +1239,13 @@ describe('Unit: Stage 2 (AST)', () => {
expectPath(ast, 'children.0.type').to.eql('LiquidRawTag');
expectPath(ast, 'children.0.name').to.eql('doc');
expectPath(ast, 'children.0.body.nodes.0.type').to.eql('LiquidDocParamNode');
expectPath(ast, 'children.0.body.nodes.0.name').to.eql('@param');
expectPath(ast, 'children.0.body.nodes.0.name').to.eql('param');
expectPath(ast, 'children.0.body.nodes.0.paramName.type').to.eql('TextNode');
expectPath(ast, 'children.0.body.nodes.0.paramName.value').to.eql('asdf');
expectPath(ast, 'children.0.body.nodes.0.paramDescription.type').to.eql('TextNode');
expectPath(ast, 'children.0.body.nodes.0.paramDescription.value').to.eql('');
expectPath(ast, 'children.0.body.nodes.1.type').to.eql('LiquidDocParamNode');
expectPath(ast, 'children.0.body.nodes.1.name').to.eql('@param');
expectPath(ast, 'children.0.body.nodes.1.name').to.eql('param');
expectPath(ast, 'children.0.body.nodes.1.paramName.type').to.eql('TextNode');
expectPath(ast, 'children.0.body.nodes.1.paramName.value').to.eql('paramWithDescription');
expectPath(ast, 'children.0.body.nodes.1.paramDescription.type').to.eql('TextNode');
Expand Down

0 comments on commit c132c46

Please sign in to comment.