less 2.6.0 → 2.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/.travis.yml +3 -2
  2. package/CHANGELOG.md +30 -2
  3. package/Gruntfile.js +2 -3
  4. package/README.md +2 -2
  5. package/appveyor.yml +1 -0
  6. package/bin/lessc +47 -23
  7. package/dist/less.js +914 -582
  8. package/dist/less.min.js +9 -12
  9. package/lib/less/environment/abstract-file-manager.js +2 -2
  10. package/lib/less/functions/color.js +6 -3
  11. package/lib/less/index.js +1 -1
  12. package/lib/less/parser/parser-input.js +69 -69
  13. package/lib/less/parser/parser.js +111 -51
  14. package/lib/less/tree/anonymous.js +1 -1
  15. package/lib/less/tree/call.js +7 -4
  16. package/lib/less/tree/comment.js +2 -0
  17. package/lib/less/tree/directive.js +1 -0
  18. package/lib/less/tree/extend.js +1 -0
  19. package/lib/less/tree/import.js +1 -0
  20. package/lib/less/tree/media.js +1 -0
  21. package/lib/less/tree/mixin-call.js +1 -0
  22. package/lib/less/tree/mixin-definition.js +2 -1
  23. package/lib/less/tree/rule.js +1 -0
  24. package/lib/less/tree/ruleset-call.js +1 -0
  25. package/lib/less/tree/ruleset.js +86 -85
  26. package/lib/less/tree/unit.js +2 -2
  27. package/lib/less/visitors/extend-visitor.js +5 -5
  28. package/lib/less/visitors/to-css-visitor.js +20 -10
  29. package/lib/less-browser/error-reporting.js +10 -10
  30. package/lib/less-browser/index.js +48 -25
  31. package/lib/less-node/file-manager.js +1 -1
  32. package/lib/less-node/lessc-helper.js +2 -2
  33. package/lib/source-map/source-map-0.1.31.js +1 -1
  34. package/package.json +29 -22
  35. package/test/browser/common.js +29 -8
  36. package/test/browser/less/console-errors/test-error.txt +1 -1
  37. package/test/browser/less.js +13 -16
  38. package/test/browser/runner-production-options.js +1 -1
  39. package/test/css/comments2.css +6 -0
  40. package/test/css/no-strict-math/mixins-guards.css +12 -0
  41. package/test/css/no-strict-math/no-sm-operations.css +3 -0
  42. package/test/css/operations.css +1 -1
  43. package/test/css/plugin.css +5 -0
  44. package/test/less/comments.less +1 -1
  45. package/test/less/comments2.less +11 -0
  46. package/test/less/errors/detached-ruleset-3.txt +1 -1
  47. package/test/less/errors/functions-1.less +2 -0
  48. package/test/less/errors/functions-1.txt +3 -0
  49. package/test/less/errors/functions-10-keyword.less +2 -0
  50. package/test/less/errors/functions-10-keyword.txt +3 -0
  51. package/test/less/errors/functions-11-operation.less +2 -0
  52. package/test/less/errors/functions-11-operation.txt +3 -0
  53. package/test/less/errors/functions-12-quoted.less +2 -0
  54. package/test/less/errors/functions-12-quoted.txt +3 -0
  55. package/test/less/errors/functions-13-selector.less +2 -0
  56. package/test/less/errors/functions-13-selector.txt +3 -0
  57. package/test/less/errors/functions-14-url.less +2 -0
  58. package/test/less/errors/functions-14-url.txt +3 -0
  59. package/test/less/errors/functions-15-value.less +2 -0
  60. package/test/less/errors/functions-15-value.txt +3 -0
  61. package/test/less/errors/functions-2-alpha.less +2 -0
  62. package/test/less/errors/functions-2-alpha.txt +3 -0
  63. package/test/less/errors/functions-3-assignment.less +2 -0
  64. package/test/less/errors/functions-3-assignment.txt +3 -0
  65. package/test/less/errors/functions-4-call.less +2 -0
  66. package/test/less/errors/functions-4-call.txt +3 -0
  67. package/test/less/errors/functions-5-color-2.less +1 -0
  68. package/test/less/errors/functions-5-color-2.txt +2 -0
  69. package/test/less/errors/functions-5-color.less +2 -0
  70. package/test/less/errors/functions-5-color.txt +3 -0
  71. package/test/less/errors/functions-6-condition.less +2 -0
  72. package/test/less/errors/functions-6-condition.txt +3 -0
  73. package/test/less/errors/functions-7-dimension.less +2 -0
  74. package/test/less/errors/functions-7-dimension.txt +3 -0
  75. package/test/less/errors/functions-8-element.less +2 -0
  76. package/test/less/errors/functions-8-element.txt +3 -0
  77. package/test/less/errors/functions-9-expression.less +2 -0
  78. package/test/less/errors/functions-9-expression.txt +3 -0
  79. package/test/less/errors/property-in-root.txt +1 -1
  80. package/test/less/errors/property-in-root2.txt +1 -1
  81. package/test/less/errors/property-in-root3.txt +1 -1
  82. package/test/less/errors/root-func-undefined-1.less +1 -0
  83. package/test/less/errors/root-func-undefined-1.txt +2 -0
  84. package/test/less/errors/root-func-undefined-2.less +2 -0
  85. package/test/less/errors/root-func-undefined-2.txt +3 -0
  86. package/test/less/extend-chaining.less +1 -1
  87. package/test/less/merge.less +4 -4
  88. package/test/less/mixins-guards.less +1 -1
  89. package/test/less/no-strict-math/mixins-guards.less +25 -0
  90. package/test/less/no-strict-math/no-sm-operations.less +4 -1
  91. package/test/less/operations.less +1 -1
  92. package/test/less/plugin/plugin-tree-nodes.js +80 -0
  93. package/test/less/plugin.less +8 -0
  94. package/test/less-bom/comments.less +1 -1
  95. package/test/less-bom/comments2.less +11 -0
  96. package/test/less-bom/errors/detached-ruleset-3.txt +1 -1
  97. package/test/less-bom/errors/functions-1.less +2 -0
  98. package/test/less-bom/errors/functions-1.txt +3 -0
  99. package/test/less-bom/errors/functions-10-keyword.less +2 -0
  100. package/test/less-bom/errors/functions-10-keyword.txt +3 -0
  101. package/test/less-bom/errors/functions-11-operation.less +2 -0
  102. package/test/less-bom/errors/functions-11-operation.txt +3 -0
  103. package/test/less-bom/errors/functions-12-quoted.less +2 -0
  104. package/test/less-bom/errors/functions-12-quoted.txt +3 -0
  105. package/test/less-bom/errors/functions-13-selector.less +2 -0
  106. package/test/less-bom/errors/functions-13-selector.txt +3 -0
  107. package/test/less-bom/errors/functions-14-url.less +2 -0
  108. package/test/less-bom/errors/functions-14-url.txt +3 -0
  109. package/test/less-bom/errors/functions-15-value.less +2 -0
  110. package/test/less-bom/errors/functions-15-value.txt +3 -0
  111. package/test/less-bom/errors/functions-2-alpha.less +2 -0
  112. package/test/less-bom/errors/functions-2-alpha.txt +3 -0
  113. package/test/less-bom/errors/functions-3-assignment.less +2 -0
  114. package/test/less-bom/errors/functions-3-assignment.txt +3 -0
  115. package/test/less-bom/errors/functions-4-call.less +2 -0
  116. package/test/less-bom/errors/functions-4-call.txt +3 -0
  117. package/test/less-bom/errors/functions-5-color-2.less +1 -0
  118. package/test/less-bom/errors/functions-5-color-2.txt +2 -0
  119. package/test/less-bom/errors/functions-5-color.less +2 -0
  120. package/test/less-bom/errors/functions-5-color.txt +3 -0
  121. package/test/less-bom/errors/functions-6-condition.less +2 -0
  122. package/test/less-bom/errors/functions-6-condition.txt +3 -0
  123. package/test/less-bom/errors/functions-7-dimension.less +2 -0
  124. package/test/less-bom/errors/functions-7-dimension.txt +3 -0
  125. package/test/less-bom/errors/functions-8-element.less +2 -0
  126. package/test/less-bom/errors/functions-8-element.txt +3 -0
  127. package/test/less-bom/errors/functions-9-expression.less +2 -0
  128. package/test/less-bom/errors/functions-9-expression.txt +3 -0
  129. package/test/less-bom/errors/property-in-root.txt +1 -1
  130. package/test/less-bom/errors/property-in-root2.txt +1 -1
  131. package/test/less-bom/errors/property-in-root3.txt +1 -1
  132. package/test/less-bom/errors/root-func-undefined-1.less +1 -0
  133. package/test/less-bom/errors/root-func-undefined-1.txt +2 -0
  134. package/test/less-bom/errors/root-func-undefined-2.less +2 -0
  135. package/test/less-bom/errors/root-func-undefined-2.txt +3 -0
  136. package/test/less-bom/extend-chaining.less +1 -1
  137. package/test/less-bom/merge.less +4 -4
  138. package/test/less-bom/mixins-guards.less +1 -1
  139. package/test/less-bom/no-strict-math/mixins-guards.less +25 -0
  140. package/test/less-bom/no-strict-math/no-sm-operations.less +4 -1
  141. package/test/less-bom/operations.less +1 -1
  142. package/test/less-bom/plugin/plugin-tree-nodes.js +80 -0
  143. package/test/less-bom/plugin.less +8 -0
  144. package/test/sourcemaps/maps/import-map.map +1 -0
