Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix comments in operations (ex: *height: 2px * 4 /* ie hack */) #492

Merged
merged 1 commit into from
Dec 1, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/less/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ less.Parser = function Parser(env) {
multiplication: function () {
var m, a, op, operation;
if (m = $(this.operand)) {
while ((op = ($('/') || $('*'))) && (a = $(this.operand))) {
while (!peek(/^\/\*/) && (op = ($('/') || $('*'))) && (a = $(this.operand))) {
operation = new(tree.Operation)(op, [operation || m, a]);
}
return operation || m;
Expand Down
6 changes: 4 additions & 2 deletions test/css/comments.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
Comment

*/
/*
/*
* Comment Test
*
*
* - cloudhead (http://cloudhead.net)
*
*/
Expand Down Expand Up @@ -46,6 +46,8 @@
*/
.selector, .lots, .comments {
color: grey, /* blue */ orange;
-webkit-border-radius: 2px /* webkit only */;
-moz-border-radius: 8px /* moz only with operation */;
}
#last {
color: blue;
Expand Down
14 changes: 8 additions & 6 deletions test/less/comments.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

*/

/*
/*
* Comment Test
*
*
* - cloudhead (http://cloudhead.net)
*
*/
Expand All @@ -35,15 +35,15 @@
/* @group Variables
------------------- */
#comments /* boo */ {
/**/ // An empty comment
/**/ // An empty comment
color: red; /* A C-style comment */
background-color: orange; // A little comment
font-size: 12px;

/* lost comment */ content: @var;

border: 1px solid black;

// padding & margin //
padding: 0; // }{ '"
margin: 2em;
Expand All @@ -57,6 +57,8 @@

.selector /* .with */, .lots, /* of */ .comments {
color: grey, /* blue */ orange;
-webkit-border-radius: 2px /* webkit only */;
-moz-border-radius: 2px * 4 /* moz only with operation */;
}

#last { color: blue }
Expand Down