Skip to content

Commit

Permalink
AST-1: Remove unused DashSeperator field
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmengo committed Jan 14, 2025
1 parent 915e388 commit 157c7bf
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
13 changes: 0 additions & 13 deletions packages/liquid-html-parser/src/stage-1-cst.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1054,19 +1054,6 @@ describe('Unit: Stage 1 (CST)', () => {
);
});

it('should parse @param with description seperated by a dash', () => {
const testStr = `{% doc %}
@param dashWithSpace - param with description
@param dashWithNoSpace -param with description
@param notDashSeparated param with description
{% enddoc %}`;
cst = toCST(testStr);

expectPath(cst, '0.children.0.paramDescription.dashSeparated').to.equal(true);
expectPath(cst, '0.children.1.paramDescription.dashSeparated').to.equal(true);
expectPath(cst, '0.children.2.paramDescription.dashSeparated').to.equal(false);
});

it('should accept punctation inside the param description body', () => {
const testStr = `{% doc %} @param paramName paramDescription - asdf . \`should\` work {% enddoc %}`;
cst = toCST(testStr);
Expand Down
2 changes: 0 additions & 2 deletions packages/liquid-html-parser/src/stage-1-cst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1355,15 +1355,13 @@ function toLiquidDocAST(source: string, matchingSource: string, offset: number)
};
},
paramDescription: function (nodes: Node[]) {
const dashNode = nodes[6];
const descriptionNode = nodes[7];
return {
type: ConcreteNodeTypes.TextNode,
value: descriptionNode.sourceString.trim(),
source,
locStart: offset + descriptionNode.source.startIdx,
locEnd: offset + descriptionNode.source.endIdx,
dashSeparated: dashNode.sourceString.trim() === '-',
};
},
},
Expand Down

0 comments on commit 157c7bf

Please sign in to comment.