@@ -1,3 +1,3 @@
1
- var less = {logLevel: 4,
1
+ var less = {logLevel: 1,
2
2
  errorReporting: "console"};
3
3
  less.env = "production";
@@ -10,3 +10,9 @@
10
10
  margin: 10px;
11
11
  total-width: (1 * 6em * 12) + (2em * 12);
12
12
  }
13
+ .some-inline-comments {
14
+ a: yes /* comment */;
15
+ b: red /* comment */;
16
+ c: yes /* comment */;
17
+ d: red /* comment */;
18
+ }
@@ -0,0 +1,12 @@
1
+ .test-2798 {
2
+ regression: fixed;
3
+ }
4
+ .conditions-parser-1 {
5
+ only-atomic: ok;
6
+ }
7
+ .conditions-parser-2 {
8
+ only-atomic-with-nested-parenthesis: ok;
9
+ }
10
+ .conditions-parser-3 {
11
+ only-atomic-nested-parenthesis-on-right: ok;
12
+ }
@@ -3,6 +3,9 @@
3
3
  color-1: #000101;
4
4
  color-2: #ff0000;
5
5
  color-3: #ff0000;
6
+ background-color: blue-2;
7
+ color: green-black;
8
+ animation: blue-change 5s infinite;
6
9
  }
