shellscape / postcss-less

PostCSS Syntax for parsing LESS
MIT License
122 stars 39 forks source link

Correctly calculate last parens in ruleset as mixin param #132

Closed AndreasHogstrom closed 5 years ago

AndreasHogstrom commented 5 years ago

Which issue # if any, does this resolve?

128

Please check one:

This PR:


The following code found in lib/LessParser.js:95 always returns the first closing parenthesis rather than the last, as indicated by the variable name.

const lastParenIndex = tokens.findIndex((t) => t[0] === ')');

This breaks the parsing when there are multiple closing parenthesis in the list of tokens.

codecov-io commented 5 years ago

Codecov Report

Merging #132 into master will decrease coverage by 0.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #132      +/-   ##
==========================================
- Coverage   96.49%   96.47%   -0.02%     
==========================================
  Files           8        8              
  Lines         228      227       -1     
==========================================
- Hits          220      219       -1     
  Misses          8        8
Impacted Files Coverage Δ
lib/LessParser.js 99.13% <100%> (ø) :arrow_up:
lib/nodes/inline-comment.js 100% <0%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 714ce13...aeeb7bb. Read the comment docs.

drserg commented 5 years ago

Hi guys! Could you please release this fix? Thanks a lot in advance