From 96f6175e914c834ddef2d9b8855d97f3e19a6371 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Mon, 12 Sep 2022 19:46:55 -0700 Subject: [PATCH] Update specs for strict unary deprecation Closes #1792 --- .../issue_1739/basic.hrx | 20 + .../issue_1739/interpolate/both.hrx | 59 ++- .../issue_1739/interpolate/left.hrx | 40 +- .../issue_1739/interpolate/right.hrx | 40 +- spec/libsass-closed-issues/issue_893.hrx | 20 + .../operations/addition/dimensions/pairs.hrx | 400 ++++++++++++++++++ .../operations/addition/numbers/pairs.hrx | 191 +++++++++ .../operations/addition/strings/pairs.hrx | 286 +++++++++++++ .../operations/subtract/strings/pairs.hrx | 39 ++ .../interpolation-operators-precedence.hrx | 190 +++++++++ spec/operators/minus.hrx | 164 +++++++ spec/operators/plus.hrx | 156 +++++++ 12 files changed, 1602 insertions(+), 3 deletions(-) create mode 100644 spec/operators/minus.hrx create mode 100644 spec/operators/plus.hrx diff --git a/spec/libsass-closed-issues/issue_1739/basic.hrx b/spec/libsass-closed-issues/issue_1739/basic.hrx index 997b13fc97..2221db84f6 100644 --- a/spec/libsass-closed-issues/issue_1739/basic.hrx +++ b/spec/libsass-closed-issues/issue_1739/basic.hrx @@ -104,3 +104,23 @@ mod { baz: 2; baz: 2; } + +<===> warning +DEPRECATION WARNING on line 11, column 8 of input.scss: +This operation is parsed as: + + 2 + 3 + +but you may have intended it to mean: + + 2 (+3) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +11 | baz: 2 +3; + | ^^^^^ + ' diff --git a/spec/libsass-closed-issues/issue_1739/interpolate/both.hrx b/spec/libsass-closed-issues/issue_1739/interpolate/both.hrx index 497c33532f..fc0187b1df 100644 --- a/spec/libsass-closed-issues/issue_1739/interpolate/both.hrx +++ b/spec/libsass-closed-issues/issue_1739/interpolate/both.hrx @@ -39,9 +39,66 @@ mod { baz: #{1 % 2} % #{1 % 2}; } <===> error +DEPRECATION WARNING on line 11, column 10 of input.scss: +This operation is parsed as: + + 1 + 2 + +but you may have intended it to mean: + + 1 (+2) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +11 | baz: #{1 +2} +#{1 +2}; + | ^^^^^ + ' + +DEPRECATION WARNING on line 11, column 21 of input.scss: +This operation is parsed as: + + 1 + 2 + +but you may have intended it to mean: + + 1 (+2) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +11 | baz: #{1 +2} +#{1 +2}; + | ^^^^^ + ' + +DEPRECATION WARNING on line 11, column 8 of input.scss: +This operation is parsed as: + + #{1 + 2} + #{1 + 2} + +but you may have intended it to mean: + + #{1 + 2} (+#{1 + 2}) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +11 | baz: #{1 +2} +#{1 +2}; + | ^^^^^^^^^^^^^^^^^^^ + ' + Error: Undefined operation "2 * 2". , -23 | baz: #{1*2}*#{1*2}; +23 | baz: #{1*2}*#{1*2}; | ^^^^^^^^^^^^^ ' input.scss 23:8 root stylesheet diff --git a/spec/libsass-closed-issues/issue_1739/interpolate/left.hrx b/spec/libsass-closed-issues/issue_1739/interpolate/left.hrx index 3d55468238..00f41c9a50 100644 --- a/spec/libsass-closed-issues/issue_1739/interpolate/left.hrx +++ b/spec/libsass-closed-issues/issue_1739/interpolate/left.hrx @@ -39,9 +39,47 @@ mod { baz: #{1 % 2} % 3; } <===> error +DEPRECATION WARNING on line 11, column 10 of input.scss: +This operation is parsed as: + + 1 + 2 + +but you may have intended it to mean: + + 1 (+2) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +11 | baz: #{1 +2} +3; + | ^^^^^ + ' + +DEPRECATION WARNING on line 11, column 8 of input.scss: +This operation is parsed as: + + #{1 + 2} + 3 + +but you may have intended it to mean: + + #{1 + 2} (+3) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +11 | baz: #{1 +2} +3; + | ^^^^^^^^^^^^ + ' + Error: Undefined operation "2 * 3". , -23 | baz: #{1*2}*3; +23 | baz: #{1*2}*3; | ^^^^^^^^ ' input.scss 23:8 root stylesheet diff --git a/spec/libsass-closed-issues/issue_1739/interpolate/right.hrx b/spec/libsass-closed-issues/issue_1739/interpolate/right.hrx index 0f02ddef92..65e28746b3 100644 --- a/spec/libsass-closed-issues/issue_1739/interpolate/right.hrx +++ b/spec/libsass-closed-issues/issue_1739/interpolate/right.hrx @@ -39,9 +39,47 @@ mod { baz: 3 % #{1 % 2}; } <===> error +DEPRECATION WARNING on line 11, column 14 of input.scss: +This operation is parsed as: + + 1 + 2 + +but you may have intended it to mean: + + 1 (+2) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +11 | baz: 3 +#{1 +2}; + | ^^^^^ + ' + +DEPRECATION WARNING on line 11, column 8 of input.scss: +This operation is parsed as: + + 3 + #{1 + 2} + +but you may have intended it to mean: + + 3 (+#{1 + 2}) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +11 | baz: 3 +#{1 +2}; + | ^^^^^^^^^^^^ + ' + Error: Undefined operation "3 * 2". , -23 | baz: 3*#{1*2}; +23 | baz: 3*#{1*2}; | ^^^^^^^^ ' input.scss 23:8 root stylesheet diff --git a/spec/libsass-closed-issues/issue_893.hrx b/spec/libsass-closed-issues/issue_893.hrx index 6f0f9d7025..0bf557140a 100644 --- a/spec/libsass-closed-issues/issue_893.hrx +++ b/spec/libsass-closed-issues/issue_893.hrx @@ -8,3 +8,23 @@ $gutter: 20px; .row { margin: -20px; } + +<===> warning +DEPRECATION WARNING on line 4, column 11 of input.scss: +This operation is parsed as: + + 0 - $gutter + +but you may have intended it to mean: + + 0 (-$gutter) + +Add a space after - to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +4 | margin: 0 -$gutter; + | ^^^^^^^^^^ + ' diff --git a/spec/non_conformant/parser/operations/addition/dimensions/pairs.hrx b/spec/non_conformant/parser/operations/addition/dimensions/pairs.hrx index c2fd16dfba..8016663df8 100644 --- a/spec/non_conformant/parser/operations/addition/dimensions/pairs.hrx +++ b/spec/non_conformant/parser/operations/addition/dimensions/pairs.hrx @@ -266,3 +266,403 @@ foo { test-83: 10 px10 px; test-84: 10 px10 px; } + +<===> warning +DEPRECATION WARNING on line 3, column 11 of input.scss: +This operation is parsed as: + + 10 + 10 + +but you may have intended it to mean: + + 10 (+10) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +3 | test-2: 10 +10; + | ^^^^^^ + ' + +DEPRECATION WARNING on line 7, column 11 of input.scss: +This operation is parsed as: + + 10 + 10px + +but you may have intended it to mean: + + 10 (+10px) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +7 | test-6: 10 +10px; + | ^^^^^^^^ + ' + +DEPRECATION WARNING on line 11, column 12 of input.scss: +This operation is parsed as: + + 10 + #{10}px + +but you may have intended it to mean: + + 10 (+#{10}px) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +11 | test-10: 10 +#{10}px; + | ^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 15, column 12 of input.scss: +This operation is parsed as: + + 10 + 1 + +but you may have intended it to mean: + + 10 (+1) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +15 | test-14: 10 +1#{0}px; + | ^^^^^ + ' + +DEPRECATION WARNING on line 19, column 12 of input.scss: +This operation is parsed as: + + 10 + 10 + +but you may have intended it to mean: + + 10 (+10) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +19 | test-18: 10 +10#{px}; + | ^^^^^^ + ' + +DEPRECATION WARNING on line 23, column 12 of input.scss: +This operation is parsed as: + + 10 + 10 + +but you may have intended it to mean: + + 10 (+10) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +23 | test-22: 10 +10#{p}x; + | ^^^^^^ + ' + +DEPRECATION WARNING on line 27, column 12 of input.scss: +This operation is parsed as: + + 10px + 10px + +but you may have intended it to mean: + + 10px (+10px) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +27 | test-26: 10px +10px; + | ^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 31, column 12 of input.scss: +This operation is parsed as: + + 10px + #{10}px + +but you may have intended it to mean: + + 10px (+#{10}px) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +31 | test-30: 10px +#{10}px; + | ^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 35, column 12 of input.scss: +This operation is parsed as: + + 10px + 1 + +but you may have intended it to mean: + + 10px (+1) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +35 | test-34: 10px +1#{0}px; + | ^^^^^^^ + ' + +DEPRECATION WARNING on line 39, column 12 of input.scss: +This operation is parsed as: + + 10px + 10 + +but you may have intended it to mean: + + 10px (+10) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +39 | test-38: 10px +10#{px}; + | ^^^^^^^^ + ' + +DEPRECATION WARNING on line 43, column 12 of input.scss: +This operation is parsed as: + + 10px + 10 + +but you may have intended it to mean: + + 10px (+10) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +43 | test-42: 10px +10#{p}x; + | ^^^^^^^^ + ' + +DEPRECATION WARNING on line 47, column 12 of input.scss: +This operation is parsed as: + + #{10}px + #{10}px + +but you may have intended it to mean: + + #{10}px (+#{10}px) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +47 | test-46: #{10}px +#{10}px; + | ^^^^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 51, column 12 of input.scss: +This operation is parsed as: + + #{10}px + 1 + +but you may have intended it to mean: + + #{10}px (+1) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +51 | test-50: #{10}px +1#{0}px; + | ^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 55, column 12 of input.scss: +This operation is parsed as: + + #{10}px + 10 + +but you may have intended it to mean: + + #{10}px (+10) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +55 | test-54: #{10}px +10#{px}; + | ^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 59, column 12 of input.scss: +This operation is parsed as: + + #{10}px + 10 + +but you may have intended it to mean: + + #{10}px (+10) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +59 | test-58: #{10}px +10#{p}x; + | ^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 63, column 13 of input.scss: +This operation is parsed as: + + #{0}px + 1 + +but you may have intended it to mean: + + #{0}px (+1) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +63 | test-62: 1#{0}px +1#{0}px; + | ^^^^^^^^^ + ' + +DEPRECATION WARNING on line 67, column 13 of input.scss: +This operation is parsed as: + + #{0}px + 10 + +but you may have intended it to mean: + + #{0}px (+10) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +67 | test-66: 1#{0}px +10#{px}; + | ^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 71, column 13 of input.scss: +This operation is parsed as: + + #{0}px + 10 + +but you may have intended it to mean: + + #{0}px (+10) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +71 | test-70: 1#{0}px +10#{p}x; + | ^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 75, column 14 of input.scss: +This operation is parsed as: + + #{px} + 10 + +but you may have intended it to mean: + + #{px} (+10) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +75 | test-74: 10#{px} +10#{px}; + | ^^^^^^^^^ + ' + +DEPRECATION WARNING on line 79, column 14 of input.scss: +This operation is parsed as: + + #{px} + 10 + +but you may have intended it to mean: + + #{px} (+10) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +79 | test-78: 10#{px} +10#{p}x; + | ^^^^^^^^^ + ' + +DEPRECATION WARNING on line 83, column 14 of input.scss: +This operation is parsed as: + + #{p}x + 10 + +but you may have intended it to mean: + + #{p}x (+10) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +83 | test-82: 10#{p}x +10#{p}x; + | ^^^^^^^^^ + ' diff --git a/spec/non_conformant/parser/operations/addition/numbers/pairs.hrx b/spec/non_conformant/parser/operations/addition/numbers/pairs.hrx index 16c94e779c..b50c7ca869 100644 --- a/spec/non_conformant/parser/operations/addition/numbers/pairs.hrx +++ b/spec/non_conformant/parser/operations/addition/numbers/pairs.hrx @@ -134,3 +134,194 @@ foo { test-39: 1010; test-40: 1010; } + +<===> warning +DEPRECATION WARNING on line 3, column 11 of input.scss: +This operation is parsed as: + + 10 + 10 + +but you may have intended it to mean: + + 10 (+10) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +3 | test-2: 10 +10; + | ^^^^^^ + ' + +DEPRECATION WARNING on line 7, column 11 of input.scss: +This operation is parsed as: + + 10 + #{10} + +but you may have intended it to mean: + + 10 (+#{10}) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +7 | test-6: 10 +#{10}; + | ^^^^^^^^^ + ' + +DEPRECATION WARNING on line 11, column 12 of input.scss: +This operation is parsed as: + + 10 + 1 + +but you may have intended it to mean: + + 10 (+1) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +11 | test-10: 10 +1#{0}; + | ^^^^^ + ' + +DEPRECATION WARNING on line 15, column 12 of input.scss: +This operation is parsed as: + + 10 + #{1}0 + +but you may have intended it to mean: + + 10 (+#{1}0) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +15 | test-14: 10 +#{1}0; + | ^^^^^^^^^ + ' + +DEPRECATION WARNING on line 19, column 12 of input.scss: +This operation is parsed as: + + #{10} + #{10} + +but you may have intended it to mean: + + #{10} (+#{10}) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +19 | test-18: #{10} +#{10}; + | ^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 23, column 12 of input.scss: +This operation is parsed as: + + #{10} + 1 + +but you may have intended it to mean: + + #{10} (+1) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +23 | test-22: #{10} +1#{0}; + | ^^^^^^^^ + ' + +DEPRECATION WARNING on line 27, column 12 of input.scss: +This operation is parsed as: + + #{10} + #{1}0 + +but you may have intended it to mean: + + #{10} (+#{1}0) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +27 | test-26: #{10} +#{1}0; + | ^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 31, column 13 of input.scss: +This operation is parsed as: + + #{0} + 1 + +but you may have intended it to mean: + + #{0} (+1) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +31 | test-30: 1#{0} +1#{0}; + | ^^^^^^^ + ' + +DEPRECATION WARNING on line 35, column 13 of input.scss: +This operation is parsed as: + + #{0} + #{1}0 + +but you may have intended it to mean: + + #{0} (+#{1}0) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +35 | test-34: 1#{0} +#{1}0; + | ^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 39, column 12 of input.scss: +This operation is parsed as: + + #{1}0 + #{1}0 + +but you may have intended it to mean: + + #{1}0 (+#{1}0) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +39 | test-38: #{1}0 +#{1}0; + | ^^^^^^^^^^^^ + ' diff --git a/spec/non_conformant/parser/operations/addition/strings/pairs.hrx b/spec/non_conformant/parser/operations/addition/strings/pairs.hrx index 84413f1e57..1dc0138126 100644 --- a/spec/non_conformant/parser/operations/addition/strings/pairs.hrx +++ b/spec/non_conformant/parser/operations/addition/strings/pairs.hrx @@ -130,3 +130,289 @@ foo { test-59: litlp_rschemalitlp_rschema; test-60: litlp_rschemalitlp_rschema; } + +<===> warning +DEPRECATION WARNING on line 3, column 11 of input.scss: +This operation is parsed as: + + literal + literal + +but you may have intended it to mean: + + literal (+literal) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +3 | test-2: literal +literal; + | ^^^^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 7, column 11 of input.scss: +This operation is parsed as: + + literal + "quoted" + +but you may have intended it to mean: + + literal (+"quoted") + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +7 | test-6: literal +"quoted"; + | ^^^^^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 11, column 12 of input.scss: +This operation is parsed as: + + literal + #{interpolant} + +but you may have intended it to mean: + + literal (+#{interpolant}) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +11 | test-10: literal +#{interpolant}; + | ^^^^^^^^^^^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 15, column 12 of input.scss: +This operation is parsed as: + + literal + lschema_#{ritlp} + +but you may have intended it to mean: + + literal (+lschema_#{ritlp}) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +15 | test-14: literal +lschema_#{ritlp}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 19, column 12 of input.scss: +This operation is parsed as: + + literal + #{litlp}_rschema + +but you may have intended it to mean: + + literal (+#{litlp}_rschema) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +19 | test-18: literal +#{litlp}_rschema; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 23, column 12 of input.scss: +This operation is parsed as: + + "quoted" + "quoted" + +but you may have intended it to mean: + + "quoted" (+"quoted") + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +23 | test-22: "quoted" +"quoted"; + | ^^^^^^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 27, column 12 of input.scss: +This operation is parsed as: + + "quoted" + #{interpolant} + +but you may have intended it to mean: + + "quoted" (+#{interpolant}) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +27 | test-26: "quoted" +#{interpolant}; + | ^^^^^^^^^^^^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 31, column 12 of input.scss: +This operation is parsed as: + + "quoted" + lschema_#{ritlp} + +but you may have intended it to mean: + + "quoted" (+lschema_#{ritlp}) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +31 | test-30: "quoted" +lschema_#{ritlp}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 35, column 12 of input.scss: +This operation is parsed as: + + "quoted" + #{litlp}_rschema + +but you may have intended it to mean: + + "quoted" (+#{litlp}_rschema) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +35 | test-34: "quoted" +#{litlp}_rschema; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 39, column 12 of input.scss: +This operation is parsed as: + + #{interpolant} + #{interpolant} + +but you may have intended it to mean: + + #{interpolant} (+#{interpolant}) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +39 | test-38: #{interpolant} +#{interpolant}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 43, column 12 of input.scss: +This operation is parsed as: + + #{interpolant} + lschema_#{ritlp} + +but you may have intended it to mean: + + #{interpolant} (+lschema_#{ritlp}) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +43 | test-42: #{interpolant} +lschema_#{ritlp}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 47, column 12 of input.scss: +This operation is parsed as: + + #{interpolant} + #{litlp}_rschema + +but you may have intended it to mean: + + #{interpolant} (+#{litlp}_rschema) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +47 | test-46: #{interpolant} +#{litlp}_rschema; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 51, column 12 of input.scss: +This operation is parsed as: + + lschema_#{ritlp} + lschema_#{ritlp} + +but you may have intended it to mean: + + lschema_#{ritlp} (+lschema_#{ritlp}) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +51 | test-50: lschema_#{ritlp} +lschema_#{ritlp}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 55, column 12 of input.scss: +This operation is parsed as: + + lschema_#{ritlp} + #{litlp}_rschema + +but you may have intended it to mean: + + lschema_#{ritlp} (+#{litlp}_rschema) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +55 | test-54: lschema_#{ritlp} +#{litlp}_rschema; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 59, column 12 of input.scss: +This operation is parsed as: + + #{litlp}_rschema + #{litlp}_rschema + +but you may have intended it to mean: + + #{litlp}_rschema (+#{litlp}_rschema) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +59 | test-58: #{litlp}_rschema +#{litlp}_rschema; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' diff --git a/spec/non_conformant/parser/operations/subtract/strings/pairs.hrx b/spec/non_conformant/parser/operations/subtract/strings/pairs.hrx index 9bd02e4891..e6d60ab2f8 100644 --- a/spec/non_conformant/parser/operations/subtract/strings/pairs.hrx +++ b/spec/non_conformant/parser/operations/subtract/strings/pairs.hrx @@ -130,3 +130,42 @@ foo { test-59: litlp_rschema- litlp_rschema; test-60: litlp_rschema-litlp_rschema; } + +<===> warning +DEPRECATION WARNING on line 7, column 11 of input.scss: +This operation is parsed as: + + literal - "quoted" + +but you may have intended it to mean: + + literal (-"quoted") + +Add a space after - to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +7 | test-6: literal -"quoted"; + | ^^^^^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 23, column 12 of input.scss: +This operation is parsed as: + + "quoted" - "quoted" + +but you may have intended it to mean: + + "quoted" (-"quoted") + +Add a space after - to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +23 | test-22: "quoted" -"quoted"; + | ^^^^^^^^^^^^^^^^^^ + ' diff --git a/spec/non_conformant/scss/interpolation-operators-precedence.hrx b/spec/non_conformant/scss/interpolation-operators-precedence.hrx index 859cc4be14..093d778d08 100644 --- a/spec/non_conformant/scss/interpolation-operators-precedence.hrx +++ b/spec/non_conformant/scss/interpolation-operators-precedence.hrx @@ -54,6 +54,196 @@ } <===> error +DEPRECATION WARNING on line 4, column 9 of input.scss: +This operation is parsed as: + + #{a} + 5.0% + +but you may have intended it to mean: + + #{a} (+5.0%) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +4 | a03: (#{a} +5.0% + 2); + | ^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 8, column 9 of input.scss: +This operation is parsed as: + + 5 + 2.0% + #{a} + +but you may have intended it to mean: + + 5 + 2.0% (+#{a}) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +8 | b03: (5 + 2.0% +#{a}); + | ^^^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 10, column 9 of input.scss: +This operation is parsed as: + + #{a} + 5.0% + +but you may have intended it to mean: + + #{a} (+5.0%) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +10 | c01: (#{a} +5.0% + 2); + | ^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 14, column 9 of input.scss: +This operation is parsed as: + + #{a} + 5.0% + +but you may have intended it to mean: + + #{a} (+5.0%) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +14 | c05: (#{a} +5.0% - 2); + | ^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 18, column 9 of input.scss: +This operation is parsed as: + + #{a} + 5.0% / 2 + +but you may have intended it to mean: + + #{a} (+5.0% / 2) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +18 | c09: (#{a} +5.0% / 2); + | ^^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 22, column 9 of input.scss: +This operation is parsed as: + + #{a} + 5.0% * 2 + +but you may have intended it to mean: + + #{a} (+5.0% * 2) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +22 | c13: (#{a} +5.0% * 2); + | ^^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 26, column 9 of input.scss: +This operation is parsed as: + + 5 + 2.0% + #{a} + +but you may have intended it to mean: + + 5 + 2.0% (+#{a}) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +26 | d01: (5 + 2.0% +#{a}); + | ^^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 30, column 9 of input.scss: +This operation is parsed as: + + 5 - 2.0% + #{a} + +but you may have intended it to mean: + + 5 - 2.0% (+#{a}) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +30 | d05: (5 - 2.0% +#{a}); + | ^^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 34, column 9 of input.scss: +This operation is parsed as: + + 5% / 2.0 + #{a} + +but you may have intended it to mean: + + 5% / 2.0 (+#{a}) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +34 | d09: (5% / 2.0 +#{a}); + | ^^^^^^^^^^^^^^ + ' + +DEPRECATION WARNING on line 38, column 9 of input.scss: +This operation is parsed as: + + 5 * 2.0% + #{a} + +but you may have intended it to mean: + + 5 * 2.0% (+#{a}) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +38 | d13: (5 * 2.0% +#{a}); + | ^^^^^^^^^^^^^^ + ' + Error: Undefined operation "a * 5%". , 13 | c04: (#{a} *5.0% + 2); diff --git a/spec/operators/minus.hrx b/spec/operators/minus.hrx new file mode 100644 index 0000000000..5ec82c4532 --- /dev/null +++ b/spec/operators/minus.hrx @@ -0,0 +1,164 @@ +<===> syntax/whitespace/neither/input.scss +a {b: (c)-(d)} + +<===> syntax/whitespace/neither/output.css +a { + b: c-d; +} + +<===> +================================================================================ +<===> syntax/whitespace/both/input.scss +a {b: c - d} + +<===> syntax/whitespace/both/output.css +a { + b: c-d; +} + +<===> +================================================================================ +<===> syntax/whitespace/left/options.yml +:ignore_for: + - libsass + +<===> +================================================================================ +<===> syntax/whitespace/left/space/input.scss +a {b: c -(d)} + +<===> syntax/whitespace/left/space/output.css +a { + b: c-d; +} + +<===> syntax/whitespace/left/space/warning +DEPRECATION WARNING on line 1, column 7 of input.scss: +This operation is parsed as: + + c - (d) + +but you may have intended it to mean: + + c (-(d)) + +Add a space after - to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +1 | a {b: c -(d)} + | ^^^^^^ + ' + +<===> +================================================================================ +<===> syntax/whitespace/left/tab/input.scss +a {b: c -(d)} + +<===> syntax/whitespace/left/tab/output.css +a { + b: c-d; +} + +<===> syntax/whitespace/left/tab/warning +DEPRECATION WARNING on line 1, column 7 of input.scss: +This operation is parsed as: + + c - (d) + +but you may have intended it to mean: + + c (-(d)) + +Add a space after - to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +1 | a {b: c -(d)} + | ^^^^^^^^^ + ' + +<===> +================================================================================ +<===> syntax/whitespace/left/newline/input.scss +a {b: c +-(d)} + +<===> syntax/whitespace/left/newline/output.css +a { + b: c-d; +} + +<===> syntax/whitespace/left/newline/warning +DEPRECATION WARNING on line 1, column 7 of input.scss: +This operation is parsed as: + + c - (d) + +but you may have intended it to mean: + + c (-(d)) + +Add a space after - to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +1 | a {b: c + | ,-------^ +2 | | -(d)} + | '----^ + ' + +<===> +================================================================================ +<===> syntax/whitespace/right/input.scss +a {b: (c)- d} + +<===> syntax/whitespace/right/output.css +a { + b: c-d; +} + +<===> +================================================================================ +<===> syntax/comment/both/options.yml +:ignore_for: + - libsass + +<===> syntax/comment/both/input.scss +a {b: c/**/-/**/d} + +<===> syntax/comment/both/output.css +a { + b: c-d; +} + +<===> +================================================================================ +<===> syntax/comment/left/options.yml +:ignore_for: + - libsass + +<===> syntax/comment/left/input.scss +a {b: c/**/-(d)} + +<===> syntax/comment/left/output.css +a { + b: c-d; +} + +<===> +================================================================================ +<===> syntax/comment/right/input.scss +a {b: (c)-/**/d} + +<===> syntax/comment/right/output.css +a { + b: c-d; +} diff --git a/spec/operators/plus.hrx b/spec/operators/plus.hrx new file mode 100644 index 0000000000..df43d64049 --- /dev/null +++ b/spec/operators/plus.hrx @@ -0,0 +1,156 @@ +<===> syntax/whitespace/neither/input.scss +a {b: c+d} + +<===> syntax/whitespace/neither/output.css +a { + b: cd; +} + +<===> +================================================================================ +<===> syntax/whitespace/both/input.scss +a {b: c + d} + +<===> syntax/whitespace/both/output.css +a { + b: cd; +} + +<===> +================================================================================ +<===> syntax/whitespace/left/options.yml +:ignore_for: + - libsass + +<===> +================================================================================ +<===> syntax/whitespace/left/space/input.scss +a {b: c +d} + +<===> syntax/whitespace/left/space/output.css +a { + b: cd; +} + +<===> syntax/whitespace/left/space/warning +DEPRECATION WARNING on line 1, column 7 of input.scss: +This operation is parsed as: + + c + d + +but you may have intended it to mean: + + c (+d) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +1 | a {b: c +d} + | ^^^^ + ' + +<===> +================================================================================ +<===> syntax/whitespace/left/tab/input.scss +a {b: c +d} + +<===> syntax/whitespace/left/tab/output.css +a { + b: cd; +} + +<===> syntax/whitespace/left/tab/warning +DEPRECATION WARNING on line 1, column 7 of input.scss: +This operation is parsed as: + + c + d + +but you may have intended it to mean: + + c (+d) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +1 | a {b: c +d} + | ^^^^^^^ + ' + +<===> +================================================================================ +<===> syntax/whitespace/left/newline/input.scss +a {b: c ++d} + +<===> syntax/whitespace/left/newline/output.css +a { + b: cd; +} + +<===> syntax/whitespace/left/newline/warning +DEPRECATION WARNING on line 1, column 7 of input.scss: +This operation is parsed as: + + c + d + +but you may have intended it to mean: + + c (+d) + +Add a space after + to clarify that it's meant to be a binary operation, or wrap +it in parentheses to make it a unary operation. This will be an error in future +versions of Sass. + +More info and automated migrator: https://sass-lang.com/d/strict-unary + , +1 | a {b: c + | ,-------^ +2 | | +d} + | '--^ + ' + +<===> +================================================================================ +<===> syntax/whitespace/right/input.scss +a {b: c+ d} + +<===> syntax/whitespace/right/output.css +a { + b: cd; +} + +<===> +================================================================================ +<===> syntax/comment/both/input.scss +a {b: c/**/+/**/d} + +<===> syntax/comment/both/output.css +a { + b: cd; +} + +<===> +================================================================================ +<===> syntax/comment/left/input.scss +a {b: c/**/+d} + +<===> syntax/comment/left/output.css +a { + b: cd; +} + +<===> +================================================================================ +<===> syntax/comment/right/input.scss +a {b: c+/**/d} + +<===> syntax/comment/right/output.css +a { + b: cd; +}