7
10
  .named-colors-in-expressions-bar-red {
8
11
  x: y;
@@ -3,7 +3,7 @@
3
3
  color-2: #f8f800;
4
4
  height: 9px;
5
5
  width: 3em;
6
- substraction: 0;
6
+ subtraction: 0;
7
7
  division: 1;
8
8
  }
9
9
  #operations .spacing {
@@ -1,3 +1,4 @@
1
+ @charset "utf-8";
1
2
  .other {
2
3
  trans: transitive;
3
4
  }
@@ -42,3 +43,7 @@
42
43
  result: local;
43
44
  }
44
45
  }
46
+ .root {
47
+ prop: value;
48
+ }
49
+ @arbitrary value after ();
@@ -95,7 +95,7 @@
95
95
 
96
96
  /* *//* { *//* *//* *//* */#div { color:#A33; }/* } */
97
97
 
98
- // line immediatly followed
98
+ // line immediately followed
99
99
  /*by block */
100
100
  @string_w_comment: ~"/* // Not commented out // */";
101
101
  #output-block { comment: @string_w_comment; }
@@ -18,3 +18,14 @@
18
18
  @gutter-width * // We strongly recommend you */
19
19
  @columns); // do not change this formula. */
20
20
  @total-width : @gridsystem-width; // set to 100% for fluid grid */
