- Node Version: v8.11.3
- NPM Version: 5.6.0
- postcss Version: 7.0.3
- postcss-less Version: master
LESS
// Don't give up
.selector {}
// Don't give in
Errors
CssSyntaxError {
column: 8,
input: {
column: 8,
line: 3,
source: `// Don't give up␊
.selector {}␊
// Don't give in`,
},
line: 3,
message: '<css input>:3:8: Unknown word',
name: 'CssSyntaxError',
reason: 'Unknown word',
source: `// Don't give up␊
.selector {}␊
// Don't give in`,
}
Expected Behavior
AST with 1 comment node, 1 selector node and 1 comment node.
Actual Behavior
Due to the use of nextToken in the comment paring code, the tokenizer will assume that the two quote characters encapsulate a string.
First comment node includes too much:
// Don't give up
.selector {}
// Don'
bits = ["//", " ", "Don", "'t give up\n .selector {}\n// Don'"]
And continued parsing results in an error.
How can we reproduce the behavior?
test('inline comment with quotes', (t) => {
const less = `// Don't give up
.selector {}
// Don't give in`;
const root = parse(less);
t.is(nodeToString(root), less);
});```
LESS
Errors
Expected Behavior
AST with 1 comment node, 1 selector node and 1 comment node.
Actual Behavior
Due to the use of
nextTokenin the comment paring code, the tokenizer will assume that the two quote characters encapsulate a string.First comment node includes too much:
And continued parsing results in an error.
How can we reproduce the behavior?