forked from wikimedia/less.php
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ParseError for comments in more places and preserve them in output
This implements the commentStore feature in the Less_Parser. To be able to parse and re-inject comments we need to store them in the commentStore instead of just eating up. In cases where we cannot render comments the commentStore array will be cleaned up. This causes situations when instead of a single argument we might pass the Less_Tree_Exception. As per less.js we introduce the functionCaller (for now just a method instead of additional class) that will clean up Expresssions from comments before calling a function. This fixes the following crash, and more generally preserves comments in various places where we ate them previously. ``` bin/lessc test/Fixtures/lessjs-3.13.1/less/_main/comments2.less ParseError: unmatched `/*` in comments2.less on line 4, column 53 2| @-webkit-keyframes hover /* Safari and Chrome */{ } 3| .bg { 4| background-image: linear-gradient(#333 /*{comment}*/, wikimedia#111); ``` Bug: T353132 Change-Id: I99c42a1969762869023e91deb72f31773b43a06e
- Loading branch information
1 parent
8c8f446
commit 76b1210
Showing
8 changed files
with
161 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.