21
+
22
+ // .............................................................................
23
+
24
+ .some-inline-comments {
25
+ a: yes /* comment */;
26
+ b: red /* comment */;
27
+ @c: yes /* comment */;
28
+ @d: red /* comment */;
29
+ c: @c;
30
+ d: @d;
31
+ }
@@ -1,4 +1,4 @@
1
- SyntaxError: properties must be inside selector blocks, they cannot be in the root. in {path}detached-ruleset-3.less on line 2, column 3:
1
+ SyntaxError: Properties must be inside selector blocks. They cannot be in the root in {path}detached-ruleset-3.less on line 2, column 3:
2
2
  1 @a: {
3
3
  2 b: 1;
4
4
  3 };
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-undefined();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Function 'test-undefined' is undefined in {path}functions-1.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-undefined();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-keyword();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Keyword node returned by a function is not valid here in {path}functions-10-keyword.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-keyword();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-operation();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Operation node returned by a function is not valid here in {path}functions-11-operation.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-operation();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-quoted();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Quoted node returned by a function is not valid here in {path}functions-12-quoted.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-quoted();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-selector();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Selector node returned by a function is not valid here in {path}functions-13-selector.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-selector();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-url();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Url node returned by a function is not valid here in {path}functions-14-url.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-url();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-value();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Value node returned by a function is not valid here in {path}functions-15-value.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-value();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-alpha();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Alpha node returned by a function is not valid here in {path}functions-2-alpha.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-alpha();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-assignment();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Assignment node returned by a function is not valid here in {path}functions-3-assignment.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-assignment();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-call();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Function 'foo' is undefined in {path}functions-4-call.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-call();
@@ -0,0 +1 @@
1
+ rgba(0,0,0,0);
@@ -0,0 +1,2 @@
1
+ SyntaxError: Color node returned by a function is not valid here in {path}functions-5-color-2.less on line 1, column 1:
2
+ 1 rgba(0,0,0,0);
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-color();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Color node returned by a function is not valid here in {path}functions-5-color.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-color();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-condition();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Condition node returned by a function is not valid here in {path}functions-6-condition.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-condition();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-dimension();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Dimension node returned by a function is not valid here in {path}functions-7-dimension.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-dimension();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-element();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Element node returned by a function is not valid here in {path}functions-8-element.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-element();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-expression();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Expression node returned by a function is not valid here in {path}functions-9-expression.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-expression();
@@ -1,4 +1,4 @@
1
- SyntaxError: properties must be inside selector blocks, they cannot be in the root. in {path}property-in-root.less on line 2, column 3:
1
+ SyntaxError: Properties must be inside selector blocks. They cannot be in the root in {path}property-in-root.less on line 2, column 3:
2
2
  1 .a() {
3
3
  2 prop:1;
4
4
  3 }
@@ -1,4 +1,4 @@
1
- SyntaxError: properties must be inside selector blocks, they cannot be in the root. in {path}property-in-root.less on line 2, column 3:
1
+ SyntaxError: Properties must be inside selector blocks. They cannot be in the root in {path}property-in-root.less on line 2, column 3:
2
2
  1 .a() {
3
3
  2 prop:1;
4
4
  3 }
@@ -1,3 +1,3 @@
1
- SyntaxError: properties must be inside selector blocks, they cannot be in the root. in {path}property-in-root3.less on line 1, column 1:
1
+ SyntaxError: Properties must be inside selector blocks. They cannot be in the root in {path}property-in-root3.less on line 1, column 1:
2
2
  1 prop:1;
3
3
  2 .a {
@@ -0,0 +1 @@
1
+ func();
@@ -0,0 +1,2 @@
1
+ SyntaxError: Function 'func' is undefined in {path}root-func-undefined-1.less on line 1, column 1:
2
+ 1 func();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes.js";
2
+ test-undefined();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Function 'test-undefined' is undefined in {path}root-func-undefined-2.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes.js";
3
+ 2 test-undefined();
@@ -71,7 +71,7 @@
71
71
  &:extend(.vb);
72
72
  }
73
73
 
74
- // media queries - dont extend outside, do extend inside
74
+ // media queries - don't extend outside, do extend inside
75
75
 
76
76
  @media tv {
77
77
  .ma:extend(.a,.b,.c,.d,.e,.f,.g,.h,.i,.j,.k,.l,.m,.n,.o,.p,.q,.r,.s,.t,.u,.v,.w,.x,.y,.z,.md) {
@@ -26,22 +26,22 @@
26
26
  .second-transform();
27
27
  }
28
28
  .test2 {
29
- // Wont merge values without +: merge directive, for backwards compatibility with css
29
+ // Won't merge values without +: merge directive, for backwards compatibility with css
30
30
  .first-transform();
31
31
  .third-transform();
32
32
  }
33
33
  .test3 {
34
- // Wont merge values from two sources with different properties
34
+ // Won't merge values from two sources with different properties
35
35
  .fourth-transform();
36
36
  .first-background();
37
37
  }
38
38
  .test4 {
39
- // Wont merge values from sources that merked as !important, for backwards compatibility with css
39
+ // Won't merge values from sources that merked as !important, for backwards compatibility with css
40
40
  .first-transform();
41
41
  .fifth-transform();
42
42
  }
43
43
  .test5 {
44
- // Wont merge values from mixins that merked as !important, for backwards compatibility with css
44
+ // Won't merge values from mixins that merked as !important, for backwards compatibility with css
45
45
  .first-transform();
46
46
  .second-transform() !important;
47
47
  }
@@ -278,7 +278,7 @@
278
278
  .guarded-mixin-for-root() when (@guarded-mixin-for-root) {}
279
279
  }
280
280
  #ns > .guarded-mixin-for-root();
281
- // various combinations of nested or, and, paranthesis and negation
281
+ // various combinations of nested or, and, parenthesis and negation
282
282
  .parenthesisNot(@value) when ((((@value)))) {
283
283
  parenthesisNot: just-value;
284
284
  }
@@ -0,0 +1,25 @@
1
+ // https://github.com/less/less.js/issues/2798
2
+ .test-2798 when ((8+4) < 13) {
3
+ regression: fixed;
4
+ }
5
+ .test-2798 when ((8+6) < 13) {
6
+ regression: should not be visible;
7
+ }
8
+ .conditions-parser-1 when (8+4 < 13) {
9
+ only-atomic: ok;
10
+ }
11
+ .conditions-parser-1 when (8+6 < 13) {
12
+ only-atomic: should not be visible;
13
+ }
14
+ .conditions-parser-2 when (8+(5-1) < 13) {
15
+ only-atomic-with-nested-parenthesis: ok;
16
+ }
17
+ .conditions-parser-2 when (8+(15-1) < 13) {
18
+ only-atomic-with-nested-parenthesis: should not be visible;
19
+ }
20
+ .conditions-parser-3 when (8 < (13+1)) {
21
+ only-atomic-nested-parenthesis-on-right: ok;
22
+ }
23
+ .conditions-parser-3 when (8 < (3+1)) {
24
+ only-atomic-nested-parenthesis-on-right: should not be visible;
25
+ }
@@ -6,5 +6,8 @@
6
6
  @3: -red;
7
7
  &-bar@{3} {x: y}
8
8
  @color: red;
9
- &-bar@{color} {a: a}
9
+ &-bar@{color} {a: a};
10
+ background-color: blue-2;
11
+ color: green-black;
12
+ animation: blue-change 5s infinite;
10
13
  }
@@ -7,7 +7,7 @@
7
7
  height: (10px / 2px+6px-1px*2);
8
8
  width: (2 * 4-5em);
9
9
  }
10
- substraction: (20 - 10 - 5 - 5); // 0
10
+ subtraction: (20 - 10 - 5 - 5); // 0
11
11
  division: (20 / 5 / 4); // 1
12
12
  }
13
13
 
@@ -0,0 +1,80 @@
1
+ functions.addMultiple({
2
+
3
+ "test-comment": function() {
4
+ return new tree.Combinator(' ');
5
+ },
6
+ "test-directive": function(arg1, arg2) {
7
+ return new tree.Directive(arg1.value, new tree.Anonymous(arg2.value));
8
+ },
9
+ "test-extend": function() {
10
+ //TODO
11
+ },
12
+ "test-import": function() {
13
+ //TODO
14
+ },
15
+ "test-media": function() {
16
+ //TODO
17
+ },
18
+ "test-mixin-call": function() {
19
+ //TODO
20
+ },
21
+ "test-mixin-definition": function() {
22
+ //TODO
23
+ },
24
+ "test-ruleset-call": function() {
25
+ return new tree.Combinator(' ');
26
+ },
27
+ // Functions must return something. Must 'return true' if they produce no output.
28
+ "test-undefined": function() { },
29
+
30
+ // These cause root errors
31
+ "test-alpha": function() {
32
+ return new tree.Alpha(30);
33
+ },
34
+ "test-assignment": function() {
35
+ return new tree.Assignment("bird", "robin");
36
+ },
37
+ "test-attribute": function() {
38
+ return new tree.Attribute("foo", "=", "bar");
39
+ },
40
+ "test-call": function() {
41
+ return new tree.Call("foo");
42
+ },
43
+ "test-color": function() {
44
+ return new tree.Color([50, 50, 50]);
45
+ },
46
+ "test-condition": function() {
47
+ return new tree.Condition('<', new tree.Value([0]), new tree.Value([1]));
48
+ },
49
+ "test-detached-ruleset" : function() {
50
+ var rule = new tree.Rule('prop', new tree.Anonymous('value'));
51
+ return new tree.DetachedRuleset(new tree.Ruleset("", [ rule ]));
52
+ },
53
+ "test-dimension": function() {
54
+ return new tree.Dimension(1, 'px');
55
+ },
56
+ "test-element": function() {
57
+ return new tree.Element('+', 'a');
58
+ },
59
+ "test-expression": function() {
60
+ return new tree.Expression([1, 2, 3]);
61
+ },
62
+ "test-keyword": function() {
63
+ return new tree.Keyword('foo');
64
+ },
65
+ "test-operation": function() {
66
+ return new tree.Operation('+', [1, 2]);
67
+ },
68
+ "test-quoted": function() {
69
+ return new tree.Quoted('"', 'foo');
70
+ },
71
+ "test-selector": function() {
72
+ return new tree.Selector([new tree.Element('a')]);
73
+ },
74
+ "test-url": function() {
75
+ return new tree.URL('http://google.com');
76
+ },
77
+ "test-value": function() {
78
+ return new tree.Value([1]);
79
+ }
80
+ });
@@ -81,5 +81,13 @@
81
81
  }
82
82
  }
83
83
 
84
+ @plugin "./plugin/plugin-tree-nodes";
85
+ @ruleset2: test-detached-ruleset();
86
+ .root {
87
+ @ruleset2();
88
+ }
89
+
90
+ test-directive("@charset"; '"utf-8"');
91
+ test-directive("@arbitrary"; "value after ()");
84
92
 
85
93
 
@@ -95,7 +95,7 @@
95
95
 
96
96
  /* *//* { *//* *//* *//* */#div { color:#A33; }/* } */
97
97
 
98
- // line immediatly followed
98
+ // line immediately followed
99
99
  /*by block */
100
100
  @string_w_comment: ~"/* // Not commented out // */";
101
101
  #output-block { comment: @string_w_comment; }
@@ -18,3 +18,14 @@
18
18
  @gutter-width * // We strongly recommend you */
19
19
  @columns); // do not change this formula. */
20
20
  @total-width : @gridsystem-width; // set to 100% for fluid grid */
21
+
22
+ // .............................................................................
23
+
24
+ .some-inline-comments {
25
+ a: yes /* comment */;
26
+ b: red /* comment */;
27
+ @c: yes /* comment */;
28
+ @d: red /* comment */;
29
+ c: @c;
30
+ d: @d;
31
+ }
@@ -1,4 +1,4 @@
1
- SyntaxError: properties must be inside selector blocks, they cannot be in the root. in {path}detached-ruleset-3.less on line 2, column 3:
1
+ SyntaxError: Properties must be inside selector blocks. They cannot be in the root in {path}detached-ruleset-3.less on line 2, column 3:
2
2
  1 @a: {
3
3
  2 b: 1;
4
4
  3 };
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-undefined();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Function 'test-undefined' is undefined in {path}functions-1.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-undefined();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-keyword();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Keyword node returned by a function is not valid here in {path}functions-10-keyword.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-keyword();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-operation();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Operation node returned by a function is not valid here in {path}functions-11-operation.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-operation();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-quoted();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Quoted node returned by a function is not valid here in {path}functions-12-quoted.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-quoted();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-selector();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Selector node returned by a function is not valid here in {path}functions-13-selector.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-selector();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-url();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Url node returned by a function is not valid here in {path}functions-14-url.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-url();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-value();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Value node returned by a function is not valid here in {path}functions-15-value.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-value();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-alpha();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Alpha node returned by a function is not valid here in {path}functions-2-alpha.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-alpha();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-assignment();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Assignment node returned by a function is not valid here in {path}functions-3-assignment.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-assignment();
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-call();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Function 'foo' is undefined in {path}functions-4-call.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-call();
@@ -0,0 +1 @@
1
+ rgba(0,0,0,0);
@@ -0,0 +1,2 @@
1
+ SyntaxError: Color node returned by a function is not valid here in {path}functions-5-color-2.less on line 1, column 1:
2
+ 1 rgba(0,0,0,0);
@@ -0,0 +1,2 @@
1
+ @plugin "../plugin/plugin-tree-nodes";
2
+ test-color();
@@ -0,0 +1,3 @@
1
+ SyntaxError: Color node returned by a function is not valid here in {path}functions-5-color.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes";
3
+ 2 test-color();