From 48292d0b6220ff085bf9c28fa75f93c4229aa06e Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Tue, 5 Nov 2024 16:09:09 -0500 Subject: [PATCH 01/38] Port and update sass semicolon tests --- spec/css/style_rule.hrx | 12 ++++++++++++ spec/css/unknown_directive/semicolon.hrx | 5 +++++ spec/directives/debug.hrx | 7 +++++++ spec/directives/error.hrx | 10 ++++++++++ spec/directives/import/css.hrx | 8 ++++++++ spec/directives/import/include.hrx | 10 ++++++++++ spec/directives/mixin.hrx | 8 ++++++++ spec/directives/return.hrx | 5 +++++ spec/directives/warn.hrx | 11 +++++++++++ spec/expressions/variable.hrx | 4 ++++ spec/non_conformant/sass/semicolon/at_rule.hrx | 10 ---------- spec/non_conformant/sass/semicolon/content.hrx | 11 ----------- spec/non_conformant/sass/semicolon/debug.hrx | 10 ---------- .../sass/semicolon/declaration.hrx | 11 ----------- spec/non_conformant/sass/semicolon/error.hrx | 10 ---------- spec/non_conformant/sass/semicolon/import.hrx | 10 ---------- spec/non_conformant/sass/semicolon/include.hrx | 10 ---------- spec/non_conformant/sass/semicolon/return.hrx | 11 ----------- spec/non_conformant/sass/semicolon/variable.hrx | 10 ---------- spec/non_conformant/sass/semicolon/warn.hrx | 10 ---------- spec/parser/indentation.hrx | 17 ++++++++++++++--- 21 files changed, 94 insertions(+), 106 deletions(-) create mode 100644 spec/css/unknown_directive/semicolon.hrx create mode 100644 spec/directives/debug.hrx create mode 100644 spec/directives/error.hrx create mode 100644 spec/directives/import/include.hrx create mode 100644 spec/directives/return.hrx create mode 100644 spec/expressions/variable.hrx delete mode 100644 spec/non_conformant/sass/semicolon/at_rule.hrx delete mode 100644 spec/non_conformant/sass/semicolon/content.hrx delete mode 100644 spec/non_conformant/sass/semicolon/debug.hrx delete mode 100644 spec/non_conformant/sass/semicolon/declaration.hrx delete mode 100644 spec/non_conformant/sass/semicolon/error.hrx delete mode 100644 spec/non_conformant/sass/semicolon/import.hrx delete mode 100644 spec/non_conformant/sass/semicolon/include.hrx delete mode 100644 spec/non_conformant/sass/semicolon/return.hrx delete mode 100644 spec/non_conformant/sass/semicolon/variable.hrx delete mode 100644 spec/non_conformant/sass/semicolon/warn.hrx diff --git a/spec/css/style_rule.hrx b/spec/css/style_rule.hrx index b559e3662a..c8ea5a50a6 100644 --- a/spec/css/style_rule.hrx +++ b/spec/css/style_rule.hrx @@ -331,3 +331,15 @@ a {b: c // a { b: c; } + +<===> +================================================================================ +<===> sass/declaration/semicolon/input.sass +a + b: c; + + +<===> sass/declaration/semicolon/output.css +a { + b: c; +} diff --git a/spec/css/unknown_directive/semicolon.hrx b/spec/css/unknown_directive/semicolon.hrx new file mode 100644 index 0000000000..cf7b29bec2 --- /dev/null +++ b/spec/css/unknown_directive/semicolon.hrx @@ -0,0 +1,5 @@ +<===> sass/input.sass +@a b; + +<===> sass/output.css +@a b; diff --git a/spec/directives/debug.hrx b/spec/directives/debug.hrx new file mode 100644 index 0000000000..b66f3ea80f --- /dev/null +++ b/spec/directives/debug.hrx @@ -0,0 +1,7 @@ +<===> sass/semicolon/input.sass +@debug a; + +<===> sass/semicolon/output.css + +<===> sass/semicolon/warning +input.sass:1 DEBUG: a diff --git a/spec/directives/error.hrx b/spec/directives/error.hrx new file mode 100644 index 0000000000..8b3206561d --- /dev/null +++ b/spec/directives/error.hrx @@ -0,0 +1,10 @@ +<===> sass/semicolon/input.sass +@error a; + +<===> sass/semicolon/error +Error: a + , +1 | @error a; + | ^^^^^^^^^ + ' + input.sass 1:1 root stylesheet diff --git a/spec/directives/import/css.hrx b/spec/directives/import/css.hrx index 54f0ea84e3..027489601f 100644 --- a/spec/directives/import/css.hrx +++ b/spec/directives/import/css.hrx @@ -44,3 +44,11 @@ More info and automated migrator: https://sass-lang.com/d/import | ^^^^^^^^ ' input.scss 3:9 root stylesheet + +<===> +================================================================================ +<===> sass/semicolon/input.sass +@import url("a"); + +<===> sass/semicolon/output.css +@import url("a"); diff --git a/spec/directives/import/include.hrx b/spec/directives/import/include.hrx new file mode 100644 index 0000000000..613abf514e --- /dev/null +++ b/spec/directives/import/include.hrx @@ -0,0 +1,10 @@ +<===> sass/semicolon/input.sass +@include a; + +<===> sass/semicolon/error +Error: Undefined mixin. + , +1 | @include a; + | ^^^^^^^^^^ + ' + input.sass 1:1 root stylesheet diff --git a/spec/directives/mixin.hrx b/spec/directives/mixin.hrx index 807a3672ca..16bb603f55 100644 --- a/spec/directives/mixin.hrx +++ b/spec/directives/mixin.hrx @@ -229,3 +229,11 @@ For details, see https://sass-lang.com/d/css-function-mixin {} <===> comment/include/after_using_arglist/silent/output.css + +<===> +================================================================================ +<===> sass/content/semicolon/input.sass +@mixin a + @content; + +<===> sass/content/semicolon/output.css diff --git a/spec/directives/return.hrx b/spec/directives/return.hrx new file mode 100644 index 0000000000..7e8f617996 --- /dev/null +++ b/spec/directives/return.hrx @@ -0,0 +1,5 @@ +<===> sass/semicolon/input.sass +@function foo() + @return a; + +<===> sass/semicolon/output.css diff --git a/spec/directives/warn.hrx b/spec/directives/warn.hrx index cecf15a46e..0c79b8921c 100644 --- a/spec/directives/warn.hrx +++ b/spec/directives/warn.hrx @@ -175,3 +175,14 @@ WARNING: a <===> comment/after_expression/silent/warning WARNING: a input.scss 1:1 root stylesheet + +<===> +================================================================================ +<===> sass/semicolon/input.sass +@warn a; + +<===> sass/semicolon/output.css + +<===> sass/semicolon/warning +WARNING: a + input.sass 1:1 root stylesheet diff --git a/spec/expressions/variable.hrx b/spec/expressions/variable.hrx new file mode 100644 index 0000000000..7a5c01dfd1 --- /dev/null +++ b/spec/expressions/variable.hrx @@ -0,0 +1,4 @@ +<===> sass/semicolon/input.sass +$a: b; + +<===> sass/semicolon/output.css diff --git a/spec/non_conformant/sass/semicolon/at_rule.hrx b/spec/non_conformant/sass/semicolon/at_rule.hrx deleted file mode 100644 index d34418431d..0000000000 --- a/spec/non_conformant/sass/semicolon/at_rule.hrx +++ /dev/null @@ -1,10 +0,0 @@ -<===> input.sass -@rule value; - -<===> error -Error: semicolons aren't allowed in the indented syntax. - , -1 | @rule value; - | ^ - ' - input.sass 1:12 root stylesheet diff --git a/spec/non_conformant/sass/semicolon/content.hrx b/spec/non_conformant/sass/semicolon/content.hrx deleted file mode 100644 index 8f3d755649..0000000000 --- a/spec/non_conformant/sass/semicolon/content.hrx +++ /dev/null @@ -1,11 +0,0 @@ -<===> input.sass -@mixin foo - @content; - -<===> error -Error: semicolons aren't allowed in the indented syntax. - , -2 | @content; - | ^ - ' - input.sass 2:11 root stylesheet diff --git a/spec/non_conformant/sass/semicolon/debug.hrx b/spec/non_conformant/sass/semicolon/debug.hrx deleted file mode 100644 index 31a08007bd..0000000000 --- a/spec/non_conformant/sass/semicolon/debug.hrx +++ /dev/null @@ -1,10 +0,0 @@ -<===> input.sass -@debug value; - -<===> error -Error: semicolons aren't allowed in the indented syntax. - , -1 | @debug value; - | ^ - ' - input.sass 1:13 root stylesheet diff --git a/spec/non_conformant/sass/semicolon/declaration.hrx b/spec/non_conformant/sass/semicolon/declaration.hrx deleted file mode 100644 index 90b30f0288..0000000000 --- a/spec/non_conformant/sass/semicolon/declaration.hrx +++ /dev/null @@ -1,11 +0,0 @@ -<===> input.sass -a - b: c; - -<===> error -Error: semicolons aren't allowed in the indented syntax. - , -2 | b: c; - | ^ - ' - input.sass 2:7 root stylesheet diff --git a/spec/non_conformant/sass/semicolon/error.hrx b/spec/non_conformant/sass/semicolon/error.hrx deleted file mode 100644 index 2e749aa658..0000000000 --- a/spec/non_conformant/sass/semicolon/error.hrx +++ /dev/null @@ -1,10 +0,0 @@ -<===> input.sass -@error value; - -<===> error -Error: semicolons aren't allowed in the indented syntax. - , -1 | @error value; - | ^ - ' - input.sass 1:13 root stylesheet diff --git a/spec/non_conformant/sass/semicolon/import.hrx b/spec/non_conformant/sass/semicolon/import.hrx deleted file mode 100644 index a0aa321e27..0000000000 --- a/spec/non_conformant/sass/semicolon/import.hrx +++ /dev/null @@ -1,10 +0,0 @@ -<===> input.sass -@import url("foo"); - -<===> error -Error: semicolons aren't allowed in the indented syntax. - , -1 | @import url("foo"); - | ^ - ' - input.sass 1:19 root stylesheet diff --git a/spec/non_conformant/sass/semicolon/include.hrx b/spec/non_conformant/sass/semicolon/include.hrx deleted file mode 100644 index cf02a7d7db..0000000000 --- a/spec/non_conformant/sass/semicolon/include.hrx +++ /dev/null @@ -1,10 +0,0 @@ -<===> input.sass -@include foo; - -<===> error -Error: semicolons aren't allowed in the indented syntax. - , -1 | @include foo; - | ^ - ' - input.sass 1:13 root stylesheet diff --git a/spec/non_conformant/sass/semicolon/return.hrx b/spec/non_conformant/sass/semicolon/return.hrx deleted file mode 100644 index bb78b5e689..0000000000 --- a/spec/non_conformant/sass/semicolon/return.hrx +++ /dev/null @@ -1,11 +0,0 @@ -<===> input.sass -@function foo() - @return value; - -<===> error -Error: semicolons aren't allowed in the indented syntax. - , -2 | @return value; - | ^ - ' - input.sass 2:16 root stylesheet diff --git a/spec/non_conformant/sass/semicolon/variable.hrx b/spec/non_conformant/sass/semicolon/variable.hrx deleted file mode 100644 index aa8c4451fa..0000000000 --- a/spec/non_conformant/sass/semicolon/variable.hrx +++ /dev/null @@ -1,10 +0,0 @@ -<===> input.sass -$var: value; - -<===> error -Error: semicolons aren't allowed in the indented syntax. - , -1 | $var: value; - | ^ - ' - input.sass 1:12 root stylesheet diff --git a/spec/non_conformant/sass/semicolon/warn.hrx b/spec/non_conformant/sass/semicolon/warn.hrx deleted file mode 100644 index 2e55a21fe0..0000000000 --- a/spec/non_conformant/sass/semicolon/warn.hrx +++ /dev/null @@ -1,10 +0,0 @@ -<===> input.sass -@warn value; - -<===> error -Error: semicolons aren't allowed in the indented syntax. - , -1 | @warn value; - | ^ - ' - input.sass 1:12 root stylesheet diff --git a/spec/parser/indentation.hrx b/spec/parser/indentation.hrx index 1378df4bac..af4561eb69 100644 --- a/spec/parser/indentation.hrx +++ b/spec/parser/indentation.hrx @@ -36,10 +36,21 @@ Error: Expected newline. a b: c; -<===> error/mixed-syntax/semicolon/error -Error: semicolons aren't allowed in the indented syntax. +<===> error/mixed-syntax/semicolon/output.css +a { + b: c; +} + +<===> +================================================================================ +<===> error/semicolon-multiple-same-line/input.sass +a + b: c; d: e; + +<===> error/semicolon-multiple-same-line/error +Error: multiple statements on one line are not supported in the indented syntax. , -2 | b: c; +2 | b: c; d: e; | ^ ' input.sass 2:7 root stylesheet From 402e0cfb2ae28a9398ebfebd493c7a7ce6900241 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Wed, 27 Nov 2024 16:36:19 -0500 Subject: [PATCH 02/38] Update each tests --- spec/directives/each.hrx | 45 +++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/spec/directives/each.hrx b/spec/directives/each.hrx index e03457f53c..b0053c8f0e 100644 --- a/spec/directives/each.hrx +++ b/spec/directives/each.hrx @@ -22,13 +22,14 @@ .#{$a} d: $a -<===> error/sass/multiline/after-each/error -Error: expected "$". - , -2 | @each - | ^ - ' - input.sass 2:6 root stylesheet +<===> error/sass/multiline/after-each/output.css +.b { + d: b; +} + +.c { + d: c; +} <===> ================================================================================ @@ -39,13 +40,14 @@ Error: expected "$". .#{$a} d: $a -<===> error/sass/multiline/after-variable/error -Error: Expected "in". - , -2 | @each $a - | ^ - ' - input.sass 2:10 root stylesheet +<===> error/sass/multiline/after-variable/output.css +.b { + d: b; +} + +.c { + d: c; +} <===> ================================================================================ @@ -56,13 +58,14 @@ Error: Expected "in". .#{$a} d: $a -<===> error/sass/multiline/after-in/error -Error: Expected expression. - , -2 | @each $a in - | ^ - ' - input.sass 2:12 root stylesheet +<===> error/sass/multiline/after-in/output.css +.b { + d: b; +} + +.c { + d: c; +} <===> ================================================================================ From 1d2190275b1b67ddb11b523dcb351d37e3880db7 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Wed, 27 Nov 2024 16:57:42 -0500 Subject: [PATCH 03/38] Test debug, error, warn for multiline --- spec/directives/debug.hrx | 12 ++++++++++++ spec/directives/error.hrx | 14 ++++++++++++++ spec/directives/warn.hrx | 12 ++++++++++++ 3 files changed, 38 insertions(+) diff --git a/spec/directives/debug.hrx b/spec/directives/debug.hrx index b66f3ea80f..324f10f837 100644 --- a/spec/directives/debug.hrx +++ b/spec/directives/debug.hrx @@ -5,3 +5,15 @@ <===> sass/semicolon/warning input.sass:1 DEBUG: a + +<===> +================================================================================ + +<===> sass/multiline-after/input.sass +@debug +a + +<===> sass/multiline-after/output.css + +<===> sass/multiline-after/warning +input.sass:1 DEBUG: a diff --git a/spec/directives/error.hrx b/spec/directives/error.hrx index 8b3206561d..21758a93ff 100644 --- a/spec/directives/error.hrx +++ b/spec/directives/error.hrx @@ -8,3 +8,17 @@ Error: a | ^^^^^^^^^ ' input.sass 1:1 root stylesheet + +<===> +================================================================================ +<===> sass/multiline-after/input.sass +@error +a + +<===> sass/multiline-after/error +Error: a + , +1 | / @error +2 | \ a + ' + input.sass 1:1 root stylesheet diff --git a/spec/directives/warn.hrx b/spec/directives/warn.hrx index 0c79b8921c..9004f440be 100644 --- a/spec/directives/warn.hrx +++ b/spec/directives/warn.hrx @@ -186,3 +186,15 @@ WARNING: a <===> sass/semicolon/warning WARNING: a input.sass 1:1 root stylesheet + +<===> +================================================================================ +<===> sass/multiline/input.sass +@warn +a + +<===> sass/multiline/output.css + +<===> sass/multiline/warning +WARNING: a + input.sass 1:1 root stylesheet From a45a4032080b28b097059fbff98d2785995bd1f9 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Mon, 2 Dec 2024 09:51:01 -0500 Subject: [PATCH 04/38] Add @for whitespace tests, fix @debug, @error, @warn tests --- spec/directives/debug.hrx | 12 ++++++---- spec/directives/error.hrx | 8 +++---- spec/directives/for/comment.hrx | 42 +++++++-------------------------- spec/directives/warn.hrx | 12 ++++++---- 4 files changed, 26 insertions(+), 48 deletions(-) diff --git a/spec/directives/debug.hrx b/spec/directives/debug.hrx index 324f10f837..bd84ff8510 100644 --- a/spec/directives/debug.hrx +++ b/spec/directives/debug.hrx @@ -8,12 +8,14 @@ input.sass:1 DEBUG: a <===> ================================================================================ - <===> sass/multiline-after/input.sass @debug a -<===> sass/multiline-after/output.css - -<===> sass/multiline-after/warning -input.sass:1 DEBUG: a +<===> sass/multiline-after/error +Error: Expected expression. + , +1 | @debug + | ^ + ' + input.sass 1:7 root stylesheet diff --git a/spec/directives/error.hrx b/spec/directives/error.hrx index 21758a93ff..35496af6c9 100644 --- a/spec/directives/error.hrx +++ b/spec/directives/error.hrx @@ -16,9 +16,9 @@ Error: a a <===> sass/multiline-after/error -Error: a +Error: Expected expression. , -1 | / @error -2 | \ a +1 | @error + | ^ ' - input.sass 1:1 root stylesheet + input.sass 1:7 root stylesheet diff --git a/spec/directives/for/comment.hrx b/spec/directives/for/comment.hrx index ffd32bdcc9..ca7a5b8381 100644 --- a/spec/directives/for/comment.hrx +++ b/spec/directives/for/comment.hrx @@ -21,46 +21,27 @@ <===> ================================================================================ -<===> error/before_var/silent/sass/input.sass +<===> before_var/silent/sass/input.sass @for // $i from 1 through 10 -<===> error/before_var/silent/sass/error -Error: expected "$". - , -1 | @for // - | ^ - ' - input.sass 1:8 root stylesheet +<===> before_var/silent/sass/output.css <===> ================================================================================ -<===> error/before_from/silent/sass/input.sass +<===> before_from/silent/sass/input.sass @for $i // from 1 through 10 -<===> error/before_from/silent/sass/error -Error: Expected "from". - , -1 | @for $i // - | ^ - ' - input.sass 1:11 root stylesheet +<===> before_from/silent/sass/output.css <===> ================================================================================ -<===> error/after_from/silent/sass/input.sass +<===> after_from/silent/sass/input.sass @for $i from // 1 through 10 - -<===> error/after_from/silent/sass/error -Error: Expected expression. - , -1 | @for $i from // - | ^^ - ' - input.sass 1:14 root stylesheet +<===> after_from/silent/sass/output.css <===> ================================================================================ @@ -68,7 +49,6 @@ Error: Expected expression. @for $i from 1 // through 10 - <===> error/before_through/silent/sass/error Error: Expected "to" or "through". , @@ -79,18 +59,12 @@ Error: Expected "to" or "through". <===> ================================================================================ -<===> error/after_through/silent/sass/input.sass +<===> after_through/silent/sass/input.sass @for $i from 1 through // 10 -<===> error/after_through/silent/sass/error -Error: Expected expression. - , -1 | @for $i from 1 through // - | ^^ - ' - input.sass 1:24 root stylesheet +<===> after_through/silent/sass/output.css <===> ================================================================================ diff --git a/spec/directives/warn.hrx b/spec/directives/warn.hrx index 9004f440be..f7cfdd7ae6 100644 --- a/spec/directives/warn.hrx +++ b/spec/directives/warn.hrx @@ -193,8 +193,10 @@ WARNING: a @warn a -<===> sass/multiline/output.css - -<===> sass/multiline/warning -WARNING: a - input.sass 1:1 root stylesheet +<===> sass/multiline/error +Error: Expected expression. + , +1 | @warn + | ^ + ' + input.sass 1:6 root stylesheet From c7cf104b5a0d9bca03bf68f19e56948db33f8178 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Mon, 2 Dec 2024 10:46:38 -0500 Subject: [PATCH 05/38] Extend newlines --- spec/directives/extend/whitespace.hrx | 51 +++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 spec/directives/extend/whitespace.hrx diff --git a/spec/directives/extend/whitespace.hrx b/spec/directives/extend/whitespace.hrx new file mode 100644 index 0000000000..cc5e567c60 --- /dev/null +++ b/spec/directives/extend/whitespace.hrx @@ -0,0 +1,51 @@ +<===> before_arg/scss/input.scss +a {b: c} +d {@extend + a} + +<===> before_arg/scss/output.css +a, d { + b: c; +} + +<===> +================================================================================ +<===> before_arg/sass/input.sass +a + b: c +d + @extend + a + e: f + +<===> before_arg/sass/output.css +a, d { + b: c; +} + +d { + e: f; +} + +<===> +================================================================================ +<===> before_optional/scss/input.scss +a {@extend b + !optional} + +<===> before_optional/scss/output.css + +<===> +================================================================================ +<===> error/before_optional/sass/input.sass +a + @extend b + !optional + +<===> error/before_optional/sass/error +Error: Expected newline. + , +2 | @extend b + | ^ + ' + input.sass 2:12 root stylesheet From 51d667a4607af75e5e296d5b350152efd1278195 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Mon, 2 Dec 2024 11:23:30 -0500 Subject: [PATCH 06/38] @import whitespace tests --- spec/directives/import/whitespace.hrx | 153 ++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 spec/directives/import/whitespace.hrx diff --git a/spec/directives/import/whitespace.hrx b/spec/directives/import/whitespace.hrx new file mode 100644 index 0000000000..c2a3b77e1c --- /dev/null +++ b/spec/directives/import/whitespace.hrx @@ -0,0 +1,153 @@ +<===> before_url/scss/input.scss +@import + "a.css" + +<===> before_url/scss/output.css +@import "a.css"; + +<===> +================================================================================ +<===> error/before_url/sass/input.sass +@import + "a.css" + +<===> error/before_url/sass/error +Error: Nothing may be indented beneath a @import rule. + , +2 | "a.css" + | ^ + ' + input.sass 2:3 root stylesheet + +<===> +================================================================================ +<===> error/before_comma/sass/input.sass +@import "a.css" + , "b.css" + +<===> error/before_comma/sass/error +Error: Nothing may be indented beneath a @import rule. + , +2 | , "b.css" + | ^ + ' + input.sass 2:3 root stylesheet + +<===> +================================================================================ +<===> error/after_comma/sass/input.scss +@import "a.css", + "b.css" + +<===> error/after_comma/sass/output.css +@import "a.css"; +@import "b.css"; + +<===> +================================================================================ +<===> error/modifier/no_args/before/sass/input.scss +@import "a.css" + b + +<===> error/modifier/no_args/before/sass/output.css +@import "a.css" b; + +<===> +================================================================================ +<===> error/modifier/args/before/sass/input.sass +@import "a.css" + b(c) + +<===> error/modifier/args/before/sass/error +Error: Nothing may be indented beneath a @import rule. + , +2 | b(c) + | ^ + ' + input.sass 2:3 root stylesheet + +<===> +================================================================================ +<===> before_comma/scss/input.scss +@import "a.css" + , "b.css" + +<===> before_comma/scss/output.css +@import "a.css"; +@import "b.css"; + +<===> +================================================================================ +<===> after_comma/scss/input.scss +@import "a.css", + "b.css" + +<===> after_comma/scss/output.css +@import "a.css"; +@import "b.css"; + +<===> +================================================================================ +<===> modifier/no_args/before/scss/input.scss +@import "a.css" + b + +<===> modifier/no_args/before/scss/output.css +@import "a.css" b; + +<===> +================================================================================ +<===> modifier/args/before/scss/input.scss +@import "a.css" + b(c) + +<===> modifier/args/before/scss/output.css +@import "a.css" b(c); + +<===> +================================================================================ +<===> modifier/args/after_open_paren/scss/input.scss +@import "a.css" b( + c) + +<===> modifier/args/after_open_paren/scss/output.css +@import "a.css" b( + c); + +<===> +================================================================================ +<===> modifier/args/after_open_paren/sass/options.yml +:todo: + - dart-sass + +<===> modifier/args/after_open_paren/sass/input.sass +@import "a.css" b( + c) + +<===> modifier/args/after_open_paren/sass/output.css +@import "a.css" b( + c); + +<===> +================================================================================ +<===> modifier/args/before_close_paren/scss/input.scss +@import "a.css" b(c + ) + +<===> modifier/args/before_close_paren/scss/output.css +@import "a.css" b(c + ); + +<===> +================================================================================ +<===> modifier/args/before_close_paren/sass/options.yml +:todo: + - dart-sass + +<===> modifier/args/before_close_paren/sass/input.sass +@import "a.css" b(c + ) + +<===> modifier/args/before_close_paren/sass/output.css +@import "a.css" b(c + ); From df219eb2a0eb159bb30116c5990382af5616a595 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Mon, 2 Dec 2024 13:54:18 -0500 Subject: [PATCH 07/38] @mixin and @include tests --- spec/directives/import/include.hrx | 10 -- spec/directives/mixin.hrx | 239 --------------------------- spec/directives/mixin/comment.hrx | 176 ++++++++++++++++++++ spec/directives/mixin/mixin.hrx | 60 +++++++ spec/directives/mixin/whitespace.hrx | 111 +++++++++++++ 5 files changed, 347 insertions(+), 249 deletions(-) delete mode 100644 spec/directives/import/include.hrx delete mode 100644 spec/directives/mixin.hrx create mode 100644 spec/directives/mixin/comment.hrx create mode 100644 spec/directives/mixin/mixin.hrx create mode 100644 spec/directives/mixin/whitespace.hrx diff --git a/spec/directives/import/include.hrx b/spec/directives/import/include.hrx deleted file mode 100644 index 613abf514e..0000000000 --- a/spec/directives/import/include.hrx +++ /dev/null @@ -1,10 +0,0 @@ -<===> sass/semicolon/input.sass -@include a; - -<===> sass/semicolon/error -Error: Undefined mixin. - , -1 | @include a; - | ^^^^^^^^^^ - ' - input.sass 1:1 root stylesheet diff --git a/spec/directives/mixin.hrx b/spec/directives/mixin.hrx deleted file mode 100644 index 16bb603f55..0000000000 --- a/spec/directives/mixin.hrx +++ /dev/null @@ -1,239 +0,0 @@ -<===> custom_ident_name/input.scss -@mixin --a {b: c} -d {@include --a} - -<===> custom_ident_name/output.css -d { - b: c; -} - -<===> custom_ident_name/warning -DEPRECATION WARNING: Sass @mixin names beginning with -- are deprecated for forward-compatibility with plain CSS mixins. - -For details, see https://sass-lang.com/d/css-function-mixin - - , -1 | @mixin --a {b: c} - | ^^^ - ' - input.scss 1:8 root stylesheet - -<===> -================================================================================ -<===> double_underscore_name/input.scss -@mixin __a() {b: c} -d {@include __a} - -<===> double_underscore_name/output.css -d { - b: c; -} - -<===> -================================================================================ -<===> custom_ident_include/input.scss -@mixin __a() {b: c} -d {@include --a} - -<===> custom_ident_include/output.css -d { - b: c; -} - -<===> custom_ident_include/warning -DEPRECATION WARNING: Sass @mixin names beginning with -- are deprecated for forward-compatibility with plain CSS mixins. - -For details, see https://sass-lang.com/d/css-function-mixin - - , -2 | d {@include --a} - | ^^^ - ' - input.scss 2:13 root stylesheet - -<===> -================================================================================ -<===> comment/mixin/before_name/loud/input.scss -@mixin /**/ a {} - -<===> comment/mixin/before_name/loud/output.css - -<===> -================================================================================ -<===> comment/mixin/before_name/silent/input.scss -@mixin // - a {} - -<===> comment/mixin/before_name/silent/output.css - -<===> -================================================================================ -<===> comment/mixin/after_args/loud/input.scss -@mixin a() /**/ {} - -<===> comment/mixin/after_args/loud/output.css - -<===> -================================================================================ -<===> comment/mixin/after_args/silent/input.scss -@mixin a() // - {} - -<===> comment/mixin/after_args/silent/output.css - -<===> -================================================================================ -<===> comment/content/after_content/loud/input.scss -@mixin a {@content /**/} - -<===> comment/content/after_content/loud/output.css - -<===> -================================================================================ -<===> comment/content/after_content/silent/input.scss -@mixin a { - @content // -} - -<===> comment/content/after_content/silent/output.css - -<===> -================================================================================ -<===> comment/content/after_args/loud/input.scss -@mixin a {@content() /**/} - -<===> comment/content/after_args/loud/output.css - -<===> -================================================================================ -<===> comment/content/after_args/silent/input.scss -@mixin a { - @content() // -} - -<===> comment/content/after_args/silent/output.css - -<===> -================================================================================ -<===> comment/include/before_name/loud/input.scss -@mixin a {} -@include /**/ a - -<===> comment/include/before_name/loud/output.css - -<===> -================================================================================ -<===> comment/include/before_name/silent/input.scss -@mixin a {} -@include // - a - -<===> comment/include/before_name/silent/output.css - -<===> -================================================================================ -<===> comment/include/after_name/loud/input.scss -@mixin a {} -@include a /**/ - -<===> comment/include/after_name/loud/output.css - -<===> -================================================================================ -<===> comment/include/after_name/silent/input.scss -@mixin a {} -@include a // - -<===> comment/include/after_name/silent/output.css - -<===> -================================================================================ -<===> comment/include/after_args/loud/input.scss -@mixin a {} -@include a() /**/ - -<===> comment/include/after_args/loud/output.css - -<===> -================================================================================ -<===> comment/include/after_args/silent/input.scss -@mixin a {} -@include a() // - -<===> comment/include/after_args/silent/output.css - -<===> -================================================================================ -<===> comment/include/before_block/loud/input.scss -@mixin a {@content} -@include a() /**/ {} - -<===> comment/include/before_block/loud/output.css - -<===> -================================================================================ -<===> comment/include/before_block/silent/input.scss -@mixin a {@content} -@include a() // - {} - -<===> comment/include/before_block/silent/output.css - -<===> -================================================================================ -<===> comment/include/before_using/loud/input.scss -@mixin a {@content} -@include a() /**/ using () {} - -<===> comment/include/before_using/loud/output.css - -<===> -================================================================================ -<===> comment/include/before_using/silent/input.scss -@mixin a {@content} -@include a() // - using () {} - -<===> comment/include/before_using/silent/output.css - -<===> -================================================================================ -<===> comment/include/after_using/loud/input.scss -@mixin a {@content} -@include a() using /**/ () {} - -<===> comment/include/after_using/loud/output.css - -<===> -================================================================================ -<===> comment/include/after_using/silent/input.scss -@mixin a {@content} -@include a() using // - () {} - -<===> comment/include/after_using/silent/output.css - -<===> -================================================================================ -<===> comment/include/after_using_arglist/loud/input.scss -@mixin a {@content} -@include a() using () /**/ {} - -<===> comment/include/after_using_arglist/loud/output.css - -<===> -================================================================================ -<===> comment/include/after_using_arglist/silent/input.scss -@mixin a {@content} -@include a() using () // - {} - -<===> comment/include/after_using_arglist/silent/output.css - -<===> -================================================================================ -<===> sass/content/semicolon/input.sass -@mixin a - @content; - -<===> sass/content/semicolon/output.css diff --git a/spec/directives/mixin/comment.hrx b/spec/directives/mixin/comment.hrx new file mode 100644 index 0000000000..6a7bf5482f --- /dev/null +++ b/spec/directives/mixin/comment.hrx @@ -0,0 +1,176 @@ +<===> mixin/before_name/loud/input.scss +@mixin /**/ a {} + +<===> mixin/before_name/loud/output.css + +<===> +================================================================================ +<===> mixin/before_name/silent/input.scss +@mixin // + a {} + +<===> mixin/before_name/silent/output.css + +<===> +================================================================================ +<===> mixin/after_args/loud/input.scss +@mixin a() /**/ {} + +<===> mixin/after_args/loud/output.css + +<===> +================================================================================ +<===> mixin/after_args/silent/input.scss +@mixin a() // + {} + +<===> mixin/after_args/silent/output.css + +<===> +================================================================================ +<===> content/after_content/loud/input.scss +@mixin a {@content /**/} + +<===> content/after_content/loud/output.css + +<===> +================================================================================ +<===> content/after_content/silent/input.scss +@mixin a { + @content // +} + +<===> content/after_content/silent/output.css + +<===> +================================================================================ +<===> content/after_args/loud/input.scss +@mixin a {@content() /**/} + +<===> content/after_args/loud/output.css + +<===> +================================================================================ +<===> content/after_args/silent/input.scss +@mixin a { + @content() // +} + +<===> content/after_args/silent/output.css + +<===> +================================================================================ +<===> include/before_name/loud/input.scss +@mixin a {} +@include /**/ a + +<===> include/before_name/loud/output.css + +<===> +================================================================================ +<===> include/before_name/silent/input.scss +@mixin a {} +@include // + a + +<===> include/before_name/silent/output.css + +<===> +================================================================================ +<===> include/after_name/loud/input.scss +@mixin a {} +@include a /**/ + +<===> include/after_name/loud/output.css + +<===> +================================================================================ +<===> include/after_name/silent/input.scss +@mixin a {} +@include a // + +<===> include/after_name/silent/output.css + +<===> +================================================================================ +<===> include/after_args/loud/input.scss +@mixin a {} +@include a() /**/ + +<===> include/after_args/loud/output.css + +<===> +================================================================================ +<===> include/after_args/silent/input.scss +@mixin a {} +@include a() // + +<===> include/after_args/silent/output.css + +<===> +================================================================================ +<===> include/before_block/loud/input.scss +@mixin a {@content} +@include a() /**/ {} + +<===> include/before_block/loud/output.css + +<===> +================================================================================ +<===> include/before_block/silent/input.scss +@mixin a {@content} +@include a() // + {} + +<===> include/before_block/silent/output.css + +<===> +================================================================================ +<===> include/before_using/loud/input.scss +@mixin a {@content} +@include a() /**/ using () {} + +<===> include/before_using/loud/output.css + +<===> +================================================================================ +<===> include/before_using/silent/input.scss +@mixin a {@content} +@include a() // + using () {} + +<===> include/before_using/silent/output.css + +<===> +================================================================================ +<===> include/after_using/loud/input.scss +@mixin a {@content} +@include a() using /**/ () {} + +<===> include/after_using/loud/output.css + +<===> +================================================================================ +<===> include/after_using/silent/input.scss +@mixin a {@content} +@include a() using // + () {} + +<===> include/after_using/silent/output.css + +<===> +================================================================================ +<===> include/after_using_arglist/loud/input.scss +@mixin a {@content} +@include a() using () /**/ {} + +<===> include/after_using_arglist/loud/output.css + +<===> +================================================================================ +<===> include/after_using_arglist/silent/input.scss +@mixin a {@content} +@include a() using () // + {} + +<===> include/after_using_arglist/silent/output.css diff --git a/spec/directives/mixin/mixin.hrx b/spec/directives/mixin/mixin.hrx new file mode 100644 index 0000000000..7bd62ee0e7 --- /dev/null +++ b/spec/directives/mixin/mixin.hrx @@ -0,0 +1,60 @@ +<===> custom_ident_name/input.scss +@mixin --a {b: c} +d {@include --a} + +<===> custom_ident_name/output.css +d { + b: c; +} + +<===> custom_ident_name/warning +DEPRECATION WARNING: Sass @mixin names beginning with -- are deprecated for forward-compatibility with plain CSS mixins. + +For details, see https://sass-lang.com/d/css-function-mixin + + , +1 | @mixin --a {b: c} + | ^^^ + ' + input.scss 1:8 root stylesheet + +<===> +================================================================================ +<===> double_underscore_name/input.scss +@mixin __a() {b: c} +d {@include __a} + +<===> double_underscore_name/output.css +d { + b: c; +} + +<===> +================================================================================ +<===> custom_ident_include/input.scss +@mixin __a() {b: c} +d {@include --a} + +<===> custom_ident_include/output.css +d { + b: c; +} + +<===> custom_ident_include/warning +DEPRECATION WARNING: Sass @mixin names beginning with -- are deprecated for forward-compatibility with plain CSS mixins. + +For details, see https://sass-lang.com/d/css-function-mixin + + , +2 | d {@include --a} + | ^^^ + ' + input.scss 2:13 root stylesheet + +<===> +================================================================================ +<===> sass/content/semicolon/input.sass +@mixin a + @content; + +<===> sass/content/semicolon/output.css diff --git a/spec/directives/mixin/whitespace.hrx b/spec/directives/mixin/whitespace.hrx new file mode 100644 index 0000000000..2d3249592d --- /dev/null +++ b/spec/directives/mixin/whitespace.hrx @@ -0,0 +1,111 @@ +<===> mixin/before_name/scss/input.scss +@mixin + a {} + +<===> mixin/before_name/scss/output.css + +<===> +================================================================================ +<===> mixin/before_name/sass/input.sass +@mixin + a + +<===> mixin/before_name/sass/output.css + +<===> +================================================================================ +<===> mixin/after_args/scss/input.scss +@mixin a() + {} + +<===> mixin/after_args/scss/output.css + +<===> +================================================================================ +<===> include/before_name/scss/input.scss +@mixin a {} +@include + a + +<===> include/before_name/scss/output.css + +<===> +================================================================================ +<===> include/before_name/sass/input.sass +@mixin a +@include + a + +<===> include/before_name/sass/output.css + +<===> +================================================================================ +<===> include/before_block/scss/input.scss +@mixin a {@content} +@include a() + {} + +<===> include/before_block/scss/output.css + +<===> +================================================================================ +<===> include/before_using/scss/input.scss +@mixin a {@content} +@include a() + using () {} + +<===> include/before_using/scss/output.css + +<===> +================================================================================ +<===> include/after_using/scss/input.scss +@mixin a {@content} +@include a() using + () {} + +<===> include/after_using/scss/output.css + +<===> +================================================================================ +<===> include/after_using/sass/input.sass +@mixin a + @content +@include a() using + () + +<===> include/after_using/sass/output.css + +<===> +================================================================================ +<===> include/after_using_arglist/scss/input.scss +@mixin a {@content} +@include a() using () + {} + +<===> include/after_using_arglist/scss/output.css + +<===> +================================================================================ +<===> error/include/before_using/sass/input.sass +@mixin a + @content +@include a() + using () + +<===> error/include/before_using/sass/error +WARNING: This selector doesn't have any properties and won't be rendered. + + , +4 | using () + | ^^^^^^^^ + ' + input.sass 4:3 root stylesheet + +Error: expected selector. + , +4 | using () + | ^ + ' + input.sass 4:9 @content + input.sass 2:3 a() + input.sass 3:1 root stylesheet From 16da7fbf7e0962b9d2c56958f2e7b1844314763e Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Mon, 2 Dec 2024 14:23:57 -0500 Subject: [PATCH 08/38] Test whitespace in media, moz-document, supports --- spec/css/media/whitespace.hrx | 27 +++ spec/css/moz_document/whitespace.hrx | 51 ++++ spec/css/supports/whitespace.hrx | 335 +++++++++++++++++++++++++++ 3 files changed, 413 insertions(+) create mode 100644 spec/css/media/whitespace.hrx create mode 100644 spec/css/moz_document/whitespace.hrx create mode 100644 spec/css/supports/whitespace.hrx diff --git a/spec/css/media/whitespace.hrx b/spec/css/media/whitespace.hrx new file mode 100644 index 0000000000..38280038c0 --- /dev/null +++ b/spec/css/media/whitespace.hrx @@ -0,0 +1,27 @@ +<===> before_query/scss/input.scss +@media + screen {} + +<===> before_query/scss/output.css + +<===> +================================================================================ +<===> error/before_query/sass/input.sass +@media + screen + +<===> error/before_query/sass/error +Error: Expected identifier. + , +1 | @media + | ^ + ' + input.sass 1:7 root stylesheet + +<===> +================================================================================ +<===> after_query/scss/input.scss +@media screen + {} + +<===> after_query/scss/output.css diff --git a/spec/css/moz_document/whitespace.hrx b/spec/css/moz_document/whitespace.hrx new file mode 100644 index 0000000000..85480abb6d --- /dev/null +++ b/spec/css/moz_document/whitespace.hrx @@ -0,0 +1,51 @@ +<===> before_arg/scss/input.scss +@-moz-document + url-prefix(a) {} + +<===> before_arg/scss/output.css +@-moz-document url-prefix(a) {} + +<===> before_arg/scss/warning +DEPRECATION WARNING: @-moz-document is deprecated and support will be removed in Dart Sass 2.0.0. + +For details, see https://sass-lang.com/d/moz-document. + + , +1 | / @-moz-document +2 | \ url-prefix(a) {} + ' + input.scss 1:1 root stylesheet + +<===> +================================================================================ +<===> error/before_arg/sass/input.sass +@-moz-document + url-prefix(a) + +<===> error/before_arg/sass/error +Error: Expected identifier. + , +1 | @-moz-document + | ^ + ' + input.sass 1:15 root stylesheet + +<===> +================================================================================ +<===> after_arg/scss/input.scss +@-moz-document url-prefix(a) + {} + +<===> after_arg/scss/output.css +@-moz-document url-prefix(a) {} + +<===> after_arg/scss/warning +DEPRECATION WARNING: @-moz-document is deprecated and support will be removed in Dart Sass 2.0.0. + +For details, see https://sass-lang.com/d/moz-document. + + , +1 | / @-moz-document url-prefix(a) +2 | \ {} + ' + input.scss 1:1 root stylesheet diff --git a/spec/css/supports/whitespace.hrx b/spec/css/supports/whitespace.hrx new file mode 100644 index 0000000000..d7fe7c7b44 --- /dev/null +++ b/spec/css/supports/whitespace.hrx @@ -0,0 +1,335 @@ +<===> before_query/scss/input.scss +@supports + (a: b) {c {d: e}} + +<===> before_query/scss/output.css +@supports (a: b) { + c { + d: e; + } +} + +<===> +================================================================================ +<===> error/before_query/sass/input.sass +@supports + (a: b) + c + d: e + +<===> error/before_query/sass/error +Error: expected "(". + , +1 | @supports + | ^ + ' + input.sass 1:10 root stylesheet + +<===> +================================================================================ +<===> declaration/normal_prop/after_open_paren/scss/input.scss +@supports ( + a: b) {c {d: e}} + +<===> declaration/normal_prop/after_open_paren/scss/output.css +@supports (a: b) { + c { + d: e; + } +} + +<===> +================================================================================ +<===> declaration/normal_prop/after_open_paren/sass/options.yml +:todo: + - dart-sass + +<===> declaration/normal_prop/after_open_paren/sass/input.sass +@supports ( + a: b) + c + d: e + +<===> declaration/normal_prop/after_open_paren/sass/output.css +@supports (a: b) { + c { + d: e; + } +} + +<===> +================================================================================ +<===> declaration/normal_prop/before_colon/scss/input.scss +@supports (a + : b) {c {d: e}} + +<===> declaration/normal_prop/before_colon/scss/output.css +@supports (a: b) { + c { + d: e; + } +} + +<===> +================================================================================ +<===> declaration/normal_prop/before_colon/sass/options.yml +:todo: + - dart-sass + +<===> declaration/normal_prop/before_colon/sass/input.sass +@supports (a + : b) + c + d: e + +<===> declaration/normal_prop/before_colon/sass/output.css +@supports (a: b) { + c { + d: e; + } +} + +<===> +================================================================================ +<===> declaration/normal_prop/after_colon/scss/input.scss +@supports (a: + b) {c {d: e}} + +<===> declaration/normal_prop/after_colon/scss/output.css +@supports (a: b) { + c { + d: e; + } +} + +<===> +================================================================================ +<===> declaration/normal_prop/after_colon/sass/options.yml +:todo: + - dart-sass + +<===> declaration/normal_prop/after_colon/sass/input.sass +@supports (a: + b) + c + d: e + +<===> declaration/normal_prop/after_colon/sass/output.css +@supports (a: b) { + c { + d: e; + } +} + +<===> +================================================================================ +<===> declaration/normal_prop/before_close_paren/scss/input.scss +@supports (a: b + ) {c {d: e}} + +<===> declaration/normal_prop/before_close_paren/scss/output.css +@supports (a: b) { + c { + d: e; + } +} + +<===> +================================================================================ +<===> declaration/normal_prop/before_close_paren/sass/options.yml +:todo: + - dart-sass + +<===> declaration/normal_prop/before_close_paren/sass/input.sass +@supports (a: b + ) + c + d: e + +<===> declaration/normal_prop/before_close_paren/sass/output.css +@supports (a: b) { + c { + d: e; + } +} + +<===> +================================================================================ +<===> function/after_open_paren/scss/input.scss +@supports a( + b) {c {d: e}} + +<===> function/after_open_paren/scss/output.css +@supports a( + b) { + c { + d: e; + } +} + +<===> +================================================================================ +<===> function/after_open_paren/sass/options.yml +:todo: + - dart-sass + +<===> function/after_open_paren/sass/input.sass +@supports a( + b) + c + d: e + +<===> function/after_open_paren/sass/output.css +@supports a( + b) { + c { + d: e; + } +} + +<===> +================================================================================ +<===> function/before_close_paren/scss/input.scss +@supports a(b + ) {c {d: e}} + +<===> function/before_close_paren/scss/output.css +@supports a(b + ) { + c { + d: e; + } +} + +<===> +================================================================================ +<===> function/before_close_paren/sass/options.yml +:todo: + - dart-sass + +<===> function/before_close_paren/sass/input.sass +@supports a(b + ) + c + d: e + +<===> function/before_close_paren/sass/output.css +@supports a(b + ) { + c { + d: e; + } +} + +<===> +================================================================================ +<===> anything/after_open_paren/scss/input.scss +@supports ( + a b) {c {d: e}} + +<===> anything/after_open_paren/scss/output.css +@supports (a b) { + c { + d: e; + } +} + +<===> +================================================================================ +<===> anything/after_open_paren/sass/options.yml +:todo: + - dart-sass + +<===> anything/after_open_paren/sass/input.sass +@supports ( + a b) + c + d: e + +<===> anything/after_open_paren/sass/output.css +@supports (a b) { + c { + d: e; + } +} + +<===> +================================================================================ +<===> anything/after_ident/scss/input.scss +@supports (a + b) {c {d: e}} + +<===> anything/after_ident/scss/output.css +@supports (a + b) { + c { + d: e; + } +} + +<===> +================================================================================ +<===> anything/after_ident/sass/options.yml +:todo: + - dart-sass + +<===> anything/after_ident/sass/input.sass +@supports (a + b) + c + d: e + +<===> anything/after_ident/sass/output.css +@supports (a + b) { + c { + d: e; + } +} + +<===> +================================================================================ +<===> anything/before_close_paren/scss/input.scss +@supports (a b + ) {c {d: e}} + +<===> anything/before_close_paren/scss/output.css +@supports (a b + ) { + c { + d: e; + } +} + +<===> +================================================================================ +<===> anything/before_close_paren/sass/options.yml +:todo: + - dart-sass + +<===> anything/before_close_paren/sass/input.sass +@supports (a b + ) + c + d: e + +<===> anything/before_close_paren/sass/output.css +@supports (a b + ) { + c { + d: e; + } +} + +<===> +================================================================================ +<===> after_query/scss/input.scss +@supports (a: b) + {c {d: e}} + +<===> after_query/scss/output.css +@supports (a: b) { + c { + d: e; + } +} From 1da98ad518e55eb756ac096558c2886b4bc92c0c Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Mon, 2 Dec 2024 15:31:14 -0500 Subject: [PATCH 09/38] Test whitespace in use and forward --- spec/directives/forward/whitespace.hrx | 231 ++++++++++++++++++++++++ spec/directives/use/whitespace.hrx | 233 +++++++++++++++++++++++++ 2 files changed, 464 insertions(+) create mode 100644 spec/directives/forward/whitespace.hrx create mode 100644 spec/directives/use/whitespace.hrx diff --git a/spec/directives/forward/whitespace.hrx b/spec/directives/forward/whitespace.hrx new file mode 100644 index 0000000000..9de40e6e63 --- /dev/null +++ b/spec/directives/forward/whitespace.hrx @@ -0,0 +1,231 @@ +<===> before_url/scss/input.scss +@forward + "other" + +<===> before_url/scss/other.scss + +<===> before_url/scss/output.css + +<===> +================================================================================ +<===> before_url/sass/input.sass +@forward + "other" + +<===> before_url/sass/other.scss + +<===> before_url/sass/output.css + +<===> +================================================================================ +<===> before_keyword/scss/input.scss +@forward "other" + as a-* + +<===> before_keyword/scss/other.scss + +<===> before_keyword/scss/output.css + +<===> +================================================================================ +<===> error/before_keyword/sass/input.sass +@forward "other" + as a-* + +<===> error/before_keyword/sass/other.scss + +<===> error/before_keyword/sass/error +Error: Nothing may be indented beneath a @forward rule. + , +2 | as a-* + | ^ + ' + input.sass 2:3 root stylesheet + +<===> +================================================================================ +<===> after_keyword/scss/input.scss +@forward "other" as + a-* + +<===> after_keyword/scss/other.scss + +<===> after_keyword/scss/output.css + +<===> +================================================================================ +<===> after_keyword/sass/input.sass +@forward "other" as + a-* + +<===> after_keyword/sass/other.scss + +<===> after_keyword/sass/output.css + +<===> +================================================================================ +<===> after_open_paren/scss/input.scss +@forward "other" with ( + $a: b) + +<===> after_open_paren/scss/other.scss +$a: 1 !default + +<===> after_open_paren/scss/output.css + +<===> +================================================================================ +<===> after_paren/sass/input.sass +@forward "other" with ( + $a: b) + +<===> after_paren/sass/other.scss +$a: 1 !default + +<===> after_paren/sass/output.css + +<===> +================================================================================ +<===> before_colon/scss/input.scss +@forward "other" with ($a + : b) + +<===> before_colon/scss/other.scss +$a: 1 !default + +<===> before_colon/scss/output.css + +<===> +================================================================================ +<===> before_colon/sass/input.sass +@forward "other" with ($a + : b) + +<===> before_colon/sass/other.scss +$a: 1 !default + +<===> before_colon/sass/output.css + +<===> +================================================================================ +<===> after_colon/scss/input.scss +@forward "other" with ($a: + b) + +<===> after_colon/scss/other.scss +$a: 1 !default + +<===> after_colon/scss/output.css + +<===> +================================================================================ +<===> after_colon/sass/input.sass +@forward "other" with ($a: + b) + +<===> after_colon/sass/other.scss +$a: 1 !default + +<===> after_colon/sass/output.css + +<===> +================================================================================ +<===> after_variable_comma/scss/input.scss +@forward "other" with ($a: b, + $c: d) + +<===> after_variable_comma/scss/other.scss +$a: 1 !default; +$c: 1 !default + +<===> after_variable_comma/scss/output.css + +<===> +================================================================================ +<===> after_variable_comma/sass/options.yml +:todo: + - dart-sass + +<===> after_variable_comma/sass/input.sass +@forward "other" with ($a: b, + $c: d) + +<===> after_variable_comma/sass/other.scss +$a: 1 !default +$c: 1 !default + +<===> after_variable_comma/sass/output.css +================================================================================ +<===> +================================================================================ +<===> before_close_paren/scss/input.scss +@forward "other" with ($a: b + ) + +<===> before_close_paren/scss/other.scss +$a: 1 !default + +<===> before_close_paren/scss/output.css + +<===> +================================================================================ +<===> before_close_paren/sass/options.yml +:todo: + - dart-sass + +<===> before_close_paren/sass/input.sass +@forward "other" with ($a: b + ) + +<===> before_close_paren/sass/other.scss +$a: 1 !default + +<===> before_close_paren/sass/output.css + +<===> +================================================================================ +<===> before_default/scss/input.scss +@forward "other" with ($a: b + !default) + +<===> before_default/scss/other.scss +$a: 1 !default + +<===> before_default/scss/output.css + +<===> +================================================================================ +<===> before_default/sass/options.yml +:todo: + - dart-sass + +<===> before_default/sass/input.sass +@forward "other" with ($a: b + !default) + +<===> before_default/sass/other.scss +$a: 1 !default + +<===> before_default/sass/output.css + +<===> +================================================================================ +<===> after_default/scss/input.scss +@forward "other" with ($a: b !default + ) + +<===> after_default/scss/other.scss +$a: 1 !default + +<===> after_default/scss/output.css + +<===> +================================================================================ +<===> after_default/sass/input.sass +@forward "other" with ($a: b !default + ) + +<===> after_default/sass/other.scss +$a: 1 !default + +<===> after_default/sass/output.css diff --git a/spec/directives/use/whitespace.hrx b/spec/directives/use/whitespace.hrx new file mode 100644 index 0000000000..b70df264d5 --- /dev/null +++ b/spec/directives/use/whitespace.hrx @@ -0,0 +1,233 @@ +<===> before_url/scss/input.scss +@use + "other" + +<===> before_url/scss/other.scss + +<===> before_url/scss/output.css + +<===> +================================================================================ +<===> before_url/sass/input.sass +@use + "other" + +<===> before_url/sass/other.scss + +<===> before_url/sass/output.css + +<===> +================================================================================ +<===> before_keyword/scss/input.scss +@use "other" + as a + +<===> before_keyword/scss/other.scss + +<===> before_keyword/scss/output.css + +<===> +================================================================================ +<===> error/before_keyword/sass/input.sass +@use "other" + as a + +<===> error/before_keyword/sass/other.scss + +<===> error/before_keyword/sass/error +Error: Nothing may be indented beneath a @use rule. + , +2 | as a + | ^ + ' + input.sass 2:3 root stylesheet + +<===> +================================================================================ +<===> after_keyword/scss/input.scss +@use "other" as + a + +<===> after_keyword/scss/other.scss + +<===> after_keyword/scss/output.css + +<===> +================================================================================ +<===> after_keyword/sass/input.sass +@use "other" as + a + +<===> after_keyword/sass/other.scss + +<===> after_keyword/sass/output.css + +<===> +================================================================================ +<===> after_with/scss/input.scss +@use "other" with + ($a: b) + +<===> after_with/scss/other.scss +$a: 1 !default + +<===> after_with/scss/output.css + +<===> +================================================================================ +<===> after_with/sass/input.sass +@use "other" with + ($a: b) + +<===> after_with/sass/other.scss +$a: 1 !default + +<===> after_with/sass/output.css + +<===> +================================================================================ +<===> after_paren/scss/input.scss +@use "other" with ( + $a: b) + +<===> after_paren/scss/other.scss +$a: 1 !default + +<===> after_paren/scss/output.css + +<===> +================================================================================ +<===> after_paren/sass/input.sass +@use "other" with ( + $a: b) + +<===> after_paren/sass/other.scss +$a: 1 !default + +<===> after_paren/sass/output.css + +<===> +================================================================================ +<===> before_colon/scss/input.scss +@use "other" with ($a + : b) + +<===> before_colon/scss/other.scss +$a: 1 !default + +<===> before_colon/scss/output.css + +<===> +================================================================================ +<===> before_colon/sass/input.sass +@use "other" with ($a + : b) + +<===> before_colon/sass/other.scss +$a: 1 !default + +<===> before_colon/sass/output.css + +<===> +================================================================================ +<===> after_colon/scss/input.scss +@use "other" with ($a: + b) + +<===> after_colon/scss/other.scss +$a: 1 !default + +<===> after_colon/scss/output.css + +<===> +================================================================================ +<===> after_colon/sass/input.sass +@use "other" with ($a: + b) + +<===> after_colon/sass/other.scss +$a: 1 !default + +<===> after_colon/sass/output.css + +<===> +================================================================================ +<===> before_close_paren/scss/input.scss +@use "other" with ($a: b + ) + +<===> before_close_paren/scss/other.scss +$a: 1 !default + +<===> before_close_paren/scss/output.css + +<===> +================================================================================ +<===> before_close_paren/sass/options.yml +:todo: + - dart-sass + +<===> before_close_paren/sass/input.sass +@use "other" with ($a: b + ) + +<===> before_close_paren/sass/other.scss +$a: 1 !default + +<===> before_close_paren/sass/output.css + +<===> +================================================================================ +<===> before_variable_comma/scss/input.scss +@use "other" with ($a: b + , $c: d) + +<===> before_variable_comma/scss/other.scss +$a: 1 !default; +$c: 1 !default + +<===> before_variable_comma/scss/output.css + +<===> +================================================================================ +<===> before_variable_comma/sass/options.yml +:todo: + - dart-sass + +<===> before_variable_comma/sass/input.sass +@use "other" with ($a: b + , $c: d) + +<===> before_variable_comma/sass/other.scss +$a: 1 !default +$c: 1 !default + +<===> before_variable_comma/sass/output.css + +<===> +================================================================================ +<===> after_variable_comma/scss/input.scss +@use "other" with ($a: b, + $c: d) + +<===> after_variable_comma/scss/other.scss +$a: 1 !default; +$c: 1 !default + +<===> after_variable_comma/scss/output.css + +<===> +================================================================================ +<===> after_variable_comma/sass/options.yml +:todo: + - dart-sass + +<===> after_variable_comma/sass/input.sass +@use "other" with ($a: b, + $c: d) + +<===> after_variable_comma/sass/other.scss +$a: 1 !default +$c: 1 !default + +<===> after_variable_comma/sass/output.css From 36ea028788aef72491d118ca40dfb10babbf0908 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Mon, 2 Dec 2024 16:10:26 -0500 Subject: [PATCH 10/38] Test @function and @return whitespace --- spec/directives/function/comment.hrx | 60 ++++++++++++++++++++ spec/directives/{ => function}/function.hrx | 63 --------------------- spec/directives/function/whitespace.hrx | 30 ++++++++++ 3 files changed, 90 insertions(+), 63 deletions(-) create mode 100644 spec/directives/function/comment.hrx rename spec/directives/{ => function}/function.hrx (55%) create mode 100644 spec/directives/function/whitespace.hrx diff --git a/spec/directives/function/comment.hrx b/spec/directives/function/comment.hrx new file mode 100644 index 0000000000..4bc66b00d7 --- /dev/null +++ b/spec/directives/function/comment.hrx @@ -0,0 +1,60 @@ +<===> function/before_name/loud/input.scss +@function /**/ a() {} + +<===> function/before_name/loud/output.css + +<===> +================================================================================ +<===> function/before_name/silent/input.scss +@function // + a() {} + +<===> function/before_name/silent/output.css + +<===> +================================================================================ +<===> function/after_args/loud/input.scss +@function a() /**/ {} + +<===> function/after_args/loud/output.css + +<===> +================================================================================ +<===> function/after_args/silent/input.scss +@function a() // + {} + +<===> function/after_args/silent/output.css + +<===> +================================================================================ +<===> return/before_value/loud/input.scss +@function a() {@return /**/ b} + +<===> return/before_value/loud/output.css + +<===> +================================================================================ +<===> return/before_value/silent/input.scss +@function a() { + @return // + b +} + +<===> return/before_value/silent/output.css + +<===> +================================================================================ +<===> return/after_value/loud/input.scss +@function a() {@return b /**/} + +<===> return/after_value/loud/output.css + +<===> +================================================================================ +<===> return/after_value/silent/input.scss +@function a() { + @return b // +} + +<===> return/after_value/silent/output.css diff --git a/spec/directives/function.hrx b/spec/directives/function/function.hrx similarity index 55% rename from spec/directives/function.hrx rename to spec/directives/function/function.hrx index 96f0e23cdd..6c8ef5ed42 100644 --- a/spec/directives/function.hrx +++ b/spec/directives/function/function.hrx @@ -91,66 +91,3 @@ b {c: -moz_calc()} b { c: 1; } - -<===> -================================================================================ -<===> comment/function/before_name/loud/input.scss -@function /**/ a() {} - -<===> comment/function/before_name/loud/output.css - -<===> -================================================================================ -<===> comment/function/before_name/silent/input.scss -@function // - a() {} - -<===> comment/function/before_name/silent/output.css - -<===> -================================================================================ -<===> comment/function/after_args/loud/input.scss -@function a() /**/ {} - -<===> comment/function/after_args/loud/output.css - -<===> -================================================================================ -<===> comment/function/after_args/silent/input.scss -@function a() // - {} - -<===> comment/function/after_args/silent/output.css - -<===> -================================================================================ -<===> comment/return/before_value/loud/input.scss -@function a() {@return /**/ b} - -<===> comment/return/before_value/loud/output.css - -<===> -================================================================================ -<===> comment/return/before_value/silent/input.scss -@function a() { - @return // - b -} - -<===> comment/return/before_value/silent/output.css - -<===> -================================================================================ -<===> comment/return/after_value/loud/input.scss -@function a() {@return b /**/} - -<===> comment/return/after_value/loud/output.css - -<===> -================================================================================ -<===> comment/return/after_value/silent/input.scss -@function a() { - @return b // -} - -<===> comment/return/after_value/silent/output.css diff --git a/spec/directives/function/whitespace.hrx b/spec/directives/function/whitespace.hrx new file mode 100644 index 0000000000..201d77948f --- /dev/null +++ b/spec/directives/function/whitespace.hrx @@ -0,0 +1,30 @@ +<===> function/before_name/scss/input.scss +@function + a() {} + +<===> function/before_name/scss/output.css + +<===> +================================================================================ +<===> function/before_name/sass/input.sass +@function + a() + +<===> function/before_name/sass/output.css + +<===> +================================================================================ +<===> return/before_value/scss/input.scss +@function a() {@return + b} + +<===> return/before_value/scss/output.css + +<===> +================================================================================ +<===> error/return/before_value/sass/input.sass +@function a() + @return + b + +<===> error/return/before_value/sass/output.css From e133cf39d4cfd272d2754154b2dee782679f077f Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Tue, 3 Dec 2024 14:29:21 -0500 Subject: [PATCH 11/38] Test whitespace in @if --- spec/directives/function/whitespace.hrx | 4 +- spec/directives/if/comment.hrx | 48 ++++---- spec/directives/if/sass.hrx | 6 +- spec/directives/if/whitespace.hrx | 139 ++++++++++++++++++++++++ 4 files changed, 168 insertions(+), 29 deletions(-) create mode 100644 spec/directives/if/whitespace.hrx diff --git a/spec/directives/function/whitespace.hrx b/spec/directives/function/whitespace.hrx index 201d77948f..48c27f5ef3 100644 --- a/spec/directives/function/whitespace.hrx +++ b/spec/directives/function/whitespace.hrx @@ -22,9 +22,9 @@ <===> ================================================================================ -<===> error/return/before_value/sass/input.sass +<===> return/before_value/sass/input.sass @function a() @return b -<===> error/return/before_value/sass/output.css +<===> return/before_value/sass/output.css diff --git a/spec/directives/if/comment.hrx b/spec/directives/if/comment.hrx index 1252255886..6a6b30922e 100644 --- a/spec/directives/if/comment.hrx +++ b/spec/directives/if/comment.hrx @@ -1,95 +1,95 @@ -<===> comment/if/before_condition/loud/input.scss +<===> if/before_condition/loud/input.scss @if /**/ true {} -<===> comment/if/before_condition/loud/output.css +<===> if/before_condition/loud/output.css <===> ================================================================================ -<===> comment/if/before_condition/silent/input.scss +<===> if/before_condition/silent/input.scss @if // true {} -<===> comment/if/before_condition/silent/output.css +<===> if/before_condition/silent/output.css <===> ================================================================================ -<===> comment/if/after_condition/loud/input.scss +<===> if/after_condition/loud/input.scss @if true /**/ {} -<===> comment/if/after_condition/loud/output.css +<===> if/after_condition/loud/output.css <===> ================================================================================ -<===> comment/if/after_condition/silent/input.scss +<===> if/after_condition/silent/input.scss @if true // {} -<===> comment/if/after_condition/silent/output.css +<===> if/after_condition/silent/output.css <===> ================================================================================ -<===> comment/else_if/before_if/loud/input.scss +<===> else_if/before_if/loud/input.scss @if true {} @else /**/ if true {} -<===> comment/else_if/before_if/loud/output.css +<===> else_if/before_if/loud/output.css <===> ================================================================================ -<===> comment/else_if/before_if/silent/input.scss +<===> else_if/before_if/silent/input.scss @if true {} @else // if true {} -<===> comment/else_if/before_if/silent/output.css +<===> else_if/before_if/silent/output.css <===> ================================================================================ -<===> comment/else_if/before_condition/loud/input.scss +<===> else_if/before_condition/loud/input.scss @if true {} @else if /**/ true {} -<===> comment/else_if/before_condition/loud/output.css +<===> else_if/before_condition/loud/output.css <===> ================================================================================ -<===> comment/else_if/before_condition/silent/input.scss +<===> else_if/before_condition/silent/input.scss @if true {} @else if // true {} -<===> comment/else_if/before_condition/silent/output.css +<===> else_if/before_condition/silent/output.css <===> ================================================================================ -<===> comment/else_if/after_condition/loud/input.scss +<===> else_if/after_condition/loud/input.scss @if true {} @else if true /**/ {} -<===> comment/else_if/after_condition/loud/output.css +<===> else_if/after_condition/loud/output.css <===> ================================================================================ -<===> comment/else_if/after_condition/silent/input.scss +<===> else_if/after_condition/silent/input.scss @if true {} @else if true // {} -<===> comment/else_if/after_condition/silent/output.css +<===> else_if/after_condition/silent/output.css <===> ================================================================================ -<===> comment/else/before_block/loud/input.scss +<===> else/before_block/loud/input.scss @if true {} @else /**/ {} -<===> comment/else/before_block/loud/output.css +<===> else/before_block/loud/output.css <===> ================================================================================ -<===> comment/else/before_block/silent/input.scss +<===> else/before_block/silent/input.scss @if true {} @else // {} -<===> comment/else/before_block/silent/output.css +<===> else/before_block/silent/output.css diff --git a/spec/directives/if/sass.hrx b/spec/directives/if/sass.hrx index c688c4057a..b158a84767 100644 --- a/spec/directives/if/sass.hrx +++ b/spec/directives/if/sass.hrx @@ -68,7 +68,7 @@ a <===> error/if-statement-unwrapped-multiline/error Error: Expected expression. , -4 | @if - | ^ +5 | $a == b and + | ^ ' - input.sass 4:7 root stylesheet + input.sass 5:16 root stylesheet diff --git a/spec/directives/if/whitespace.hrx b/spec/directives/if/whitespace.hrx new file mode 100644 index 0000000000..c34fe6c96f --- /dev/null +++ b/spec/directives/if/whitespace.hrx @@ -0,0 +1,139 @@ +<===> if/before_condition/scss/input.scss +@if + true {} + +<===> if/before_condition/scss/output.css + +<===> +================================================================================ +<===> if/before_condition/sass/input.sass +@if + true + +<===> if/before_condition/sass/output.css + +<===> +================================================================================ +<===> else_if/before_if/scss/input.scss +@if true {} +@else + if true {} + +<===> else_if/before_if/scss/output.css + +<===> +================================================================================ +<===> else_if/before_if/sass/input.sass +@if true +@else + if true + +<===> else_if/before_if/sass/output.css + +<===> +================================================================================ +<===> else_if/before_condition/scss/input.scss +@if true {} +@else if + true {} + +<===> else_if/before_condition/scss/output.css + +<===> +================================================================================ +<===> else_if/before_condition/sass/input.sass +@if true +@else if + true + +<===> else_if/before_condition/sass/output.css + +<===> +================================================================================ +<===> else_if/after_condition/scss/input.scss +@if true {} +@else if true + {} + +<===> else_if/after_condition/scss/output.css + +<===> +================================================================================ +<===> else/before_block/scss/input.scss +@if true {} +@else + {} + +<===> else/before_block/scss/output.css + +<===> +================================================================================ +<===> condition/before_and/scss/input.scss +@if true + and true{} + +<===> condition/before_and/scss/output.css + +<===> +================================================================================ +<===> condition/after_and/scss/input.scss +@if true and + true {} + +<===> condition/after_and/scss/output.css + +<===> +================================================================================ +<===> condition/after_and/sass/options.yml +:todo: + - dart-sass + +<===> condition/after_and/sass/input.sass +@if true and + true + +<===> condition/after_and/sass/output.css + +<===> +================================================================================ +<===> error/condition/before_and/sass/input.sass +@if true + and true + +<===> error/condition/before_and/sass/output.css + +<===> error/condition/before_and/sass/warning +WARNING: This selector doesn't have any properties and won't be rendered. + + , +2 | and true + | ^^^^^^^^ + ' + input.sass 2:3 root stylesheet + +<===> +================================================================================ +<===> error/top_level_else/sass/input.sass +@else + +<===> error/top_level_else/sass/error +Error: This at-rule is not allowed here. + , +1 | @else + | ^^^^^ + ' + input.sass 1:1 root stylesheet + +<===> +================================================================================ +<===> error/top_level_else_if/sass/input.sass +@else +if + +<===> error/top_level_else_if/sass/error +Error: This at-rule is not allowed here. + , +1 | @else + | ^^^^^ + ' + input.sass 1:1 root stylesheet From a9f411883ff425696072196b4f9c6adb674f946c Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Tue, 3 Dec 2024 15:02:02 -0500 Subject: [PATCH 12/38] Add @for and @while whitespace tests --- spec/directives/for/whitespace.hrx | 128 +++++++++++++++++++++++++++++ spec/directives/while.hrx | 13 +++ 2 files changed, 141 insertions(+) create mode 100644 spec/directives/for/whitespace.hrx create mode 100644 spec/directives/while.hrx diff --git a/spec/directives/for/whitespace.hrx b/spec/directives/for/whitespace.hrx new file mode 100644 index 0000000000..4cb4b9f801 --- /dev/null +++ b/spec/directives/for/whitespace.hrx @@ -0,0 +1,128 @@ +<===> before_var/scss/input.scss +@for + $i from 1 through 10 {} + +<===> before_var/scss/output.css + +<===> +================================================================================ +<===> before_var/sass/input.sass +@for + $i from 1 through 10 + + +<===> before_var/sass/output.css + +<===> +================================================================================ +<===> before_from/scss/input.scss +@for $i + from 1 through 10 {} + +<===> before_from/scss/output.css + +<===> +================================================================================ +<===> before_from/sass/input.sass +@for $i + from 1 through 10 + +<===> before_from/sass/output.css + +<===> +================================================================================ +<===> after_from/scss/input.scss +@for $i from + 1 through 10 {} + +<===> after_from/scss/output.css + +<===> +================================================================================ +<===> after_from/sass/input.sass +@for $i from + 1 through 10 + +<===> after_from/sass/output.css + +<===> +================================================================================ +<===> before_through/scss/input.scss +@for $i from 1 + through 10 {} + +<===> before_through/scss/output.css + +<===> +================================================================================ +<===> before_through/sass/options.yml +:todo: + - dart-sass + +<===> before_through/sass/input.sass +@for $i from 1 + through 10 + +<===> before_through/sass/output.css + +<===> +================================================================================ +<===> after_through/scss/input.scss +@for $i from 1 through + 10 {} + + +<===> after_through/scss/output.css + +<===> +================================================================================ +<===> after_through/sass/input.sass +@for $i from 1 through + 10 + +<===> after_through/sass/output.css + +<===> +================================================================================ +<===> before_to/scss/input.scss +@for $i from 1 + to 10 {} + +<===> before_to/scss/output.css + +<===> +================================================================================ +<===> before_to/sass/options.yml +:todo: + - dart-sass + +<===> before_to/sass/input.sass +@for $i from 1 + to 10 + +<===> before_to/sass/output.css + +<===> +================================================================================ +<===> after_to/scss/input.scss +@for $i from 1 to + 10 {} + + +<===> after_to/scss/output.css + +<===> +================================================================================ +<===> after_to/sass/input.sass +@for $i from 1 to + 10 + +<===> after_to/sass/output.css + +<===> +================================================================================ +<===> before_block/scss/input.scss +@for $i from 1 through 10 + {} + +<===> before_block/scss/output.css diff --git a/spec/directives/while.hrx b/spec/directives/while.hrx new file mode 100644 index 0000000000..bc7843a748 --- /dev/null +++ b/spec/directives/while.hrx @@ -0,0 +1,13 @@ +<===> before_var/scss/input.scss +@while + false {} + +<===> before_var/scss/output.css + +<===> +================================================================================ +<===> before_var/sass/input.sass +@while + false + +<===> before_var/sass/output.css From 66e3afadc90db2123be01303147d25d47b7454e7 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Tue, 3 Dec 2024 15:24:06 -0500 Subject: [PATCH 13/38] Add unknown at rule whitespace tests --- spec/css/unknown_directive/whitespace.hrx | 66 +++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 spec/css/unknown_directive/whitespace.hrx diff --git a/spec/css/unknown_directive/whitespace.hrx b/spec/css/unknown_directive/whitespace.hrx new file mode 100644 index 0000000000..de34029618 --- /dev/null +++ b/spec/css/unknown_directive/whitespace.hrx @@ -0,0 +1,66 @@ +<===> no_children/before_value/scss/input.scss +@a + b + +<===> no_children/before_value/scss/output.css +@a b; + +<===> +================================================================================ +<===> no_children/before_value/sass/input.sass +@a + b + +<===> no_children/before_value/sass/output.css +@a {} + +<===> no_children/before_value/sass/warning +WARNING: This selector doesn't have any properties and won't be rendered. + + , +2 | b + | ^ + ' + input.sass 2:3 root stylesheet + +<===> +================================================================================ +<===> error/children/before_value/sass/input.sass +@a + b + c: d + +<===> error/children/before_value/sass/output.css +@a { + b { + c: d; + } +} + +<===> +================================================================================ +<===> children/before_value/scss/input.scss +@a + b {} + +<===> children/before_value/scss/output.css +@a b {} + +<===> +================================================================================ +<===> children/no_value/scss/input.scss +@a + {} + +<===> children/no_value/scss/output.css +@a {} + +<===> +================================================================================ +<===> children/no_value/sass/input.sass +@a + c: d +<===> children/no_value/sass/output.css +@a { + c: d; +} From 4120ffd24872cf9e2f9155085437e2e12376559f Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Tue, 3 Dec 2024 15:57:47 -0500 Subject: [PATCH 14/38] Test @at-root whitespace --- spec/directives/{ => at_root}/at_root.hrx | 105 ------------------ spec/directives/at_root/comment.hrx | 102 +++++++++++++++++ spec/directives/at_root/whitespace.hrx | 128 ++++++++++++++++++++++ 3 files changed, 230 insertions(+), 105 deletions(-) rename spec/directives/{ => at_root}/at_root.hrx (50%) create mode 100644 spec/directives/at_root/comment.hrx create mode 100644 spec/directives/at_root/whitespace.hrx diff --git a/spec/directives/at_root.hrx b/spec/directives/at_root/at_root.hrx similarity index 50% rename from spec/directives/at_root.hrx rename to spec/directives/at_root/at_root.hrx index d27d692ed3..447414c16b 100644 --- a/spec/directives/at_root.hrx +++ b/spec/directives/at_root/at_root.hrx @@ -167,108 +167,3 @@ a { a b { c: d; } - -<===> -================================================================================ -<===> comment/before_query/loud/input.scss -@at-root /**/ (without: media) {} - -<===> comment/before_query/loud/output.css - -<===> -================================================================================ -<===> comment/before_query/silent/input.scss -@at-root // - (without: media) {} - -<===> comment/before_query/silent/output.css - -<===> -================================================================================ -<===> comment/after_open_paren/loud/input.scss -@at-root (/**/ without: media) {} - -<===> comment/after_open_paren/loud/output.css - -<===> -================================================================================ -<===> comment/after_open_paren/silent/input.scss -@at-root (// - without: media) {} - -<===> comment/after_open_paren/silent/output.css - -<===> -================================================================================ -<===> comment/before_colon/loud/input.scss -@at-root (without /**/ : media) {} - -<===> comment/before_colon/loud/output.css - -<===> -================================================================================ -<===> comment/before_colon/silent/input.scss -@at-root (without // - : media) {} - -<===> comment/before_colon/silent/output.css - -<===> -================================================================================ -<===> comment/after_colon/loud/input.scss -@at-root (without: /**/ media) {} - -<===> comment/after_colon/loud/output.css - -<===> -================================================================================ -<===> comment/after_colon/silent/input.scss -@at-root (without: // - media) {} - -<===> comment/after_colon/silent/output.css - -<===> -================================================================================ -<===> comment/before_close_paren/loud/input.scss -@at-root (without: media /**/) {} - -<===> comment/before_close_paren/loud/output.css - -<===> -================================================================================ -<===> comment/before_close_paren/silent/input.scss -@at-root (without: media // - ) {} - -<===> comment/before_close_paren/silent/output.css - -<===> -================================================================================ -<===> comment/after_query/loud/input.scss -@at-root (without: media) /**/ {} - -<===> comment/after_query/loud/output.css - -<===> -================================================================================ -<===> comment/after_query/silent/input.scss -@at-root (without: media) // - {} - -<===> comment/after_query/silent/output.css - -<===> -================================================================================ -<===> comment/no_query/loud/input.scss -@at-root /**/ {} - -<===> comment/no_query/loud/output.css - -<===> -================================================================================ -<===> comment/no_query/silent/input.scss -@at-root // - {} - -<===> comment/no_query/silent/output.css diff --git a/spec/directives/at_root/comment.hrx b/spec/directives/at_root/comment.hrx new file mode 100644 index 0000000000..d829eee408 --- /dev/null +++ b/spec/directives/at_root/comment.hrx @@ -0,0 +1,102 @@ +<===> before_query/loud/input.scss +@at-root /**/ (without: media) {} + +<===> before_query/loud/output.css + +<===> +================================================================================ +<===> before_query/silent/input.scss +@at-root // + (without: media) {} + +<===> before_query/silent/output.css + +<===> +================================================================================ +<===> after_open_paren/loud/input.scss +@at-root (/**/ without: media) {} + +<===> after_open_paren/loud/output.css + +<===> +================================================================================ +<===> after_open_paren/silent/input.scss +@at-root (// + without: media) {} + +<===> after_open_paren/silent/output.css + +<===> +================================================================================ +<===> before_colon/loud/input.scss +@at-root (without /**/ : media) {} + +<===> before_colon/loud/output.css + +<===> +================================================================================ +<===> before_colon/silent/input.scss +@at-root (without // + : media) {} + +<===> before_colon/silent/output.css + +<===> +================================================================================ +<===> after_colon/loud/input.scss +@at-root (without: /**/ media) {} + +<===> after_colon/loud/output.css + +<===> +================================================================================ +<===> after_colon/silent/input.scss +@at-root (without: // + media) {} + +<===> after_colon/silent/output.css + +<===> +================================================================================ +<===> before_close_paren/loud/input.scss +@at-root (without: media /**/) {} + +<===> before_close_paren/loud/output.css + +<===> +================================================================================ +<===> before_close_paren/silent/input.scss +@at-root (without: media // + ) {} + +<===> before_close_paren/silent/output.css + +<===> +================================================================================ +<===> after_query/loud/input.scss +@at-root (without: media) /**/ {} + +<===> after_query/loud/output.css + +<===> +================================================================================ +<===> after_query/silent/input.scss +@at-root (without: media) // + {} + +<===> after_query/silent/output.css + +<===> +================================================================================ +<===> no_query/loud/input.scss +@at-root /**/ {} + +<===> no_query/loud/output.css + +<===> +================================================================================ +<===> no_query/silent/input.scss +@at-root // + {} + +<===> no_query/silent/output.css diff --git a/spec/directives/at_root/whitespace.hrx b/spec/directives/at_root/whitespace.hrx new file mode 100644 index 0000000000..9236d56ad4 --- /dev/null +++ b/spec/directives/at_root/whitespace.hrx @@ -0,0 +1,128 @@ +<===> before_query/scss/input.scss +@at-root + (without: media) {} + +<===> before_query/scss/output.css + +<===> +================================================================================ +<===> before_query/sass/input.sass +@at-root + (without: media) + +<===> before_query/sass/error +WARNING: This selector doesn't have any properties and won't be rendered. + + , +2 | (without: media) + | ^^^^^^^^^^^^^^^^ + ' + input.sass 2:3 root stylesheet + +Error: expected selector. + , +1 | @at-root + | ^ + ' + input.sass 1:9 root stylesheet + +<===> +================================================================================ +<===> after_open_paren/scss/input.scss +@at-root ( + without: media) {} + +<===> after_open_paren/scss/output.css + +<===> +================================================================================ +<===> after_open_paren/sass/input.sass +@at-root ( + without: media) + +<===> after_open_paren/sass/output.css + +<===> +================================================================================ +<===> before_colon/scss/input.scss +@at-root (without + : media) {} + +<===> before_colon/scss/output.css + +<===> +================================================================================ +<===> before_colon/sass/options.yml +:todo: + - dart-sass + +<===> before_colon/sass/input.sass +@at-root (without + : media) + +<===> before_colon/sass/output.css + +<===> +================================================================================ +<===> after_colon/scss/input.scss +@at-root (without: + media) {} + +<===> after_colon/scss/output.css + +<===> +================================================================================ +<===> after_colon/sass/input.sass +@at-root (without: + media) + +<===> after_colon/sass/output.css + +<===> +================================================================================ +<===> before_close_paren/scss/input.scss +@at-root (without: media + ) {} + +<===> before_close_paren/scss/output.css + +<===> +================================================================================ +<===> before_close_paren/sass/options.yml +:todo: + - dart-sass + +<===> before_close_paren/sass/input.sass +@at-root (without: media + ) + +<===> before_close_paren/sass/output.css + +<===> +================================================================================ +<===> after_query/scss/input.scss +@at-root (without: media) + {} + +<===> after_query/scss/output.css + +<===> +================================================================================ +<===> no_query/scss/input.scss +@at-root + {} + +<===> no_query/scss/output.css + +<===> +================================================================================ +<===> no_query/sass/input.sass +a + @at-root + b + c: d + +<===> no_query/sass/output.css +b { + c: d; +} From b0ecac991cf19fc21e52d28985c65368f746dc53 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Wed, 4 Dec 2024 10:39:06 -0500 Subject: [PATCH 15/38] Test whitespace in args and @charset --- spec/arguments/whitespace.hrx | 285 ++++++++++++++++++++++++++++++++++ spec/css/charset.hrx | 13 ++ 2 files changed, 298 insertions(+) create mode 100644 spec/arguments/whitespace.hrx create mode 100644 spec/css/charset.hrx diff --git a/spec/arguments/whitespace.hrx b/spec/arguments/whitespace.hrx new file mode 100644 index 0000000000..f99144b756 --- /dev/null +++ b/spec/arguments/whitespace.hrx @@ -0,0 +1,285 @@ +<===> function/after_paren/scss/input.scss +@function a( + $b, $c){} + +<===> function/after_paren/scss/output.css + +<===> +================================================================================ +<===> function/after_paren/sass/input.sass +@function a( + $b, $c) + +<===> function/after_paren/sass/output.css + +<===> +================================================================================ +<===> function/after_arg/scss/input.scss +@function a($b + , $c){} + +<===> function/after_arg/scss/output.css + +<===> +================================================================================ +<===> function/after_arg/sass/input.sass +@function a($b + , $c) + +<===> function/after_arg/sass/output.css + +<===> +================================================================================ +<===> function/after_comma/scss/input.scss +@function a($b, + $c){} + +<===> function/after_comma/scss/output.css + +<===> +================================================================================ +<===> function/after_comma/sass/input.sass +@function a($b, + $c) + +<===> function/after_comma/sass/output.css + +<===> +================================================================================ +<===> function/before_colon/scss/input.scss +@function a($b, $c + :d){} + +<===> function/before_colon/scss/output.css + +<===> +================================================================================ +<===> function/before_colon/sass/input.sass +@function a($b, $c + :d) + +<===> function/before_colon/sass/output.css + +<===> +================================================================================ +<===> function/after_colon/scss/input.scss +@function a($b, $c: + d){} + +<===> function/after_colon/scss/output.css + +<===> +================================================================================ +<===> function/after_colon/sass/input.sass +@function a($b, $c: + d) + +<===> function/after_colon/sass/output.css + +<===> +================================================================================ +<===> function/before_paren/scss/input.scss +@function a($b, $c + ){} + +<===> function/before_paren/scss/output.css + +<===> +================================================================================ +<===> function/before_paren/sass/input.sass +@function a($b, $c + ) + +<===> function/before_paren/sass/output.css + +<===> +================================================================================ +<===> function/before_list_arg/scss/input.scss +@function a( + $b...){} + +<===> function/before_list_arg/scss/output.css + +<===> +================================================================================ +<===> function/before_list_arg/sass/input.sass +@function a( + $b...) + +<===> function/before_list_arg/sass/output.css + +<===> +================================================================================ +<===> function/before_list/scss/input.scss +@function a($b + ...){} + +<===> function/before_list/scss/output.css + +<===> +================================================================================ +<===> function/before_list/sass/input.sass +@function a($b + ...) + +<===> function/before_list/sass/output.css + +<===> +================================================================================ +<===> function/after_list/scss/input.scss +@function a($b... + ){} + +<===> function/after_list/scss/output.css + +<===> +================================================================================ +<===> function/after_list/sass/input.sass +@function a($b... + ) + +<===> function/after_list/sass/output.css + +<===> +================================================================================ +<===> mixin/after_paren/scss/input.scss +@mixin a( + $b, $c){} + +<===> mixin/after_paren/scss/output.css + +<===> +================================================================================ +<===> mixin/after_paren/sass/input.sass +@mixin a( + $b, $c) + +<===> mixin/after_paren/sass/output.css + +<===> +================================================================================ +<===> mixin/after_arg/scss/input.scss +@mixin a($b + , $c){} + +<===> mixin/after_arg/scss/output.css + +<===> +================================================================================ +<===> mixin/after_arg/sass/input.sass +@mixin a($b + , $c) + +<===> mixin/after_arg/sass/output.css + +<===> +================================================================================ +<===> mixin/after_comma/scss/input.scss +@mixin a($b, + $c){} + +<===> mixin/after_comma/scss/output.css + +<===> +================================================================================ +<===> mixin/after_comma/sass/input.sass +@mixin a($b, + $c) + +<===> mixin/after_comma/sass/output.css + +<===> +================================================================================ +<===> mixin/before_colon/scss/input.scss +@mixin a($b, $c + :d){} + +<===> mixin/before_colon/scss/output.css + +<===> +================================================================================ +<===> mixin/before_colon/sass/input.sass +@mixin a($b, $c + :d) + +<===> mixin/before_colon/sass/output.css + +<===> +================================================================================ +<===> mixin/after_colon/scss/input.scss +@mixin a($b, $c: + d){} + +<===> mixin/after_colon/scss/output.css + +<===> +================================================================================ +<===> mixin/after_colon/sass/input.sass +@mixin a($b, $c: + d) + +<===> mixin/after_colon/sass/output.css + +<===> +================================================================================ +<===> mixin/before_paren/scss/input.scss +@mixin a($b, $c + ){} + +<===> mixin/before_paren/scss/output.css + +<===> +================================================================================ +<===> mixin/before_paren/sass/input.sass +@mixin a($b, $c + ) + +<===> mixin/before_paren/sass/output.css + +<===> +================================================================================ +<===> mixin/before_list_arg/scss/input.scss +@mixin a( + $b...){} + +<===> mixin/before_list_arg/scss/output.css + +<===> +================================================================================ +<===> mixin/before_list_arg/sass/input.sass +@mixin a( + $b...) + +<===> mixin/before_list_arg/sass/output.css + +<===> +================================================================================ +<===> mixin/before_list/scss/input.scss +@mixin a($b + ...){} + +<===> mixin/before_list/scss/output.css + +<===> +================================================================================ +<===> mixin/before_list/sass/input.sass +@mixin a($b + ...) + +<===> mixin/before_list/sass/output.css + +<===> +================================================================================ +<===> mixin/after_list/scss/input.scss +@mixin a($b... + ){} + +<===> mixin/after_list/scss/output.css + +<===> +================================================================================ +<===> mixin/after_list/sass/input.sass +@mixin a($b... + ) + +<===> mixin/after_list/sass/output.css diff --git a/spec/css/charset.hrx b/spec/css/charset.hrx new file mode 100644 index 0000000000..526215cd0f --- /dev/null +++ b/spec/css/charset.hrx @@ -0,0 +1,13 @@ +<===> whitespace/scss/input.scss +@charset + "a"; + +<===> whitespace/scss/output.css + +<===> +================================================================================ +<===> whitespace/sass/input.sass +@charset + "a" + +<===> whitespace/sass/output.css From 76630576408405369d8498deca727125fa52f81f Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Wed, 4 Dec 2024 12:14:47 -0500 Subject: [PATCH 16/38] Test variables whitespace --- spec/directives/mixin/whitespace.hrx | 30 +++++++ spec/variables/comments.hrx | 41 ++++++++++ spec/{ => variables}/variables.hrx | 44 ---------- spec/variables/whitespace.hrx | 118 +++++++++++++++++++++++++++ 4 files changed, 189 insertions(+), 44 deletions(-) create mode 100644 spec/variables/comments.hrx rename spec/{ => variables}/variables.hrx (51%) create mode 100644 spec/variables/whitespace.hrx diff --git a/spec/directives/mixin/whitespace.hrx b/spec/directives/mixin/whitespace.hrx index 2d3249592d..dc9ea8de4b 100644 --- a/spec/directives/mixin/whitespace.hrx +++ b/spec/directives/mixin/whitespace.hrx @@ -20,6 +20,17 @@ <===> mixin/after_args/scss/output.css +<===> +================================================================================ +<===> mixin/equals/before_name/sass/input.sass += + a + +d + @include a + +<===> mixin/equals/before_name/sass/output.css + <===> ================================================================================ <===> include/before_name/scss/input.scss @@ -109,3 +120,22 @@ Error: expected selector. input.sass 4:9 @content input.sass 2:3 a() input.sass 3:1 root stylesheet + +<===> +================================================================================ +<===> error/include/plus/before_name/sass/input.sass +@mixin a +b + + + a + +<===> error/include/plus/before_name/sass/output.css + +<===> error/include/plus/before_name/sass/warning +WARNING: This selector doesn't have any properties and won't be rendered. + + , +4 | a + | ^ + ' + input.sass 4:5 root stylesheet diff --git a/spec/variables/comments.hrx b/spec/variables/comments.hrx new file mode 100644 index 0000000000..1fbc3cf47b --- /dev/null +++ b/spec/variables/comments.hrx @@ -0,0 +1,41 @@ +<===> before_colon/loud/input.scss +$a /**/: b + +<===> before_colon/loud/output.css + +<===> +================================================================================ +<===> before_colon/silent/input.scss +$a // + : b + +<===> before_colon/silent/output.css + +<===> +================================================================================ +<===> after_colon/loud/input.scss +$a: /**/ b + +<===> after_colon/loud/output.css + +<===> +================================================================================ +<===> after_colon/silent/input.scss +$a: // + b + +<===> after_colon/silent/output.css + +<===> +================================================================================ +<===> after_value/loud/input.scss +$a: b /**/ + +<===> after_value/loud/output.css + +<===> +================================================================================ +<===> after_value/silent/input.scss +$a: b // + +<===> after_value/silent/output.css diff --git a/spec/variables.hrx b/spec/variables/variables.hrx similarity index 51% rename from spec/variables.hrx rename to spec/variables/variables.hrx index bb431ec313..581a8832a3 100644 --- a/spec/variables.hrx +++ b/spec/variables/variables.hrx @@ -61,47 +61,3 @@ This will be an error in Dart Sass 2.0.0. | ^^^^^^^ ' input.scss 3:17 root stylesheet - -<===> -================================================================================ -<===> comment/before_colon/loud/input.scss -$a /**/: b - -<===> comment/before_colon/loud/output.css - -<===> -================================================================================ -<===> comment/before_colon/silent/input.scss -$a // - : b - -<===> comment/before_colon/silent/output.css - -<===> -================================================================================ -<===> comment/after_colon/loud/input.scss -$a: /**/ b - -<===> comment/after_colon/loud/output.css - -<===> -================================================================================ -<===> comment/after_colon/silent/input.scss -$a: // - b - -<===> comment/after_colon/silent/output.css - -<===> -================================================================================ -<===> comment/after_value/loud/input.scss -$a: b /**/ - -<===> comment/after_value/loud/output.css - -<===> -================================================================================ -<===> comment/after_value/silent/input.scss -$a: b // - -<===> comment/after_value/silent/output.css diff --git a/spec/variables/whitespace.hrx b/spec/variables/whitespace.hrx new file mode 100644 index 0000000000..21f07337fd --- /dev/null +++ b/spec/variables/whitespace.hrx @@ -0,0 +1,118 @@ +<===> before_colon/scss/input.scss +$a + : b + +<===> before_colon/scss/output.css + +<===> +================================================================================ +<===> before_colon/sass/input.sass +$a + : b + +<===> before_colon/sass/output.css + +<===> +================================================================================ +<===> after_colon/scss/input.scss +$a: + b + +<===> after_colon/scss/output.css + +<===> +================================================================================ +<===> after_colon/sass/input.sass +$a: + b + +<===> after_colon/sass/output.css + +<===> +================================================================================ +<===> before_default/scss/input.scss +$a: b + !default; + +<===> before_default/scss/output.css + +<===> +================================================================================ +<===> error/before_default/sass/input.sass +$a: b + !default + +<===> error/before_default/sass/error +Error: Nothing may be indented beneath a variable declaration. + , +2 | !default + | ^ + ' + input.sass 2:3 root stylesheet + +<===> +================================================================================ +<===> error/between_double_default/sass/input.sass +$a: b !default + !default + +<===> error/between_double_default/sass/error +Error: Nothing may be indented beneath a variable declaration. + , +2 | !default + | ^ + ' + input.sass 2:3 root stylesheet + +<===> +================================================================================ +<===> error/before_global/sass/input.sass +$a: b + !global + +<===> error/before_global/sass/error +Error: Nothing may be indented beneath a variable declaration. + , +2 | !global + | ^ + ' + input.sass 2:3 root stylesheet + +<===> +================================================================================ +<===> between_double_default/scss/input.scss +$a: b !default + !default; + +<===> between_double_default/scss/output.css + +<===> between_double_default/scss/warning +DEPRECATION WARNING: !default should only be written once for each variable. +This will be an error in Dart Sass 2.0.0. + + , +2 | !default; + | ^^^^^^^^ + ' + input.scss 2:3 root stylesheet + +<===> +================================================================================ +<===> before_global/scss/input.scss +$a: b + !global; + +<===> before_global/scss/output.css + +<===> before_global/scss/warning +DEPRECATION WARNING: As of Dart Sass 2.0.0, !global assignments won't be able to declare new variables. + +Since this assignment is at the root of the stylesheet, the !global flag is +unnecessary and can safely be removed. + + , +1 | / $a: b +2 | | !global; + | '---------^ + ' + input.scss 1:1 root stylesheet From e25db4b63349206a64fcb4fcd296fb42cab5ad53 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Wed, 4 Dec 2024 14:45:16 -0500 Subject: [PATCH 17/38] Test leading whitespace in at-rules in functions and declarations --- spec/arguments/invocation.hrx | 13 +- spec/directives/each.hrx | 4 +- spec/directives/function/whitespace.hrx | 152 ++++++++++++++++++++++ spec/directives/in_declarations.hrx | 161 ++++++++++++++++++++++++ 4 files changed, 320 insertions(+), 10 deletions(-) create mode 100644 spec/directives/in_declarations.hrx diff --git a/spec/arguments/invocation.hrx b/spec/arguments/invocation.hrx index 01a9cca1ac..a30978b679 100644 --- a/spec/arguments/invocation.hrx +++ b/spec/arguments/invocation.hrx @@ -58,7 +58,7 @@ Error: Positional arguments must come before keyword arguments. <===> ================================================================================ -<===> function/error/sass/multi-line-arguments/declaration/input.sass +<===> function/sass/multi-line-arguments/declaration/input.sass @function a( $b, $c @@ -68,13 +68,10 @@ Error: Positional arguments must come before keyword arguments. e f: a(g, h) -<===> function/error/sass/multi-line-arguments/declaration/error -Error: expected ")". - , -1 | @function a( - | ^ - ' - input.sass 1:13 root stylesheet +<===> function/sass/multi-line-arguments/declaration/output.css +e { + f: d; +} <===> ================================================================================ diff --git a/spec/directives/each.hrx b/spec/directives/each.hrx index b0053c8f0e..dbb431097f 100644 --- a/spec/directives/each.hrx +++ b/spec/directives/each.hrx @@ -15,14 +15,14 @@ <===> ================================================================================ -<===> error/sass/multiline/after-each/input.sass +<===> sass/multiline/after-each/input.sass @each $a in b, c .#{$a} d: $a -<===> error/sass/multiline/after-each/output.css +<===> sass/multiline/after-each/output.css .b { d: b; } diff --git a/spec/directives/function/whitespace.hrx b/spec/directives/function/whitespace.hrx index 48c27f5ef3..d4d94277c3 100644 --- a/spec/directives/function/whitespace.hrx +++ b/spec/directives/function/whitespace.hrx @@ -28,3 +28,155 @@ b <===> return/before_value/sass/output.css + +<===> +================================================================================ +<===> nested_at_rule/debug/scss/input.scss +@function a() {@debug + b; + @return null} + +<===> nested_at_rule/debug/scss/output.css + +<===> +================================================================================ +<===> nested_at_rule/each/scss/input.scss +@function a() {@each + $a in b{} + @return null; +} + +<===> nested_at_rule/each/scss/output.css + +<===> +================================================================================ +<===> nested_at_rule/each/sass/input.sass +@function a() + @each + $a in b + @return null + +<===> nested_at_rule/each/sass/output.css + +<===> +================================================================================ +<===> nested_at_rule/error/scss/input.scss +@function a() {@error + b; + @return null} + +<===> nested_at_rule/error/scss/output.css + +<===> +================================================================================ +<===> nested_at_rule/for/scss/input.scss +@function a() {@for + $i from 1 through 10 {} + @return null} + +<===> nested_at_rule/for/scss/output.css + +<===> +================================================================================ +<===> nested_at_rule/for/sass/input.sass +@function a() + @for + $i from 1 through 10 + @return null + +<===> nested_at_rule/for/sass/output.css + +<===> +================================================================================ +<===> nested_at_rule/if/scss/input.scss +@function a() {@if + true{} + @return null} + +<===> nested_at_rule/if/scss/output.css + +<===> +================================================================================ +<===> nested_at_rule/if/sass/input.sass +@function a() + @if + true + @return null + +<===> nested_at_rule/if/sass/output.css + +<===> +================================================================================ +<===> nested_at_rule/warn/scss/input.scss +@function a() {@warn + b; + @return null} + +<===> nested_at_rule/warn/scss/output.css + +<===> +================================================================================ +<===> nested_at_rule/while/scss/input.scss +@function a() {@while + false{} + @return null} + +<===> nested_at_rule/while/scss/output.css + +<===> +================================================================================ +<===> nested_at_rule/while/sass/input.sass +@function a() + @while + false + @return null + +<===> nested_at_rule/while/sass/output.css + +<===> +================================================================================ +<===> error/nested_at_rule/debug/sass/input.sass +@function a() + @debug + b + @return null + +<===> error/nested_at_rule/debug/sass/error +Error: Expected expression. + , +2 | @debug + | ^ + ' + input.sass 2:10 root stylesheet + +<===> +================================================================================ +<===> error/nested_at_rule/error/sass/input.sass +@function a() + @error + b + @return null + +<===> error/nested_at_rule/error/sass/error +Error: Expected expression. + , +2 | @error + | ^ + ' + input.sass 2:10 root stylesheet + +<===> +================================================================================ +<===> error/nested_at_rule/warn/sass/input.sass +@function a() + @warn + b + @return null + +<===> error/nested_at_rule/warn/sass/error +Error: Expected expression. + , +2 | @warn + | ^ + ' + input.sass 2:9 root stylesheet diff --git a/spec/directives/in_declarations.hrx b/spec/directives/in_declarations.hrx new file mode 100644 index 0000000000..28094e7902 --- /dev/null +++ b/spec/directives/in_declarations.hrx @@ -0,0 +1,161 @@ +<===> whitespace/debug/scss/input.scss +a{@debug + b} + +<===> whitespace/debug/scss/output.css + +<===> whitespace/debug/scss/warning +input.scss:1 DEBUG: b + +<===> +================================================================================ +<===> whitespace/each/scss/input.scss +a {@each + $a in b{} +} + +<===> whitespace/each/scss/output.css + +<===> +================================================================================ +<===> whitespace/each/sass/input.sass +a + @each + $a in b + +<===> whitespace/each/sass/output.css + +<===> +================================================================================ +<===> whitespace/error/scss/input.scss +a {@error + b; +} + +<===> whitespace/error/scss/error +Error: b + , +1 | a {@error + | ,----^ +2 | | b; + | '---^ + ' + input.scss 1:4 root stylesheet + +<===> +================================================================================ +<===> whitespace/error/debug/sass/input.sass +a + @debug + b + + +<===> whitespace/error/debug/sass/error +Error: Expected expression. + , +2 | @debug + | ^ + ' + input.sass 2:10 root stylesheet + +<===> +================================================================================ +<===> whitespace/error/error/sass/input.sass +a + @error + b + + +<===> whitespace/error/error/sass/error +Error: Expected expression. + , +2 | @error + | ^ + ' + input.sass 2:10 root stylesheet + +<===> +================================================================================ +<===> whitespace/error/warn/sass/input.sass +a + @warn + b + + +<===> whitespace/error/warn/sass/error +Error: Expected expression. + , +2 | @warn + | ^ + ' + input.sass 2:9 root stylesheet + +<===> +================================================================================ +<===> whitespace/for/scss/input.scss +a {@for + $i from 1 through 10 {} +} + +<===> whitespace/for/scss/output.css + +<===> +================================================================================ +<===> whitespace/for/sass/input.sass +a + @for + $i from 1 through 10 + + +<===> whitespace/for/sass/output.css + +<===> +================================================================================ +<===> whitespace/if/scss/input.scss +a {@if + true{} +} + +<===> whitespace/if/scss/output.css + +<===> +================================================================================ +<===> whitespace/if/sass/input.sass +a + @if + true + + +<===> whitespace/if/sass/output.css + +<===> +================================================================================ +<===> whitespace/warn/scss/input.scss +a {@warn + b; +} + +<===> whitespace/warn/scss/output.css + +<===> whitespace/warn/scss/warning +WARNING: b + input.scss 1:4 root stylesheet + +<===> +================================================================================ +<===> whitespace/while/scss/input.scss +a {@while + false{} +} + +<===> whitespace/while/scss/output.css + +<===> +================================================================================ +<===> whitespace/while/sass/input.sass +a + @while + false + + +<===> whitespace/while/sass/output.css From 5877d96790fbc3bf791d7bc8f45b64124b8df659 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Wed, 4 Dec 2024 15:33:59 -0500 Subject: [PATCH 18/38] Test whitespace in @forward show/hide --- spec/directives/forward/member/visibility.hrx | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/spec/directives/forward/member/visibility.hrx b/spec/directives/forward/member/visibility.hrx index b1fa8880a1..8d64c2b705 100644 --- a/spec/directives/forward/member/visibility.hrx +++ b/spec/directives/forward/member/visibility.hrx @@ -90,6 +90,39 @@ a { b: e; } +<===> +================================================================================ +<===> hide/whitespace/input.sass +@forward "upstream" hide + a + +<===> hide/whitespace/_upstream.sass +$a: b + +<===> hide/whitespace/output.css + +<===> +================================================================================ +<===> hide/whitespace_between/output.css + +<===> +================================================================================ +<===> hide/whitespace_between/error/input.sass +@forward "upstream" hide a + c + +<===> hide/whitespace_between/error/_upstream.sass +$a: b +$c: d + +<===> hide/whitespace_between/error/error +Error: Nothing may be indented beneath a @forward rule. + , +2 | c + | ^ + ' + input.sass 2:3 root stylesheet + <===> ================================================================================ <===> show/mixin/input.scss @@ -147,3 +180,32 @@ $c: d; a { b: d; } + +<===> +================================================================================ +<===> show/whitespace/input.sass +@forward "upstream" show + a + +<===> show/whitespace/_upstream.sass +$a: b + +<===> show/whitespace/output.css + +<===> +================================================================================ +<===> show/whitespace_between/error/input.sass +@forward "upstream" show a + c + +<===> show/whitespace_between/error/_upstream.sass +$a: b +$c: d + +<===> show/whitespace_between/error/error +Error: Nothing may be indented beneath a @forward rule. + , +2 | c + | ^ + ' + input.sass 2:3 root stylesheet From 33f0689c8382fe6711d4b8b9042cc977545cb7c4 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Thu, 5 Dec 2024 10:57:06 -0500 Subject: [PATCH 19/38] Test whitespace in lists --- spec/directives/each.hrx | 15 ++-- spec/directives/if/sass.hrx | 22 +++--- spec/values/lists/brackets.hrx | 72 +++++++++++++++++++ spec/values/lists/sass.hrx | 125 ++++++++++++++++++--------------- spec/values/maps/sass.hrx | 68 ++++++++++++++++++ 5 files changed, 226 insertions(+), 76 deletions(-) create mode 100644 spec/values/maps/sass.hrx diff --git a/spec/directives/each.hrx b/spec/directives/each.hrx index dbb431097f..87b40239e7 100644 --- a/spec/directives/each.hrx +++ b/spec/directives/each.hrx @@ -90,10 +90,11 @@ c .b { .#{$a} d: $a -<===> error/sass/multiline/in-wrapped-expression/error -Error: expected ")". - , -2 | @each $a in (b, - | ^ - ' - input.sass 2:16 root stylesheet +<===> error/sass/multiline/in-wrapped-expression/output.css +.b { + d: b; +} + +.c { + d: c; +} diff --git a/spec/directives/if/sass.hrx b/spec/directives/if/sass.hrx index b158a84767..66e1087ec1 100644 --- a/spec/directives/if/sass.hrx +++ b/spec/directives/if/sass.hrx @@ -47,13 +47,10 @@ a ) e: f -<===> error/if-statement-wrapped-multiline/error -Error: expected ")". - , -4 | @if ( - | ^ - ' - input.sass 4:8 root stylesheet +<===> error/if-statement-wrapped-multiline/output.css +a { + e: f; +} <===> ================================================================================ @@ -65,10 +62,7 @@ a $a == b and $c == d e: f -<===> error/if-statement-unwrapped-multiline/error -Error: Expected expression. - , -5 | $a == b and - | ^ - ' - input.sass 5:16 root stylesheet +<===> error/if-statement-unwrapped-multiline/output.css +a { + e: f; +} diff --git a/spec/values/lists/brackets.hrx b/spec/values/lists/brackets.hrx index 7834e943c8..23fc73fb82 100644 --- a/spec/values/lists/brackets.hrx +++ b/spec/values/lists/brackets.hrx @@ -6,6 +6,18 @@ a { b: []; } +<===> +================================================================================ +<===> whitespace/empty/sass/input.sass +a + b: [ + ] + +<===> whitespace/empty/sass/output.css +a { + b: []; +} + <===> ================================================================================ <===> single/input.scss @@ -16,6 +28,30 @@ a { b: [c]; } +<===> +================================================================================ +<===> whitespace/single/after_lbracket/sass/input.sass +a + b: [ + c] + +<===> whitespace/single/after_lbracket/sass/output.css +a { + b: [c]; +} + +<===> +================================================================================ +<===> whitespace/single/after_val/sass/input.sass +a + b: [c + ] + +<===> whitespace/single/after_val/sass/output.css +a { + b: [c]; +} + <===> ================================================================================ <===> multiple/input.scss @@ -26,6 +62,42 @@ a { b: [c d]; } +<===> +================================================================================ +<===> whitespace/multiple/after_lbracket/sass/input.sass +a + b: [ + c d] + +<===> whitespace/multiple/after_lbracket/sass/output.css +a { + b: [c d]; +} + +<===> +================================================================================ +<===> whitespace/multiple/after_val/sass/input.sass +a + b: [c + d] + +<===> whitespace/multiple/after_val/sass/output.css +a { + b: [c d]; +} + +<===> +================================================================================ +<===> whitespace/multiple/before_rbracket/sass/input.sass +a + b: [c d + ] + +<===> whitespace/multiple/before_rbracket/sass/output.css +a { + b: [c d]; +} + <===> ================================================================================ <===> nested/empty/input.scss diff --git a/spec/values/lists/sass.hrx b/spec/values/lists/sass.hrx index 0806f4d3c6..418102f72b 100644 --- a/spec/values/lists/sass.hrx +++ b/spec/values/lists/sass.hrx @@ -31,72 +31,33 @@ a { <===> ================================================================================ -<===> error/paren/no-indent/input.sass -a - value: ( -b, -c -) - -<===> error/paren/no-indent/error -Error: expected ")". - , -2 | value: ( - | ^ - ' - input.sass 2:11 root stylesheet - -<===> -================================================================================ -<===> error/paren/indented-under/input.sass +<===> error/paren/empty/whitespace/between/input.sass a - value: ( - b, - c -) - -<===> error/paren/indented-under/error -Error: expected ")". - , -2 | value: ( - | ^ - ' - input.sass 2:11 root stylesheet - -<===> -================================================================================ -<===> error/paren/value-aligned/input.sass -a - b: ( c - d - e + b: ( ) -<===> error/paren/value-aligned/error -Error: expected ")". +<===> error/paren/empty/whitespace/between/error +Error: () isn't a valid CSS value. , -2 | b: ( c - | ^ +2 | b: ( + | ,------^ +3 | \ ) ' - input.sass 2:9 root stylesheet + input.sass 2:6 root stylesheet <===> ================================================================================ -<===> error/paren/trailing-comma/input.sass - +<===> error/paren/no-indent/input.sass a b: ( - c, - d, - ) +c, +d +) -<===> error/paren/trailing-comma/error -Error: expected ")". - , -3 | b: ( - | ^ - ' - input.sass 3:7 root stylesheet +<===> error/paren/no-indent/output.css +a { + b: c, d; +} <===> ================================================================================ @@ -127,3 +88,57 @@ Error: expected ":". | ^ ' input.sass 3:7 root stylesheet + +<===> +================================================================================ +<===> paren/indented-under/input.sass +a + b: ( + c, + d +) + +<===> paren/indented-under/output.css +a { + b: c, d; +} + +<===> +================================================================================ +<===> paren/value-aligned/input.sass +a + b: ( c + d + ) + +<===> paren/value-aligned/output.css +a { + b: c d; +} + +<===> +================================================================================ +<===> paren/trailing-comma/input.sass + +a + b: ( + c, + d, + ) + +<===> paren/trailing-comma/output.css +a { + b: c, d; +} + +<===> +================================================================================ +<===> paren/whitespace/after_paren/input.sass +a + b: ( + c, d) + +<===> paren/whitespace/after_paren/output.css +a { + b: c, d; +} diff --git a/spec/values/maps/sass.hrx b/spec/values/maps/sass.hrx new file mode 100644 index 0000000000..bd140dd2dd --- /dev/null +++ b/spec/values/maps/sass.hrx @@ -0,0 +1,68 @@ +<===> whitespace/none/input.sass +$a: (b: c, d: e) + +<===> whitespace/none/output.css + +<===> +================================================================================ +<===> whitespace/after_lparen/input.sass +$a: ( + b: c, d: e) + +<===> whitespace/after_lparen/output.css + +<===> +================================================================================ +<===> whitespace/after_first_key/input.sass +$a: (b + : c, d: e) + +<===> whitespace/after_first_key/output.css + +<===> +================================================================================ +<===> whitespace/after_first_colon/input.sass +$a: (b: + c, d: e) + +<===> whitespace/after_first_colon/output.css + +<===> +================================================================================ +<===> whitespace/after_first_value/input.sass +$a: (b: c + , d: e) + +<===> whitespace/after_first_value/output.css + +<===> +================================================================================ +<===> whitespace/after_comma/input.sass +$a: (b: c, + d: e) + +<===> whitespace/after_comma/output.css + +<===> +================================================================================ +<===> whitespace/after_second_key/input.sass +$a: (b: c, d +: e) + +<===> whitespace/after_second_key/output.css + +<===> +================================================================================ +<===> whitespace/after_second_colon/input.sass +$a: (b: c, d: + e) + +<===> whitespace/after_second_colon/output.css + +<===> +================================================================================ +<===> whitespace/after_second_value/input.sass +$a: (b: c, d: e + ) + +<===> whitespace/after_second_value/output.css From c480999a342c7e9edf0ef80af4c42b124e1577fc Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Thu, 5 Dec 2024 13:31:28 -0500 Subject: [PATCH 20/38] Test whitespace in important and unary --- spec/css/important.hrx | 27 +++++++++++++++++++++++++ spec/operators/minus.hrx | 27 +++++++++++++++++++++++++ spec/operators/modulo.hrx | 42 +++++++++++++++++++++++++++++++++++++++ spec/operators/plus.hrx | 27 +++++++++++++++++++++++++ spec/operators/slash.hrx | 28 ++++++++++++++++++++++++++ 5 files changed, 151 insertions(+) diff --git a/spec/css/important.hrx b/spec/css/important.hrx index 072b272d0b..e8e1e44f46 100644 --- a/spec/css/important.hrx +++ b/spec/css/important.hrx @@ -9,3 +9,30 @@ Error: Expected "important". | ^ ' input.scss 3:8 root stylesheet + +<===> +================================================================================ +<===> syntax/sass/multiline/after_prop/input.sass +a + b: c + !important + +<===> syntax/sass/multiline/after_prop/error +Error: Expected identifier. + , +2 | b: c + | ^ + ' + input.sass 2:7 root stylesheet + +<===> +================================================================================ +<===> syntax/sass/multiline/after_bang/input.sass +a + b: c! + important + +<===> syntax/sass/multiline/after_bang/output.css +a { + b: c !important; +} diff --git a/spec/operators/minus.hrx b/spec/operators/minus.hrx index 214e1f8911..4fdc41dcc1 100644 --- a/spec/operators/minus.hrx +++ b/spec/operators/minus.hrx @@ -122,6 +122,33 @@ a { b: c-d; } +<===> +================================================================================ +<===> syntax/whitespace/newline/before/input.sass +a + b: c + - d + +<===> syntax/whitespace/newline/before/error +Error: Expected identifier. + , +3 | - d + | ^ + ' + input.sass 3:6 root stylesheet + +<===> +================================================================================ +<===> syntax/whitespace/newline/after/input.sass +a + b: c - + d + +<===> syntax/whitespace/newline/after/output.css +a { + b: c-d; +} + <===> ================================================================================ <===> syntax/comment/both/input.scss diff --git a/spec/operators/modulo.hrx b/spec/operators/modulo.hrx index 5fbdd79286..d034caa114 100644 --- a/spec/operators/modulo.hrx +++ b/spec/operators/modulo.hrx @@ -35,3 +35,45 @@ a {b: -1px % calc(infinity * 1px)} a { b: calc(NaN * 1px); } + +<===> +================================================================================ +<===> syntax/whitespace/newline/before/input.sass +a + b: 1 + % 1 + +<===> syntax/whitespace/newline/before/error +Error: Expected identifier. + , +2 | b: 1 + | ^ + ' + input.sass 2:7 root stylesheet + +<===> +================================================================================ +<===> syntax/whitespace/newline/after_percent/input.sass +a + b: 1% + 1 + +<===> syntax/whitespace/newline/after_percent/error +Error: Expected identifier. + , +2 | b: 1% + | ^ + ' + input.sass 2:8 root stylesheet + +<===> +================================================================================ +<===> syntax/whitespace/newline/after/input.sass +a + b: 1 % + 1 + +<===> syntax/whitespace/newline/after/output.css +a { + b: 0; +} diff --git a/spec/operators/plus.hrx b/spec/operators/plus.hrx index 6625e378e0..18910339fa 100644 --- a/spec/operators/plus.hrx +++ b/spec/operators/plus.hrx @@ -122,6 +122,33 @@ a { b: cd; } +<===> +================================================================================ +<===> syntax/whitespace/newline/before/input.sass +a + b: c + + d + +<===> syntax/whitespace/newline/before/error +Error: Expected identifier. + , +2 | b: c + | ^ + ' + input.sass 2:7 root stylesheet + +<===> +================================================================================ +<===> syntax/whitespace/newline/after/input.sass +a + b: c + + d + +<===> syntax/whitespace/newline/after/output.css +a { + b: cd; +} + <===> ================================================================================ <===> syntax/comment/both/input.scss diff --git a/spec/operators/slash.hrx b/spec/operators/slash.hrx index 715972b810..a47d97c318 100644 --- a/spec/operators/slash.hrx +++ b/spec/operators/slash.hrx @@ -93,3 +93,31 @@ a {b: 1/ / /bar} a { b: 1///bar; } + +<===> +================================================================================ +<===> syntax/whitespace/newline/before/input.sass +a + b: c + / d + +<===> syntax/whitespace/newline/before/error +Error: Expected identifier. + , +2 | b: c + | ^ + ' + input.sass 2:7 root stylesheet + +<===> +================================================================================ +<===> syntax/whitespace/newline/after/input.sass +a + b: c / + d + +<===> syntax/whitespace/newline/after/output.css +a { + b: c/d; +} + From 8be784665a89d875d75e1c1f0a9aaaf93eea53a0 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Thu, 5 Dec 2024 15:32:37 -0500 Subject: [PATCH 21/38] Whitespace in interpolation, unblock expressionUntilComma issues --- .../custom_properties/value_interpolation.hrx | 11 +- spec/css/selector/placeholder.hrx | 4 - spec/directives/at_root/whitespace.hrx | 8 -- spec/directives/for/comment.hrx | 100 ++++++++-------- spec/directives/for/whitespace.hrx | 8 -- spec/directives/forward/whitespace.hrx | 16 +-- spec/directives/if/whitespace.hrx | 4 - spec/directives/use/whitespace.hrx | 16 +-- spec/parser/interpolation.hrx | 110 ++++++++++++++++++ 9 files changed, 165 insertions(+), 112 deletions(-) create mode 100644 spec/parser/interpolation.hrx diff --git a/spec/css/custom_properties/value_interpolation.hrx b/spec/css/custom_properties/value_interpolation.hrx index 69dd6d3061..e0411e1669 100644 --- a/spec/css/custom_properties/value_interpolation.hrx +++ b/spec/css/custom_properties/value_interpolation.hrx @@ -156,10 +156,7 @@ a 2} -<===> error/sass/linebreak-interpolation/error -Error: expected "}". - , -2 | --b: #{1 - | ^ - ' - input.sass 2:12 root stylesheet +<===> error/sass/linebreak-interpolation/output.css +a { + --b: 3; +} diff --git a/spec/css/selector/placeholder.hrx b/spec/css/selector/placeholder.hrx index 0e038ae008..b97117d83d 100644 --- a/spec/css/selector/placeholder.hrx +++ b/spec/css/selector/placeholder.hrx @@ -38,10 +38,6 @@ a:where(c) { <===> ================================================================================ -<===> pseudoselectors/where/nesting/options.yml -:todo: - - sass/dart-sass#1451 - <===> pseudoselectors/where/nesting/input.scss a { :where(&) { diff --git a/spec/directives/at_root/whitespace.hrx b/spec/directives/at_root/whitespace.hrx index 9236d56ad4..a731d13f8a 100644 --- a/spec/directives/at_root/whitespace.hrx +++ b/spec/directives/at_root/whitespace.hrx @@ -52,10 +52,6 @@ Error: expected selector. <===> ================================================================================ -<===> before_colon/sass/options.yml -:todo: - - dart-sass - <===> before_colon/sass/input.sass @at-root (without : media) @@ -88,10 +84,6 @@ Error: expected selector. <===> ================================================================================ -<===> before_close_paren/sass/options.yml -:todo: - - dart-sass - <===> before_close_paren/sass/input.sass @at-root (without: media ) diff --git a/spec/directives/for/comment.hrx b/spec/directives/for/comment.hrx index ca7a5b8381..d898e8b624 100644 --- a/spec/directives/for/comment.hrx +++ b/spec/directives/for/comment.hrx @@ -37,34 +37,11 @@ <===> ================================================================================ -<===> after_from/silent/sass/input.sass -@for $i from // - 1 through 10 - -<===> after_from/silent/sass/output.css - -<===> -================================================================================ -<===> error/before_through/silent/sass/input.sass -@for $i from 1 // - through 10 - -<===> error/before_through/silent/sass/error -Error: Expected "to" or "through". - , -1 | @for $i from 1 // - | ^^ - ' - input.sass 1:16 root stylesheet - -<===> -================================================================================ -<===> after_through/silent/sass/input.sass -@for $i from 1 through // - 10 - +<===> before_from/silent/scss/input.scss +@for $i // + from 1 through 10 {} -<===> after_through/silent/sass/output.css +<===> before_from/silent/scss/output.css <===> ================================================================================ @@ -83,11 +60,19 @@ Error: Expected "to" or "through". <===> ================================================================================ -<===> before_from/silent/scss/input.scss -@for $i // - from 1 through 10 {} +<===> after_from/silent/sass/input.sass +@for $i from // + 1 through 10 -<===> before_from/silent/scss/output.css +<===> after_from/silent/sass/output.css + +<===> +================================================================================ +<===> after_from/silent/scss/input.scss +@for $i from // + 1 through 10 {} + +<===> after_from/silent/scss/output.css <===> ================================================================================ @@ -106,34 +91,28 @@ Error: Expected "to" or "through". <===> ================================================================================ -<===> after_from/silent/scss/input.scss -@for $i from // - 1 through 10 {} - -<===> after_from/silent/scss/output.css - -<===> -================================================================================ -<===> before_through/loud/scss/input.scss -@for $i from 1 /**/ through 10 {} +<===> error/before_through/silent/sass/input.sass +@for $i from 1 // + through 10 -<===> before_through/loud/scss/output.css +<===> error/before_through/silent/sass/output.css <===> ================================================================================ -<===> before_through/loud/sass/input.sass -@for $i from 1 /**/ through 10 +<===> after_through/silent/sass/input.sass +@for $i from 1 through // + 10 -<===> before_through/loud/sass/output.css +<===> after_through/silent/sass/output.css <===> ================================================================================ -<===> before_through/silent/scss/input.scss -@for $i from 1 // - through 10 {} +<===> after_through/silent/scss/input.scss +@for $i from 1 through // + 10 {} -<===> before_through/silent/scss/output.css +<===> after_through/silent/scss/output.css <===> ================================================================================ @@ -151,11 +130,26 @@ Error: Expected "to" or "through". <===> ================================================================================ -<===> after_through/silent/scss/input.scss -@for $i from 1 through // - 10 {} +<===> before_through/loud/scss/input.scss +@for $i from 1 /**/ through 10 {} -<===> after_through/silent/scss/output.css +<===> before_through/loud/scss/output.css + +<===> +================================================================================ +<===> before_through/loud/sass/input.sass +@for $i from 1 /**/ through 10 + + +<===> before_through/loud/sass/output.css + +<===> +================================================================================ +<===> before_through/silent/scss/input.scss +@for $i from 1 // + through 10 {} + +<===> before_through/silent/scss/output.css <===> ================================================================================ diff --git a/spec/directives/for/whitespace.hrx b/spec/directives/for/whitespace.hrx index 4cb4b9f801..c1443162c7 100644 --- a/spec/directives/for/whitespace.hrx +++ b/spec/directives/for/whitespace.hrx @@ -55,10 +55,6 @@ <===> ================================================================================ -<===> before_through/sass/options.yml -:todo: - - dart-sass - <===> before_through/sass/input.sass @for $i from 1 through 10 @@ -92,10 +88,6 @@ <===> ================================================================================ -<===> before_to/sass/options.yml -:todo: - - dart-sass - <===> before_to/sass/input.sass @for $i from 1 to 10 diff --git a/spec/directives/forward/whitespace.hrx b/spec/directives/forward/whitespace.hrx index 9de40e6e63..4c6b7892b5 100644 --- a/spec/directives/forward/whitespace.hrx +++ b/spec/directives/forward/whitespace.hrx @@ -142,20 +142,16 @@ $c: 1 !default <===> ================================================================================ -<===> after_variable_comma/sass/options.yml -:todo: - - dart-sass - <===> after_variable_comma/sass/input.sass @forward "other" with ($a: b, $c: d) -<===> after_variable_comma/sass/other.scss +<===> after_variable_comma/sass/other.sass $a: 1 !default $c: 1 !default <===> after_variable_comma/sass/output.css -================================================================================ + <===> ================================================================================ <===> before_close_paren/scss/input.scss @@ -169,10 +165,6 @@ $a: 1 !default <===> ================================================================================ -<===> before_close_paren/sass/options.yml -:todo: - - dart-sass - <===> before_close_paren/sass/input.sass @forward "other" with ($a: b ) @@ -195,10 +187,6 @@ $a: 1 !default <===> ================================================================================ -<===> before_default/sass/options.yml -:todo: - - dart-sass - <===> before_default/sass/input.sass @forward "other" with ($a: b !default) diff --git a/spec/directives/if/whitespace.hrx b/spec/directives/if/whitespace.hrx index c34fe6c96f..c47300246c 100644 --- a/spec/directives/if/whitespace.hrx +++ b/spec/directives/if/whitespace.hrx @@ -84,10 +84,6 @@ <===> ================================================================================ -<===> condition/after_and/sass/options.yml -:todo: - - dart-sass - <===> condition/after_and/sass/input.sass @if true and true diff --git a/spec/directives/use/whitespace.hrx b/spec/directives/use/whitespace.hrx index b70df264d5..0f7c99461b 100644 --- a/spec/directives/use/whitespace.hrx +++ b/spec/directives/use/whitespace.hrx @@ -163,10 +163,6 @@ $a: 1 !default <===> ================================================================================ -<===> before_close_paren/sass/options.yml -:todo: - - dart-sass - <===> before_close_paren/sass/input.sass @use "other" with ($a: b ) @@ -190,15 +186,11 @@ $c: 1 !default <===> ================================================================================ -<===> before_variable_comma/sass/options.yml -:todo: - - dart-sass - <===> before_variable_comma/sass/input.sass @use "other" with ($a: b , $c: d) -<===> before_variable_comma/sass/other.scss +<===> before_variable_comma/sass/other.sass $a: 1 !default $c: 1 !default @@ -218,15 +210,11 @@ $c: 1 !default <===> ================================================================================ -<===> after_variable_comma/sass/options.yml -:todo: - - dart-sass - <===> after_variable_comma/sass/input.sass @use "other" with ($a: b, $c: d) -<===> after_variable_comma/sass/other.scss +<===> after_variable_comma/sass/other.sass $a: 1 !default $c: 1 !default diff --git a/spec/parser/interpolation.hrx b/spec/parser/interpolation.hrx new file mode 100644 index 0000000000..c1e9f8d050 --- /dev/null +++ b/spec/parser/interpolation.hrx @@ -0,0 +1,110 @@ +<===> whitespace/expression/after_open/input.sass +a + b: #{ + c} + + +<===> whitespace/expression/after_open/output.css +a { + b: c; +} + +<===> +================================================================================ +<===> whitespace/expression/after_val/input.sass +a + b: #{c + } + + +<===> whitespace/expression/after_val/output.css +a { + b: c; +} + +<===> +================================================================================ +<===> whitespace/expression/between_vals/input.sass +a + b: #{c + d} + +<===> whitespace/expression/between_vals/output.css +a { + b: c d; +} + +<===> +================================================================================ +<===> whitespace/selector/after_open/input.sass +#{ + a} + b: c + + +<===> whitespace/selector/after_open/output.css +a { + b: c; +} + +<===> +================================================================================ +<===> whitespace/selector/after_val/input.sass +#{a + } + b: c + +<===> whitespace/selector/after_val/output.css +a { + b: c; +} + +<===> +================================================================================ +<===> whitespace/selector/between_vals/input.sass +#{a + b} + c: d + +<===> whitespace/selector/between_vals/output.css +a b { + c: d; +} + +<===> +================================================================================ +<===> whitespace/property/after_open/input.sass +a + #{ + b}: c + + +<===> whitespace/property/after_open/output.css +a { + b: c; +} + +<===> +================================================================================ +<===> whitespace/property/after_val/input.sass +a + #{b + }: c + +<===> whitespace/property/after_val/output.css +a { + b: c; +} + +<===> +================================================================================ +<===> whitespace/property/between_vals/input.sass +a + #{b + c}: d + + +<===> whitespace/property/between_vals/output.css +a { + b c: d; +} From 96827c080f39c6d0cfe6230fd95539a18897c0f8 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Fri, 6 Dec 2024 11:53:38 -0500 Subject: [PATCH 22/38] Test whitespace in supports --- spec/css/supports/whitespace.hrx | 196 +++++++++++++++++++++++++------ 1 file changed, 157 insertions(+), 39 deletions(-) diff --git a/spec/css/supports/whitespace.hrx b/spec/css/supports/whitespace.hrx index d7fe7c7b44..00c0a58495 100644 --- a/spec/css/supports/whitespace.hrx +++ b/spec/css/supports/whitespace.hrx @@ -25,6 +25,29 @@ Error: expected "(". ' input.sass 1:10 root stylesheet +<===> +================================================================================ +<===> error/interpolation/no_paren/before_operator/input.sass +@supports #{"(a: b)"} + and (c: d) + @d + +<===> error/interpolation/no_paren/before_operator/error +WARNING: This selector doesn't have any properties and won't be rendered. + + , +2 | and (c: d) + | ^^^^^^^^^^ + ' + input.sass 2:3 root stylesheet + +Error: expected selector. + , +2 | and (c: d) + | ^ + ' + input.sass 2:7 root stylesheet + <===> ================================================================================ <===> declaration/normal_prop/after_open_paren/scss/input.scss @@ -40,10 +63,6 @@ Error: expected "(". <===> ================================================================================ -<===> declaration/normal_prop/after_open_paren/sass/options.yml -:todo: - - dart-sass - <===> declaration/normal_prop/after_open_paren/sass/input.sass @supports ( a: b) @@ -72,10 +91,6 @@ Error: expected "(". <===> ================================================================================ -<===> declaration/normal_prop/before_colon/sass/options.yml -:todo: - - dart-sass - <===> declaration/normal_prop/before_colon/sass/input.sass @supports (a : b) @@ -104,10 +119,6 @@ Error: expected "(". <===> ================================================================================ -<===> declaration/normal_prop/after_colon/sass/options.yml -:todo: - - dart-sass - <===> declaration/normal_prop/after_colon/sass/input.sass @supports (a: b) @@ -136,10 +147,6 @@ Error: expected "(". <===> ================================================================================ -<===> declaration/normal_prop/before_close_paren/sass/options.yml -:todo: - - dart-sass - <===> declaration/normal_prop/before_close_paren/sass/input.sass @supports (a: b ) @@ -169,10 +176,6 @@ Error: expected "(". <===> ================================================================================ -<===> function/after_open_paren/sass/options.yml -:todo: - - dart-sass - <===> function/after_open_paren/sass/input.sass @supports a( b) @@ -203,10 +206,6 @@ Error: expected "(". <===> ================================================================================ -<===> function/before_close_paren/sass/options.yml -:todo: - - dart-sass - <===> function/before_close_paren/sass/input.sass @supports a(b ) @@ -214,7 +213,7 @@ Error: expected "(". d: e <===> function/before_close_paren/sass/output.css -@supports a(b +@supports a(b ) { c { d: e; @@ -236,10 +235,6 @@ Error: expected "(". <===> ================================================================================ -<===> anything/after_open_paren/sass/options.yml -:todo: - - dart-sass - <===> anything/after_open_paren/sass/input.sass @supports ( a b) @@ -253,6 +248,21 @@ Error: expected "(". } } +<===> +================================================================================ +<===> anything/after_not_in_paren/sass/input.sass +@supports (not + (a)) + b + c: d + +<===> anything/after_not_in_paren/sass/output.css +@supports not (a) { + b { + c: d; + } +} + <===> ================================================================================ <===> anything/after_ident/scss/input.scss @@ -269,10 +279,6 @@ Error: expected "(". <===> ================================================================================ -<===> anything/after_ident/sass/options.yml -:todo: - - dart-sass - <===> anything/after_ident/sass/input.sass @supports (a b) @@ -280,7 +286,7 @@ Error: expected "(". d: e <===> anything/after_ident/sass/output.css -@supports (a +@supports (a b) { c { d: e; @@ -303,10 +309,6 @@ Error: expected "(". <===> ================================================================================ -<===> anything/before_close_paren/sass/options.yml -:todo: - - dart-sass - <===> anything/before_close_paren/sass/input.sass @supports (a b ) @@ -314,7 +316,7 @@ Error: expected "(". d: e <===> anything/before_close_paren/sass/output.css -@supports (a b +@supports (a b ) { c { d: e; @@ -333,3 +335,119 @@ Error: expected "(". d: e; } } + +<===> +================================================================================ +<===> negation/after_not/sass/input.sass +@supports not + (a) + b + c: d + +<===> negation/after_not/sass/output.css +@supports not (a) { + b { + c: d; + } +} + +<===> +================================================================================ +<===> multi_conditions/before_and/sass/input.sass +@supports (a) + and (b) + c + d: e + +<===> multi_conditions/before_and/sass/error +Error: expected selector. + , +2 | and (b) + | ^ + ' + input.sass 2:6 root stylesheet + +<===> +================================================================================ +<===> multi_conditions/after_and/sass/input.sass +@supports (a) and + (b) + c + d: e + +<===> multi_conditions/after_and/sass/output.css +@supports (a) and (b) { + c { + d: e; + } +} + +<===> +================================================================================ +<===> interpolation/paren/before_operator/input.sass +@supports (#{"(a: b)"} + and (c: d)) + @d + +<===> interpolation/paren/before_operator/output.css +@supports (a: b) and (c: d) { + @d; +} + +<===> +================================================================================ +<===> interpolation/paren/after_operator/input.sass +@supports (#{"(a: b)"} and + (c: d)) + @d + +<===> interpolation/paren/after_operator/output.css +@supports (a: b) and (c: d) { + @d; +} + +<===> +================================================================================ +<===> interpolation/paren/after_second/input.sass +@supports (#{"(a: b)"} and (c: d) + and (e: f)) + @d + +<===> interpolation/paren/after_second/output.css +@supports (a: b) and (c: d) and (e: f) { + @d; +} + +<===> +================================================================================ +<===> interpolation/no_paren/after_second/input.sass +@supports #{"(a: b)"} and (c: d) + and (e: f) + @d + +<===> interpolation/no_paren/after_second/error +Error: expected selector. + , +2 | and (e: f) + | ^ + ' + input.sass 2:7 root stylesheet + +<===> +================================================================================ +<===> interpolation/no_paren/aren/after_second/output.css +@supports (a: b) and (c: d) and (e: f) { + @d; +} + +<===> +================================================================================ +<===> interpolation/no_paren/after_operator/input.sass +@supports #{"(a: b)"} and + (c: d) + @d + +<===> interpolation/no_paren/after_operator/output.css +@supports (a: b) and (c: d) { + @d; +} From a94809a70625b046c22b37b86f159285359ee7a6 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Fri, 6 Dec 2024 12:24:24 -0500 Subject: [PATCH 23/38] Test whitespace in @media --- spec/css/media/whitespace.hrx | 80 +++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/spec/css/media/whitespace.hrx b/spec/css/media/whitespace.hrx index 38280038c0..3581d76d21 100644 --- a/spec/css/media/whitespace.hrx +++ b/spec/css/media/whitespace.hrx @@ -25,3 +25,83 @@ Error: Expected identifier. {} <===> after_query/scss/output.css + +<===> +================================================================================ +<===> paren/after_paren/sass/input.sass +@media ( + a: b) + +<===> paren/after_paren/sass/output.css + +<===> +================================================================================ +<===> paren/after_key/sass/input.sass +@media (a + : b) + +<===> paren/after_key/sass/output.css + +<===> +================================================================================ +<===> paren/after_colon/sass/input.sass +@media (a: + b) + +<===> paren/after_colon/sass/output.css + +<===> +================================================================================ +<===> paren/after_value/sass/input.sass +@media (a: b + ) + +<===> paren/after_value/sass/output.css + +<===> +================================================================================ +<===> paren/nested/after_inside/sass/input.sass +@media ((a: b) + ) + +<===> paren/nested/after_inside/sass/output.css + +<===> +================================================================================ +<===> paren/nested/after_and/sass/input.sass +@media ((a: b) and + (c: d)) + +<===> paren/nested/after_and/sass/output.css + +<===> +================================================================================ +<===> paren/nested/after_or/sass/input.sass +@media ((a: b) or + (c: d)) + +<===> paren/nested/after_or/sass/output.css + +<===> +================================================================================ +<===> paren/after_not/sass/input.sass +@media (not + (a: b)) + +<===> paren/after_not/sass/output.css + +<===> +================================================================================ +<===> paren/after_operator/sass/input.sass +@media (a > + b) + +<===> paren/after_operator/sass/output.css + +<===> +================================================================================ +<===> paren/after_second_operator/sass/input.sass +@media (a > b > + c) + +<===> paren/after_second_operator/sass/output.css From 43ef50108375f85bbf33778bb93c11334211d93d Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Fri, 6 Dec 2024 15:31:15 -0500 Subject: [PATCH 24/38] Test whitespace in arg invocations --- spec/arguments/invocation.hrx | 37 ++++--- spec/arguments/whitespace.hrx | 180 ++++++++++++++++++++++++++++++++++ 2 files changed, 197 insertions(+), 20 deletions(-) diff --git a/spec/arguments/invocation.hrx b/spec/arguments/invocation.hrx index a30978b679..14e596a9a0 100644 --- a/spec/arguments/invocation.hrx +++ b/spec/arguments/invocation.hrx @@ -58,40 +58,37 @@ Error: Positional arguments must come before keyword arguments. <===> ================================================================================ -<===> function/sass/multi-line-arguments/declaration/input.sass -@function a( - $b, - $c -) +<===> function/error/sass/multi-line-arguments/invocation/input.sass +@function a($b, $c) @return d e - f: a(g, h) + f: a( + g, + h + ) -<===> function/sass/multi-line-arguments/declaration/output.css +<===> function/error/sass/multi-line-arguments/invocation/output.css e { f: d; } <===> ================================================================================ -<===> function/error/sass/multi-line-arguments/invocation/input.sass -@function a($b, $c) +<===> function/sass/multi-line-arguments/declaration/input.sass +@function a( + $b, + $c +) @return d e - f: a( - g, - h - ) + f: a(g, h) -<===> function/error/sass/multi-line-arguments/invocation/error -Error: expected ")". - , -5 | f: a( - | ^ - ' - input.sass 5:8 root stylesheet +<===> function/sass/multi-line-arguments/declaration/output.css +e { + f: d; +} <===> ================================================================================ diff --git a/spec/arguments/whitespace.hrx b/spec/arguments/whitespace.hrx index f99144b756..74c1642ee7 100644 --- a/spec/arguments/whitespace.hrx +++ b/spec/arguments/whitespace.hrx @@ -140,6 +140,186 @@ <===> function/after_list/sass/output.css +<===> +================================================================================ +<===> function_invocation/after_paren/scss/input.scss +@function a($b, $c){@return null} +$d: a( + e, f) +<===> function_invocation/after_paren/scss/output.css + +<===> +================================================================================ +<===> function_invocation/after_paren/sass/input.sass +@function a($b, $c) + @return null +$d: a( + e, f) + +<===> function_invocation/after_paren/sass/output.css + +<===> +================================================================================ +<===> function_invocation/after_arg/scss/input.scss +@function a($b, $c){@return null} +$d: a(e + , f) + +<===> function_invocation/after_arg/scss/output.css + +<===> +================================================================================ +<===> function_invocation/after_arg/sass/input.sass +@function a($b, $c) + @return null +$d: a(e + , f) + +<===> function_invocation/after_arg/sass/output.css + +<===> +================================================================================ +<===> function_invocation/after_comma/scss/input.scss +@function a($b, $c){@return null} +$d: a(e, + f) + +<===> function_invocation/after_comma/scss/output.css + +<===> +================================================================================ +<===> function_invocation/after_comma/sass/options.yml +:todo: + - dart-sass + +<===> function_invocation/after_comma/sass/input.sass +@function a($b, $c) + @return null +$d: a(e, + f) + +<===> function_invocation/after_comma/sass/output.css + +<===> +================================================================================ +<===> function_invocation/before_colon/scss/input.scss +@function a($b, $c:d){@return null} +$e: a(f, $c + :g) + +<===> function_invocation/before_colon/scss/output.css + +<===> +================================================================================ +<===> function_invocation/before_colon/sass/input.sass +@function a($b, $c:d) + @return null +$e: a(f, $c + :g) + +<===> function_invocation/before_colon/sass/output.css + +<===> +================================================================================ +<===> function_invocation/after_colon/scss/input.scss +@function a($b, $c:d){@return null} +$e: a(f, $c: + g) + +<===> function_invocation/after_colon/scss/output.css + +<===> +================================================================================ +<===> function_invocation/after_colon/sass/input.sass +@function a($b, $c:d) + @return null +$e: a(f, $c: + g) + +<===> function_invocation/after_colon/sass/output.css + +<===> +================================================================================ +<===> function_invocation/before_paren/scss/input.scss +@function a($b, $c:d){@return null} +$e: a(f, $c: g + ) + +<===> function_invocation/before_paren/scss/output.css + +<===> +================================================================================ +<===> function_invocation/before_paren/sass/input.sass +@function a($b, $c:d) + @return null +$e: a(f, $c: g + ) + +<===> function_invocation/before_paren/sass/output.css + +<===> +================================================================================ +<===> function_invocation/before_list_arg/scss/input.scss +@function a($b, $c){@return null} +$d: e f; +$g: a( + $d...) + +<===> function_invocation/before_list_arg/scss/output.css + +<===> +================================================================================ +<===> function_invocation/before_list_arg/sass/input.sass +@function a($b, $c) + @return null +$d: e, f +$g: a( + $d...) + +<===> function_invocation/before_list_arg/sass/output.css + +<===> +================================================================================ +<===> function_invocation/before_list/scss/input.scss +@function a($b, $c){@return null} +$d: e f; +$g: a($d + ...) + +<===> function_invocation/before_list/scss/output.css + +<===> +================================================================================ +<===> function_invocation/before_list/sass/input.sass +@function a($b, $c) + @return null +$d: e, f +$g: a($d + ...) + +<===> function_invocation/before_list/sass/output.css + +<===> +================================================================================ +<===> function_invocation/after_list/scss/input.scss +@function a($b, $c){@return null} +$d: e f; +$g: a($d... + ) + +<===> function_invocation/after_list/scss/output.css + +<===> +================================================================================ +<===> function_invocation/after_list/sass/input.sass +@function a($b, $c) + @return null +$d: e, f +$g: a($d... + ) + +<===> function_invocation/after_list/sass/output.css + <===> ================================================================================ <===> mixin/after_paren/scss/input.scss From 88646658b6696a7eb9ca64914f3201bb7fa32b60 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Fri, 6 Dec 2024 16:02:50 -0500 Subject: [PATCH 25/38] Invocation and other whitespace cleanup --- spec/arguments/invocation.hrx | 4 +- spec/arguments/whitespace.hrx | 4 -- spec/css/media/whitespace.hrx | 36 +++++++++++++++++ spec/operators/boolean.hrx | 75 +++++++++++++++++++++++++++++++++++ spec/parser/selector.hrx | 21 ++++++++++ 5 files changed, 134 insertions(+), 6 deletions(-) create mode 100644 spec/operators/boolean.hrx diff --git a/spec/arguments/invocation.hrx b/spec/arguments/invocation.hrx index 14e596a9a0..73c1e6e46c 100644 --- a/spec/arguments/invocation.hrx +++ b/spec/arguments/invocation.hrx @@ -58,7 +58,7 @@ Error: Positional arguments must come before keyword arguments. <===> ================================================================================ -<===> function/error/sass/multi-line-arguments/invocation/input.sass +<===> function/sass/multi-line-arguments/invocation/input.sass @function a($b, $c) @return d @@ -68,7 +68,7 @@ e h ) -<===> function/error/sass/multi-line-arguments/invocation/output.css +<===> function/sass/multi-line-arguments/invocation/output.css e { f: d; } diff --git a/spec/arguments/whitespace.hrx b/spec/arguments/whitespace.hrx index 74c1642ee7..49788359b7 100644 --- a/spec/arguments/whitespace.hrx +++ b/spec/arguments/whitespace.hrx @@ -188,10 +188,6 @@ $d: a(e, <===> ================================================================================ -<===> function_invocation/after_comma/sass/options.yml -:todo: - - dart-sass - <===> function_invocation/after_comma/sass/input.sass @function a($b, $c) @return null diff --git a/spec/css/media/whitespace.hrx b/spec/css/media/whitespace.hrx index 3581d76d21..f4e4f69ee4 100644 --- a/spec/css/media/whitespace.hrx +++ b/spec/css/media/whitespace.hrx @@ -105,3 +105,39 @@ Error: Expected identifier. c) <===> paren/after_second_operator/sass/output.css + +<===> +================================================================================ +<===> logic_sequence/before_operator/sass/input.sass +@media (a: b) + and (c: d) + +<===> logic_sequence/before_operator/sass/error +WARNING: This selector doesn't have any properties and won't be rendered. + + , +2 | and (c: d) + | ^^^^^^^^^^ + ' + input.sass 2:3 root stylesheet + +Error: expected selector. + , +2 | and (c: d) + | ^ + ' + input.sass 2:7 root stylesheet + +<===> +================================================================================ +<===> logic_sequence/after_operator/sass/input.sass +@media (a: b) and + (c: d) + +<===> logic_sequence/after_operator/sass/error +Error: expected media condition in parentheses. + , +1 | @media (a: b) and + | ^ + ' + input.sass 1:18 root stylesheet diff --git a/spec/operators/boolean.hrx b/spec/operators/boolean.hrx new file mode 100644 index 0000000000..613a52bba2 --- /dev/null +++ b/spec/operators/boolean.hrx @@ -0,0 +1,75 @@ +<===> whitespace/and/before/sass/input.sass +$a: b +and c + +<===> whitespace/and/before/sass/output.css + +<===> whitespace/and/before/sass/warning +WARNING: This selector doesn't have any properties and won't be rendered. + + , +2 | and c + | ^^^^^ + ' + input.sass 2:1 root stylesheet + +<===> +================================================================================ +<===> whitespace/and/after/sass/input.sass +$a: b and + c + +<===> whitespace/and/after/sass/output.css + +<===> +================================================================================ +<===> whitespace/not/after/sass/input.sass +$a: b not + c + +<===> whitespace/not/after/sass/output.css + +<===> +================================================================================ +<===> error/whitespace/and/before_indent/sass/input.sass +$a: b + and c + +<===> error/whitespace/and/before_indent/sass/error +Error: Nothing may be indented beneath a variable declaration. + , +2 | and c + | ^ + ' + input.sass 2:3 root stylesheet + +<===> +================================================================================ +<===> error/whitespace/not/before/sass/input.sass +$a: b +not c + +<===> error/whitespace/not/before/sass/output.css + +<===> error/whitespace/not/before/sass/warning +WARNING: This selector doesn't have any properties and won't be rendered. + + , +2 | not c + | ^^^^^ + ' + input.sass 2:1 root stylesheet + +<===> +================================================================================ +<===> error/whitespace/not/before_indent/sass/input.sass +$a: b + not c + +<===> error/whitespace/not/before_indent/sass/error +Error: Nothing may be indented beneath a variable declaration. + , +2 | not c + | ^ + ' + input.sass 2:3 root stylesheet diff --git a/spec/parser/selector.hrx b/spec/parser/selector.hrx index 3b7f3ef7db..74d3860a59 100644 --- a/spec/parser/selector.hrx +++ b/spec/parser/selector.hrx @@ -48,6 +48,27 @@ b { c: d; } +<===> +================================================================================ +<===> multiline-no-comma/input.sass +a +b + c: d + +<===> multiline-no-comma/output.css +b { + c: d; +} + +<===> multiline-no-comma/warning +WARNING: This selector doesn't have any properties and won't be rendered. + + , +1 | a + | ^ + ' + input.sass 1:1 root stylesheet + <===> ================================================================================ <===> whitespace/input.sass From 2175ad2941ccce4678d6578410bfd004dd8655ee Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Thu, 12 Dec 2024 16:01:16 -0500 Subject: [PATCH 26/38] Test whitespace comments --- spec/css/comment.hrx | 13 ++- spec/expressions/comments.hrx | 156 ++++++++++++++++++++++++++++++++++ 2 files changed, 161 insertions(+), 8 deletions(-) create mode 100644 spec/expressions/comments.hrx diff --git a/spec/css/comment.hrx b/spec/css/comment.hrx index 5de76a124e..d7f6acc04a 100644 --- a/spec/css/comment.hrx +++ b/spec/css/comment.hrx @@ -233,7 +233,7 @@ a b: c /* d <===> error/loud/unterminated/sass/error -Error: expected */. +Error: expected more input. , 2 | b: c /* d | ^ @@ -247,13 +247,10 @@ a b: c /* d e */ f -<===> error/loud/multi_line/sass/error -Error: expected */. - , -2 | b: c /* d - | ^ - ' - input.sass 2:12 root stylesheet +<===> error/loud/multi_line/sass/output.css +a { + b: c f; +} <===> ================================================================================ diff --git a/spec/expressions/comments.hrx b/spec/expressions/comments.hrx new file mode 100644 index 0000000000..370b9e286d --- /dev/null +++ b/spec/expressions/comments.hrx @@ -0,0 +1,156 @@ +<===> loud/sass/inline-closed/input.sass +/* a */ + +<===> loud/sass/inline-closed/output.css +/* a */ + +<===> +================================================================================ +<===> loud/sass/inline-open/input.sass +/* a + +<===> loud/sass/inline-open/output.css +/* a */ + +<===> +================================================================================ +<===> loud/sass/indented-closed/input.sass +/* + a */ + +<===> loud/sass/indented-closed/output.css +/* a */ + +<===> +================================================================================ +<===> loud/sass/indented-closed-after/input.sass +/* + a + */ + +<===> loud/sass/indented-closed-after/output.css +/* a + * */ + +<===> +================================================================================ +<===> loud/sass/indented-closed-no-indent/input.sass +/* + a +*/ + +<===> loud/sass/indented-closed-no-indent/error +WARNING: This selector doesn't have any properties and won't be rendered. + + , +3 | */ + | ^^ + ' + input.sass 3:1 root stylesheet + +Error: expected selector. + , +3 | */ + | ^ + ' + input.sass 3:2 root stylesheet + +<===> +================================================================================ +<===> loud/sass/indented-interpolation/input.sass +/* #{a + + b} */ + +<===> loud/sass/indented-interpolation/output.css +/* ab */ + +<===> +================================================================================ +<===> loud/sass/indented-open/input.sass +/* + a + +<===> loud/sass/indented-open/output.css +/* a */ + +<===> +================================================================================ +<===> silent/sass/inline/input.sass +// a + +<===> silent/sass/inline/output.css + +<===> +================================================================================ +<===> silent/sass/indented/input.sass +// + a + +<===> silent/sass/indented/output.css + +<===> +================================================================================ +<===> silent/sass/indented-interpolation/input.sass +// #{a + + b} + +<===> silent/sass/indented-interpolation/output.css + +<===> +================================================================================ +<===> whitespace-comment/sass/inline/input.sass +a + b: c /* d */ e + +<===> whitespace-comment/sass/inline/output.css +a { + b: c e; +} + +<===> +================================================================================ +<===> whitespace-comment/sass/before-comment/input.sass +a + b: c /* + d */ e + +<===> whitespace-comment/sass/before-comment/output.css +a { + b: c e; +} + +<===> +================================================================================ +<===> whitespace-comment/sass/before-comment-no-indent/input.sass +a + b: c /* +d */ e + +<===> whitespace-comment/sass/before-comment-no-indent/output.css +a { + b: c e; +} + +<===> +================================================================================ +<===> whitespace-comment/sass/after-comment/input.sass +a + b: c /* d + */ e + +<===> whitespace-comment/sass/after-comment/output.css +a { + b: c e; +} + +<===> +================================================================================ +<===> whitespace-comment/sass/after-comment-no-indent/input.sass +a + b: c /* d +*/ e + +<===> whitespace-comment/sass/after-comment-no-indent/output.css +a { + b: c e; +} From 024a8b3fbae2533a2c4529525df180ee34c458e8 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Fri, 13 Dec 2024 10:52:17 -0500 Subject: [PATCH 27/38] Add attribute selector whitespace tests --- spec/css/selector/attribute.hrx | 131 ++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) diff --git a/spec/css/selector/attribute.hrx b/spec/css/selector/attribute.hrx index 5268b27809..e35383fabb 100644 --- a/spec/css/selector/attribute.hrx +++ b/spec/css/selector/attribute.hrx @@ -146,3 +146,134 @@ Error: expected "]". | ^ ' input.scss 2:6 root stylesheet + +<===> +================================================================================ +<===> sass/whitespace/after-lbracket/input.sass +a[ + b] + c: d + +<===> sass/whitespace/after-lbracket/error +WARNING: This selector doesn't have any properties and won't be rendered. + + , +2 | b] + | ^^ + ' + input.sass 2:3 root stylesheet + +Error: Expected identifier. + , +1 | a[ + | ^ + ' + input.sass 1:3 root stylesheet + +<===> +================================================================================ +<===> sass/whitespace/after-lbracket-indented/input.sass +a[ + b] + c: d + +<===> sass/whitespace/after-lbracket-indented/error +Error: Expected identifier. + , +1 | a[ + | ^ + ' + input.sass 1:3 root stylesheet + +<===> +================================================================================ +<===> sass/whitespace/after-val/input.sass +a[b + ] + c: d + +<===> sass/whitespace/after-val/error +Error: expected more input. + , +1 | a[b + | ^ + ' + input.sass 1:4 root stylesheet + +<===> +================================================================================ +<===> sass/whitespace/before-operator/input.sass +a[b + =c] + d: e + +<===> sass/whitespace/before-operator/error +Error: Expected newline. + , +2 | =c] + | ^ + ' + input.sass 2:5 root stylesheet + +<===> +================================================================================ +<===> sass/whitespace/after-operator/input.sass +a[b= + c] + d: e + +<===> sass/whitespace/after-operator/error +Error: Expected identifier. + , +1 | a[b= + | ^ + ' + input.sass 1:5 root stylesheet + +<===> +================================================================================ +<===> scss/whitespace/after-lbracket/input.scss +a[ + b] + {c: d} + +<===> scss/whitespace/after-lbracket/output.css +a[b] { + c: d; +} + +<===> +================================================================================ +<===> scss/whitespace/after-val/input.scss +a[b + ] + {c: d} + +<===> scss/whitespace/after-val/output.css +a[b] { + c: d; +} + +<===> +================================================================================ +<===> scss/whitespace/before-operator/input.scss +a[b + =c] + {d: e} + +<===> scss/whitespace/before-operator/output.css +a[b=c] { + d: e; +} + +<===> +================================================================================ +<===> scss/whitespace/after-operator/input.scss +a[b= + c] + {d: e} + +<===> scss/whitespace/after-operator/output.css +a[b=c] { + d: e; +} From bdb2de5704f984739c4ee0cf24a89f4619c47e6d Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Fri, 13 Dec 2024 10:58:43 -0500 Subject: [PATCH 28/38] Test whitespace in url contents --- spec/css/functions/url.hrx | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/spec/css/functions/url.hrx b/spec/css/functions/url.hrx index 25e9d2004a..654838941b 100644 --- a/spec/css/functions/url.hrx +++ b/spec/css/functions/url.hrx @@ -15,3 +15,42 @@ a {b: url(http://c.d/e!f)} a { b: url(http://c.d/e!f); } + +<===> +================================================================================ +<===> whitespace/sass/error/before_paren/middle/input.sass +a + b: url + (c) + +<===> whitespace/sass/error/before_paren/middle/error +Error: Expected identifier. + , +2 | b: url + | ^ + ' + input.sass 2:9 root stylesheet + +<===> +================================================================================ +<===> whitespace/sass/after_open/middle/input.sass +a + b: url( + c) + +<===> whitespace/sass/after_open/middle/output.css +a { + b: url(c); +} + +<===> +================================================================================ +<===> whitespace/sass/before_close/middle/input.sass +a + b: url(c + ) + +<===> whitespace/sass/before_close/middle/output.css +a { + b: url(c); +} From ab142f6d9bebe20bd0c4c108bd424f9a7b4b8435 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Fri, 13 Dec 2024 11:45:15 -0500 Subject: [PATCH 29/38] Test newlines around operators --- spec/operators/equals.hrx | 34 +++++++++++++++++++++++++++++ spec/operators/gt.hrx | 42 ++++++++++++++++++++++++++++++++++++ spec/operators/gte.hrx | 42 ++++++++++++++++++++++++++++++++++++ spec/operators/lt.hrx | 42 ++++++++++++++++++++++++++++++++++++ spec/operators/lte.hrx | 41 +++++++++++++++++++++++++++++++++++ spec/operators/notequals.hrx | 34 +++++++++++++++++++++++++++++ spec/operators/times.hrx | 41 +++++++++++++++++++++++++++++++++++ 7 files changed, 276 insertions(+) create mode 100644 spec/operators/equals.hrx create mode 100644 spec/operators/gt.hrx create mode 100644 spec/operators/gte.hrx create mode 100644 spec/operators/lt.hrx create mode 100644 spec/operators/lte.hrx create mode 100644 spec/operators/notequals.hrx create mode 100644 spec/operators/times.hrx diff --git a/spec/operators/equals.hrx b/spec/operators/equals.hrx new file mode 100644 index 0000000000..b621723589 --- /dev/null +++ b/spec/operators/equals.hrx @@ -0,0 +1,34 @@ +<===> error/whitespace/before/sass/input.sass +$a: b +== c + +<===> error/whitespace/before/sass/error +Error: Expected identifier. + , +2 | == c + | ^ + ' + input.sass 2:2 root stylesheet + +<===> +================================================================================ +<===> whitespace/after/sass/input.sass +$a: b == + c + +<===> whitespace/after/sass/output.css + +<===> +================================================================================ +<===> error/whitespace/before_indent/sass/input.sass +$a: b + == c + +<===> error/whitespace/before_indent/sass/error +Error: Nothing may be indented beneath a variable declaration. + , +2 | == c + | ^ + ' + input.sass 2:3 root stylesheet + diff --git a/spec/operators/gt.hrx b/spec/operators/gt.hrx new file mode 100644 index 0000000000..5cad1edd9d --- /dev/null +++ b/spec/operators/gt.hrx @@ -0,0 +1,42 @@ +<===> error/whitespace/before/sass/input.sass +$a: 1 +> 2 + +<===> error/whitespace/before/sass/error +WARNING: This selector doesn't have any properties and won't be rendered. + + , +2 | > 2 + | ^^^ + ' + input.sass 2:1 root stylesheet + +Error: expected selector. + , +2 | > 2 + | ^ + ' + input.sass 2:3 root stylesheet + +<===> +================================================================================ +<===> whitespace/after/sass/input.sass +$a: 1 > + 2 + +<===> whitespace/after/sass/output.css + +<===> +================================================================================ +<===> error/whitespace/before_indent/sass/input.sass +$a: 1 + > 2 + +<===> error/whitespace/before_indent/sass/error +Error: Nothing may be indented beneath a variable declaration. + , +2 | > 2 + | ^ + ' + input.sass 2:3 root stylesheet + diff --git a/spec/operators/gte.hrx b/spec/operators/gte.hrx new file mode 100644 index 0000000000..ecd13ea6f0 --- /dev/null +++ b/spec/operators/gte.hrx @@ -0,0 +1,42 @@ +<===> error/whitespace/before/sass/input.sass +$a: 1 +>= 2 + +<===> error/whitespace/before/sass/error +WARNING: This selector doesn't have any properties and won't be rendered. + + , +2 | >= 2 + | ^^^^ + ' + input.sass 2:1 root stylesheet + +Error: expected selector. + , +2 | >= 2 + | ^ + ' + input.sass 2:2 root stylesheet + +<===> +================================================================================ +<===> error/whitespace/before_indent/sass/input.sass +$a: 1 + >= 2 + +<===> error/whitespace/before_indent/sass/error +Error: Nothing may be indented beneath a variable declaration. + , +2 | >= 2 + | ^ + ' + input.sass 2:3 root stylesheet + + +<===> +================================================================================ +<===> whitespace/after/sass/input.sass +$a: 1 >= + 2 + +<===> whitespace/after/sass/output.css diff --git a/spec/operators/lt.hrx b/spec/operators/lt.hrx new file mode 100644 index 0000000000..470204d47f --- /dev/null +++ b/spec/operators/lt.hrx @@ -0,0 +1,42 @@ +<===> error/whitespace/before/sass/input.sass +$a: 1 +< 2 + +<===> error/whitespace/before/sass/error +WARNING: This selector doesn't have any properties and won't be rendered. + + , +2 | < 2 + | ^^^ + ' + input.sass 2:1 root stylesheet + +Error: expected selector. + , +1 | $a: 1 + | ^ + ' + input.sass 1:6 root stylesheet + +<===> +================================================================================ +<===> error/whitespace/before_indent/sass/input.sass +$a: 1 + < 2 + +<===> error/whitespace/before_indent/sass/error +Error: Nothing may be indented beneath a variable declaration. + , +2 | < 2 + | ^ + ' + input.sass 2:3 root stylesheet + + +<===> +================================================================================ +<===> whitespace/after/sass/input.sass +$a: 1 < + 2 + +<===> whitespace/after/sass/output.css diff --git a/spec/operators/lte.hrx b/spec/operators/lte.hrx new file mode 100644 index 0000000000..8218be009c --- /dev/null +++ b/spec/operators/lte.hrx @@ -0,0 +1,41 @@ +<===> error/whitespace/before/sass/input.sass +$a: 1 +<= 2 + +<===> error/whitespace/before/sass/error +WARNING: This selector doesn't have any properties and won't be rendered. + + , +2 | <= 2 + | ^^^^ + ' + input.sass 2:1 root stylesheet + +Error: expected selector. + , +1 | $a: 1 + | ^ + ' + input.sass 1:6 root stylesheet + +<===> +================================================================================ +<===> error/whitespace/before_indent/sass/input.sass +$a: 1 + <= 2 + +<===> error/whitespace/before_indent/sass/error +Error: Nothing may be indented beneath a variable declaration. + , +2 | <= 2 + | ^ + ' + input.sass 2:3 root stylesheet + +<===> +================================================================================ +<===> whitespace/after/sass/input.sass +$a: 1 <= + 2 + +<===> whitespace/after/sass/output.css diff --git a/spec/operators/notequals.hrx b/spec/operators/notequals.hrx new file mode 100644 index 0000000000..6ca67e575d --- /dev/null +++ b/spec/operators/notequals.hrx @@ -0,0 +1,34 @@ +<===> error/whitespace/before/sass/input.sass +$a: b +!= c + +<===> error/whitespace/before/sass/error +Error: Expected newline. + , +1 | $a: b + | ^ + ' + input.sass 1:6 root stylesheet + +<===> +================================================================================ +<===> error/whitespace/before_indent/sass/input.sass +$a: b + != c + +<===> error/whitespace/before_indent/sass/error +Error: Nothing may be indented beneath a variable declaration. + , +2 | != c + | ^ + ' + input.sass 2:3 root stylesheet + + +<===> +================================================================================ +<===> whitespace/after/sass/input.sass +$a: b != + c + +<===> whitespace/after/sass/output.css diff --git a/spec/operators/times.hrx b/spec/operators/times.hrx new file mode 100644 index 0000000000..5ec03571d1 --- /dev/null +++ b/spec/operators/times.hrx @@ -0,0 +1,41 @@ +<===> whitespace/before/sass/input.sass +$a: 1 +* 2 + +<===> whitespace/before/sass/error +WARNING: This selector doesn't have any properties and won't be rendered. + + , +2 | * 2 + | ^^^ + ' + input.sass 2:1 root stylesheet + +Error: expected selector. + , +2 | * 2 + | ^ + ' + input.sass 2:3 root stylesheet + +<===> +================================================================================ +<===> whitespace/after/sass/input.sass +$a: 1 * + 2 + +<===> whitespace/after/sass/output.css + +<===> +================================================================================ +<===> error/whitespace/before_indent/sass/input.sass +$a: 1 + * 2 + +<===> error/whitespace/before_indent/sass/error +Error: Nothing may be indented beneath a variable declaration. + , +2 | * 2 + | ^ + ' + input.sass 2:3 root stylesheet From 1da6554c88a36ef043a58e316441b2af595e48cc Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Fri, 13 Dec 2024 15:03:14 -0500 Subject: [PATCH 30/38] Test/document whitespace in support statements --- spec/css/plain/import/whitespace.hrx | 166 ++++++++++++++++++++++++++ spec/css/supports/whitespace.hrx | 10 +- spec/directives/import/whitespace.hrx | 8 -- 3 files changed, 167 insertions(+), 17 deletions(-) create mode 100644 spec/css/plain/import/whitespace.hrx diff --git a/spec/css/plain/import/whitespace.hrx b/spec/css/plain/import/whitespace.hrx new file mode 100644 index 0000000000..1ad5af6a3a --- /dev/null +++ b/spec/css/plain/import/whitespace.hrx @@ -0,0 +1,166 @@ +<===> error/supports/declaration/prop/after-open/scss/input.scss +@import "a.css" supports( + a: b) + +<===> error/supports/declaration/prop/after-open/scss/error +Error: Expected expression. + , +1 | @import "a.css" supports( + | ^ + ' + input.scss 1:26 root stylesheet + +<===> +================================================================================ +<===> error/supports/declaration/prop/after-open/sass/input.sass +@import "a.css" supports( + a: b) + +<===> error/supports/declaration/prop/after-open/sass/error +Error: Expected expression. + , +1 | @import "a.css" supports( + | ^ + ' + input.sass 1:26 root stylesheet + +<===> +================================================================================ +<===> error/supports/declaration/followed_by_import_arg/after-comma/sass/input.sass +@import "a" supports(b: c), + "d.css" + +<===> error/supports/declaration/followed_by_import_arg/after-comma/sass/error +Error: Nothing may be indented beneath a @import rule. + , +2 | "d.css" + | ^ + ' + input.sass 2:3 root stylesheet + +<===> +================================================================================ +<===> error/supports/condition_function/before_paren/sass/input.sass +@import "a.css" supports(a + (b)) + +<===> error/supports/condition_function/before_paren/sass/error +Error: expected ":". + , +2 | (b)) + | ^ + ' + input.sass 2:6 root stylesheet + +<===> +================================================================================ +<===> error/supports/condition_negation/before_not/sass/input.sass +@import "a.css" supports( + not (a: b)) + +<===> error/supports/condition_negation/before_not/sass/error +Error: Expected expression. + , +1 | @import "a.css" supports( + | ^ + ' + input.sass 1:26 root stylesheet + +<===> +================================================================================ +<===> error/media/before/sass/input.sass +@import url("a.css") + print + +<===> error/media/before/sass/error +Error: Nothing may be indented beneath a @import rule. + , +2 | print + | ^ + ' + input.sass 2:3 root stylesheet + +<===> +================================================================================ +<===> supports/declaration/prop/after-key/sass/input.sass +@import "a.css" supports(a + : b) + +<===> supports/declaration/prop/after-key/sass/output.css +@import "a.css" supports(a: b); + +<===> +================================================================================ +<===> supports/declaration/prop/after-color/sass/input.sass +@import "a.css" supports(a: + b) + +<===> supports/declaration/prop/after-color/sass/output.css +@import "a.css" supports(a: b); + +<===> +================================================================================ +<===> supports/declaration/prop/after-value/sass/input.sass +@import "a.css" supports(a: b + ) + +<===> supports/declaration/prop/after-value/sass/output.css +@import "a.css" supports(a: b); + +<===> +================================================================================ +<===> supports/condition_and/before_and/sass/input.sass +@import "a.css" supports((a: b) + and (c: d)) + +<===> supports/condition_and/before_and/sass/error +Error: expected ")". + , +1 | @import "a.css" supports((a: b) + | ^ + ' + input.sass 1:33 root stylesheet + +<===> +================================================================================ +<===> supports/condition_and/after_and/sass/input.sass +@import "a.css" supports((a: b) and + (c: d)) + +<===> supports/condition_and/after_and/sass/output.css +@import "a.css" supports((a: b) and (c: d)); + +<===> +================================================================================ +<===> supports/condition_function/after_paren/sass/input.sass +@import "a.css" supports(a( + b)) + +<===> supports/condition_function/after_paren/sass/output.css +@import "a.css" supports(a( b)); + +<===> +================================================================================ +<===> supports/condition_function/before_end_paren/sass/input.sass +@import "a.css" supports(a(b + )) + +<===> supports/condition_function/before_end_paren/sass/output.css +@import "a.css" supports(a(b )); + +<===> +================================================================================ +<===> supports/condition_negation/after_not/sass/input.sass +@import "a.css" supports(not + (a: b)) + +<===> supports/condition_negation/after_not/sass/output.css +@import "a.css" supports(not (a: b)); + +<===> +================================================================================ +<===> supports/calc/sass/input.sass +@import "a.css" supports(calc(1)); + +<===> supports/calc/sass/output.css +@import "a.css" supports(calc(1)); diff --git a/spec/css/supports/whitespace.hrx b/spec/css/supports/whitespace.hrx index 00c0a58495..35d5de7ca1 100644 --- a/spec/css/supports/whitespace.hrx +++ b/spec/css/supports/whitespace.hrx @@ -30,17 +30,9 @@ Error: expected "(". <===> error/interpolation/no_paren/before_operator/input.sass @supports #{"(a: b)"} and (c: d) - @d + @d <===> error/interpolation/no_paren/before_operator/error -WARNING: This selector doesn't have any properties and won't be rendered. - - , -2 | and (c: d) - | ^^^^^^^^^^ - ' - input.sass 2:3 root stylesheet - Error: expected selector. , 2 | and (c: d) diff --git a/spec/directives/import/whitespace.hrx b/spec/directives/import/whitespace.hrx index c2a3b77e1c..4a60ac7354 100644 --- a/spec/directives/import/whitespace.hrx +++ b/spec/directives/import/whitespace.hrx @@ -116,10 +116,6 @@ Error: Nothing may be indented beneath a @import rule. <===> ================================================================================ -<===> modifier/args/after_open_paren/sass/options.yml -:todo: - - dart-sass - <===> modifier/args/after_open_paren/sass/input.sass @import "a.css" b( c) @@ -140,10 +136,6 @@ Error: Nothing may be indented beneath a @import rule. <===> ================================================================================ -<===> modifier/args/before_close_paren/sass/options.yml -:todo: - - dart-sass - <===> modifier/args/before_close_paren/sass/input.sass @import "a.css" b(c ) From 9ce61030b3f2118ea6599d9014ac52663c8f66b3 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Sun, 15 Dec 2024 21:23:34 -0500 Subject: [PATCH 31/38] Test newlines in supports statements --- spec/css/plain/import/whitespace.hrx | 138 +++++++++++++-------------- spec/css/supports/whitespace.hrx | 23 +++-- 2 files changed, 78 insertions(+), 83 deletions(-) diff --git a/spec/css/plain/import/whitespace.hrx b/spec/css/plain/import/whitespace.hrx index 1ad5af6a3a..f76e4541b0 100644 --- a/spec/css/plain/import/whitespace.hrx +++ b/spec/css/plain/import/whitespace.hrx @@ -1,84 +1,34 @@ -<===> error/supports/declaration/prop/after-open/scss/input.scss +<===> supports/declaration/prop/after-open/scss/input.scss @import "a.css" supports( a: b) -<===> error/supports/declaration/prop/after-open/scss/error -Error: Expected expression. - , -1 | @import "a.css" supports( - | ^ - ' - input.scss 1:26 root stylesheet +<===> supports/declaration/prop/after-open/scss/output.css +@import "a.css" supports(a: b); <===> ================================================================================ -<===> error/supports/declaration/prop/after-open/sass/input.sass +<===> supports/declaration/prop/after-open/sass/input.sass @import "a.css" supports( a: b) -<===> error/supports/declaration/prop/after-open/sass/error -Error: Expected expression. - , -1 | @import "a.css" supports( - | ^ - ' - input.sass 1:26 root stylesheet - -<===> -================================================================================ -<===> error/supports/declaration/followed_by_import_arg/after-comma/sass/input.sass -@import "a" supports(b: c), - "d.css" - -<===> error/supports/declaration/followed_by_import_arg/after-comma/sass/error -Error: Nothing may be indented beneath a @import rule. - , -2 | "d.css" - | ^ - ' - input.sass 2:3 root stylesheet - -<===> -================================================================================ -<===> error/supports/condition_function/before_paren/sass/input.sass -@import "a.css" supports(a - (b)) - -<===> error/supports/condition_function/before_paren/sass/error -Error: expected ":". - , -2 | (b)) - | ^ - ' - input.sass 2:6 root stylesheet +<===> supports/declaration/prop/after-open/sass/output.css +@import "a.css" supports(a: b); <===> ================================================================================ -<===> error/supports/condition_negation/before_not/sass/input.sass -@import "a.css" supports( - not (a: b)) +<===> supports/declaration/prop/space-after-open/scss/input.scss +@import "a.css" supports( a: b) -<===> error/supports/condition_negation/before_not/sass/error -Error: Expected expression. - , -1 | @import "a.css" supports( - | ^ - ' - input.sass 1:26 root stylesheet +<===> supports/declaration/prop/space-after-open/scss/output.css +@import "a.css" supports(a: b); <===> ================================================================================ -<===> error/media/before/sass/input.sass -@import url("a.css") - print +<===> supports/declaration/prop/space-after-open/sass/input.sass +@import "a.css" supports( a: b) -<===> error/media/before/sass/error -Error: Nothing may be indented beneath a @import rule. - , -2 | print - | ^ - ' - input.sass 2:3 root stylesheet +<===> supports/declaration/prop/space-after-open/sass/output.css +@import "a.css" supports(a: b); <===> ================================================================================ @@ -113,13 +63,8 @@ Error: Nothing may be indented beneath a @import rule. @import "a.css" supports((a: b) and (c: d)) -<===> supports/condition_and/before_and/sass/error -Error: expected ")". - , -1 | @import "a.css" supports((a: b) - | ^ - ' - input.sass 1:33 root stylesheet +<===> supports/condition_and/before_and/sass/output.css +@import "a.css" supports((a: b) and (c: d)); <===> ================================================================================ @@ -164,3 +109,54 @@ Error: expected ")". <===> supports/calc/sass/output.css @import "a.css" supports(calc(1)); + +<===> +================================================================================ +<===> error/supports/declaration/followed_by_import_arg/after-comma/sass/input.sass +@import "a" supports(b: c), + "d.css" + +<===> error/supports/declaration/followed_by_import_arg/after-comma/sass/error +Error: Nothing may be indented beneath a @import rule. + , +2 | "d.css" + | ^ + ' + input.sass 2:3 root stylesheet + +<===> +================================================================================ +<===> error/supports/condition_function/before_paren/sass/input.sass +@import "a.css" supports(a + (b)) + +<===> error/supports/condition_function/before_paren/sass/error +Error: expected ":". + , +2 | (b)) + | ^ + ' + input.sass 2:6 root stylesheet + +<===> +================================================================================ +<===> supports/condition_negation/before_not/sass/input.sass +@import "a.css" supports( + not (a: b)) + +<===> supports/condition_negation/before_not/sass/output.css +@import "a.css" supports(not (a: b)); + +<===> +================================================================================ +<===> error/media/before/sass/input.sass +@import url("a.css") + print + +<===> error/media/before/sass/error +Error: Nothing may be indented beneath a @import rule. + , +2 | print + | ^ + ' + input.sass 2:3 root stylesheet diff --git a/spec/css/supports/whitespace.hrx b/spec/css/supports/whitespace.hrx index 35d5de7ca1..ec700000ba 100644 --- a/spec/css/supports/whitespace.hrx +++ b/spec/css/supports/whitespace.hrx @@ -11,19 +11,18 @@ <===> ================================================================================ -<===> error/before_query/sass/input.sass +<===> before_query/sass/input.sass @supports (a: b) c d: e -<===> error/before_query/sass/error -Error: expected "(". - , -1 | @supports - | ^ - ' - input.sass 1:10 root stylesheet +<===> before_query/sass/output.css +@supports (a: b) { + c { + d: e; + } +} <===> ================================================================================ @@ -345,13 +344,13 @@ Error: expected selector. <===> ================================================================================ -<===> multi_conditions/before_and/sass/input.sass +<===> error/multi_conditions/before_and/sass/input.sass @supports (a) and (b) c d: e -<===> multi_conditions/before_and/sass/error +<===> error/multi_conditions/before_and/sass/error Error: expected selector. , 2 | and (b) @@ -412,12 +411,12 @@ Error: expected selector. <===> ================================================================================ -<===> interpolation/no_paren/after_second/input.sass +<===> error/interpolation/no_paren/after_second/input.sass @supports #{"(a: b)"} and (c: d) and (e: f) @d -<===> interpolation/no_paren/after_second/error +<===> error/interpolation/no_paren/after_second/error Error: expected selector. , 2 | and (e: f) From 3ceb3be270732b778bf221109e3af986bcdc3be0 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Mon, 16 Dec 2024 09:49:39 -0500 Subject: [PATCH 32/38] Test whitespace after + import errors --- spec/directives/mixin/whitespace.hrx | 80 +++++++++++++++++++++++----- 1 file changed, 66 insertions(+), 14 deletions(-) diff --git a/spec/directives/mixin/whitespace.hrx b/spec/directives/mixin/whitespace.hrx index dc9ea8de4b..7ff68e7615 100644 --- a/spec/directives/mixin/whitespace.hrx +++ b/spec/directives/mixin/whitespace.hrx @@ -49,6 +49,19 @@ d <===> include/before_name/sass/output.css +<===> +================================================================================ +<===> include/plus/none_before_name/sass/input.sass +@mixin a + b: c +d + +a + +<===> include/plus/none_before_name/sass/output.css +d { + b: c; +} + <===> ================================================================================ <===> include/before_block/scss/input.scss @@ -97,29 +110,42 @@ d <===> ================================================================================ -<===> error/include/before_using/sass/input.sass -@mixin a - @content -@include a() - using () +<===> error/include/plus/space_before_name/sass/input.sass +@mixin a + b: c +d + + a -<===> error/include/before_using/sass/error +<===> error/include/plus/space_before_name/sass/output.css + +<===> error/include/plus/space_before_name/sass/warning WARNING: This selector doesn't have any properties and won't be rendered. , -4 | using () - | ^^^^^^^^ +4 | + a + | ^^^ ' input.sass 4:3 root stylesheet -Error: expected selector. +<===> +================================================================================ +<===> error/include/plus/newline_before_name/sass/input.sass +@mixin a + b: c +d + + + a + +<===> error/include/plus/newline_before_name/sass/output.css + +<===> error/include/plus/newline_before_name/sass/warning +WARNING: This selector doesn't have any properties and won't be rendered. + , -4 | using () - | ^ +5 | a + | ^ ' - input.sass 4:9 @content - input.sass 2:3 a() - input.sass 3:1 root stylesheet + input.sass 5:5 root stylesheet <===> ================================================================================ @@ -139,3 +165,29 @@ WARNING: This selector doesn't have any properties and won't be rendered. | ^ ' input.sass 4:5 root stylesheet + +<===> +================================================================================ +<===> error/include/before_using/sass/input.sass +@mixin a + @content +@include a() + using () + +<===> error/include/before_using/sass/error +WARNING: This selector doesn't have any properties and won't be rendered. + + , +4 | using () + | ^^^^^^^^ + ' + input.sass 4:3 root stylesheet + +Error: expected selector. + , +4 | using () + | ^ + ' + input.sass 4:9 @content + input.sass 2:3 a() + input.sass 3:1 root stylesheet From 2195c6be6b9ef230b783aab6c2abead01aca3b78 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Mon, 16 Dec 2024 11:20:47 -0500 Subject: [PATCH 33/38] Test newlines in attributes and pseudoclass functions --- spec/css/selector/attribute.hrx | 63 +++++++++------------------- spec/css/selector/pseudoselector.hrx | 57 +++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 43 deletions(-) diff --git a/spec/css/selector/attribute.hrx b/spec/css/selector/attribute.hrx index e35383fabb..8b6a90f439 100644 --- a/spec/css/selector/attribute.hrx +++ b/spec/css/selector/attribute.hrx @@ -154,21 +154,10 @@ a[ b] c: d -<===> sass/whitespace/after-lbracket/error -WARNING: This selector doesn't have any properties and won't be rendered. - - , -2 | b] - | ^^ - ' - input.sass 2:3 root stylesheet - -Error: Expected identifier. - , -1 | a[ - | ^ - ' - input.sass 1:3 root stylesheet +<===> sass/whitespace/after-lbracket/output.css +a[b] { + c: d; +} <===> ================================================================================ @@ -177,13 +166,10 @@ a[ b] c: d -<===> sass/whitespace/after-lbracket-indented/error -Error: Expected identifier. - , -1 | a[ - | ^ - ' - input.sass 1:3 root stylesheet +<===> sass/whitespace/after-lbracket-indented/output.css +a[b] { + c: d; +} <===> ================================================================================ @@ -192,13 +178,10 @@ a[b ] c: d -<===> sass/whitespace/after-val/error -Error: expected more input. - , -1 | a[b - | ^ - ' - input.sass 1:4 root stylesheet +<===> sass/whitespace/after-val/output.css +a[b] { + c: d; +} <===> ================================================================================ @@ -207,13 +190,10 @@ a[b =c] d: e -<===> sass/whitespace/before-operator/error -Error: Expected newline. - , -2 | =c] - | ^ - ' - input.sass 2:5 root stylesheet +<===> sass/whitespace/before-operator/output.css +a[b=c] { + d: e; +} <===> ================================================================================ @@ -222,13 +202,10 @@ a[b= c] d: e -<===> sass/whitespace/after-operator/error -Error: Expected identifier. - , -1 | a[b= - | ^ - ' - input.sass 1:5 root stylesheet +<===> sass/whitespace/after-operator/output.css +a[b=c] { + d: e; +} <===> ================================================================================ diff --git a/spec/css/selector/pseudoselector.hrx b/spec/css/selector/pseudoselector.hrx index 2507c523cb..237607098b 100644 --- a/spec/css/selector/pseudoselector.hrx +++ b/spec/css/selector/pseudoselector.hrx @@ -8,3 +8,60 @@ a { a b:c, a > d { x: y; } + +<===> +================================================================================ +<===> whitespace/sass/before_param/input.sass +a:b( + c) + d: e + +<===> whitespace/sass/before_param/output.css +a:b(c) { + d: e; +} + +<===> +================================================================================ +<===> whitespace/sass/after_param/input.sass +a:b(c + ) + d: e + +<===> whitespace/sass/after_param/output.css +a:b(c) { + d: e; +} + +<===> +================================================================================ +<===> with_attribute/sass/input.sass +a:b([c]) + d: e + +<===> with_attribute/sass/output.css +a:b([c]) { + d: e; +} + +<===> +================================================================================ +<===> error/with_attribute_mismatched/sass/input.scss +a:b([c)]{ + d: e; +} + +<===> error/with_attribute_mismatched/sass/error +Error: expected "]". + , +1 | a:b([c)]{ + | ^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> with_attribute_mismatched/sass/output.css +a:b([c]) { + d: e; +} From 592c7845a612aa816c6df1414b03583125e3f798 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Mon, 16 Dec 2024 13:42:49 -0500 Subject: [PATCH 34/38] Cleanup --- spec/css/comment.hrx | 10 +++++---- .../custom_properties/value_interpolation.hrx | 4 ++-- spec/css/unknown_directive/whitespace.hrx | 4 ++-- spec/directives/each.hrx | 21 +++++++------------ spec/directives/for/comment.hrx | 4 ++-- spec/directives/if/sass.hrx | 8 +++---- spec/directives/if/whitespace.hrx | 6 +++--- spec/directives/import/whitespace.hrx | 8 +++---- spec/directives/mixin/whitespace.hrx | 18 ++++++++-------- spec/operators/boolean.hrx | 6 +++--- spec/parser/indentation.hrx | 4 ++-- spec/values/lists/sass.hrx | 4 ++-- 12 files changed, 47 insertions(+), 50 deletions(-) diff --git a/spec/css/comment.hrx b/spec/css/comment.hrx index d7f6acc04a..7181072789 100644 --- a/spec/css/comment.hrx +++ b/spec/css/comment.hrx @@ -61,7 +61,8 @@ should include their own tests for CR LF newlines. <===> ================================================================================ <===> converts_newlines/scss/cr/input.scss -/* foo * bar */ +/* foo + * bar */ <===> converts_newlines/scss/cr/output.css /* foo @@ -80,7 +81,8 @@ should include their own tests for CR LF newlines. ================================================================================ <===> converts_newlines/sass/cr/input.sass /* - foo bar + foo + bar <===> converts_newlines/sass/cr/output.css /* foo @@ -242,12 +244,12 @@ Error: expected more input. <===> ================================================================================ -<===> error/loud/multi_line/sass/input.sass +<===> loud/multi_line/sass/input.sass a b: c /* d e */ f -<===> error/loud/multi_line/sass/output.css +<===> loud/multi_line/sass/output.css a { b: c f; } diff --git a/spec/css/custom_properties/value_interpolation.hrx b/spec/css/custom_properties/value_interpolation.hrx index e0411e1669..a1b05bac1e 100644 --- a/spec/css/custom_properties/value_interpolation.hrx +++ b/spec/css/custom_properties/value_interpolation.hrx @@ -149,14 +149,14 @@ a { <===> ================================================================================ -<===> error/sass/linebreak-interpolation/input.sass +<===> sass/linebreak-interpolation/input.sass a --b: #{1 + 2} -<===> error/sass/linebreak-interpolation/output.css +<===> sass/linebreak-interpolation/output.css a { --b: 3; } diff --git a/spec/css/unknown_directive/whitespace.hrx b/spec/css/unknown_directive/whitespace.hrx index de34029618..dd0ac0b786 100644 --- a/spec/css/unknown_directive/whitespace.hrx +++ b/spec/css/unknown_directive/whitespace.hrx @@ -25,12 +25,12 @@ WARNING: This selector doesn't have any properties and won't be rendered. <===> ================================================================================ -<===> error/children/before_value/sass/input.sass +<===> children/before_value/sass/input.sass @a b c: d -<===> error/children/before_value/sass/output.css +<===> children/before_value/sass/output.css @a { b { c: d; diff --git a/spec/directives/each.hrx b/spec/directives/each.hrx index 87b40239e7..9e161e8701 100644 --- a/spec/directives/each.hrx +++ b/spec/directives/each.hrx @@ -1,5 +1,4 @@ <===> sass/inline/input.sass - @each $a in b, c .#{$a} d: $a @@ -16,7 +15,6 @@ <===> ================================================================================ <===> sass/multiline/after-each/input.sass - @each $a in b, c .#{$a} @@ -33,14 +31,13 @@ <===> ================================================================================ -<===> error/sass/multiline/after-variable/input.sass - +<===> sass/multiline/after-variable/input.sass @each $a in b, c .#{$a} d: $a -<===> error/sass/multiline/after-variable/output.css +<===> sass/multiline/after-variable/output.css .b { d: b; } @@ -51,14 +48,13 @@ <===> ================================================================================ -<===> error/sass/multiline/after-in/input.sass - +<===> sass/multiline/after-in/input.sass @each $a in b, c .#{$a} d: $a -<===> error/sass/multiline/after-in/output.css +<===> sass/multiline/after-in/output.css .b { d: b; } @@ -69,28 +65,27 @@ <===> ================================================================================ -<===> error/sass/multiline/in-expression/input.sass +<===> sass/multiline/in-expression/input.sass @each $a in b, c .#{$a} d: $a -<===> error/sass/multiline/in-expression/output.css +<===> sass/multiline/in-expression/output.css c .b { d: b; } <===> ================================================================================ -<===> error/sass/multiline/in-wrapped-expression/input.sass - +<===> sass/multiline/in-wrapped-expression/input.sass @each $a in (b, c) .#{$a} d: $a -<===> error/sass/multiline/in-wrapped-expression/output.css +<===> sass/multiline/in-wrapped-expression/output.css .b { d: b; } diff --git a/spec/directives/for/comment.hrx b/spec/directives/for/comment.hrx index d898e8b624..e4eac1cc15 100644 --- a/spec/directives/for/comment.hrx +++ b/spec/directives/for/comment.hrx @@ -91,11 +91,11 @@ <===> ================================================================================ -<===> error/before_through/silent/sass/input.sass +<===> before_through/silent/sass/input.sass @for $i from 1 // through 10 -<===> error/before_through/silent/sass/output.css +<===> before_through/silent/sass/output.css <===> ================================================================================ diff --git a/spec/directives/if/sass.hrx b/spec/directives/if/sass.hrx index 66e1087ec1..5d9b298b79 100644 --- a/spec/directives/if/sass.hrx +++ b/spec/directives/if/sass.hrx @@ -37,7 +37,7 @@ a { <===> ================================================================================ -<===> error/if-statement-wrapped-multiline/input.sass +<===> if-statement-wrapped-multiline/input.sass $a: b $c: d a @@ -47,14 +47,14 @@ a ) e: f -<===> error/if-statement-wrapped-multiline/output.css +<===> if-statement-wrapped-multiline/output.css a { e: f; } <===> ================================================================================ -<===> error/if-statement-unwrapped-multiline/input.sass +<===> if-statement-unwrapped-multiline/input.sass $a: b $c: d a @@ -62,7 +62,7 @@ a $a == b and $c == d e: f -<===> error/if-statement-unwrapped-multiline/output.css +<===> if-statement-unwrapped-multiline/output.css a { e: f; } diff --git a/spec/directives/if/whitespace.hrx b/spec/directives/if/whitespace.hrx index c47300246c..8dff2773d1 100644 --- a/spec/directives/if/whitespace.hrx +++ b/spec/directives/if/whitespace.hrx @@ -92,13 +92,13 @@ <===> ================================================================================ -<===> error/condition/before_and/sass/input.sass +<===> condition/before_and/sass/input.sass @if true and true -<===> error/condition/before_and/sass/output.css +<===> condition/before_and/sass/output.css -<===> error/condition/before_and/sass/warning +<===> condition/before_and/sass/warning WARNING: This selector doesn't have any properties and won't be rendered. , diff --git a/spec/directives/import/whitespace.hrx b/spec/directives/import/whitespace.hrx index 4a60ac7354..b19ee78300 100644 --- a/spec/directives/import/whitespace.hrx +++ b/spec/directives/import/whitespace.hrx @@ -35,21 +35,21 @@ Error: Nothing may be indented beneath a @import rule. <===> ================================================================================ -<===> error/after_comma/sass/input.scss +<===> after_comma/sass/input.scss @import "a.css", "b.css" -<===> error/after_comma/sass/output.css +<===> after_comma/sass/output.css @import "a.css"; @import "b.css"; <===> ================================================================================ -<===> error/modifier/no_args/before/sass/input.scss +<===> modifier/no_args/before/sass/input.scss @import "a.css" b -<===> error/modifier/no_args/before/sass/output.css +<===> modifier/no_args/before/sass/output.css @import "a.css" b; <===> diff --git a/spec/directives/mixin/whitespace.hrx b/spec/directives/mixin/whitespace.hrx index 7ff68e7615..17e780d6be 100644 --- a/spec/directives/mixin/whitespace.hrx +++ b/spec/directives/mixin/whitespace.hrx @@ -110,15 +110,15 @@ d { <===> ================================================================================ -<===> error/include/plus/space_before_name/sass/input.sass +<===> include/plus/space_before_name/sass/input.sass @mixin a b: c d + a -<===> error/include/plus/space_before_name/sass/output.css +<===> include/plus/space_before_name/sass/output.css -<===> error/include/plus/space_before_name/sass/warning +<===> include/plus/space_before_name/sass/warning WARNING: This selector doesn't have any properties and won't be rendered. , @@ -129,16 +129,16 @@ WARNING: This selector doesn't have any properties and won't be rendered. <===> ================================================================================ -<===> error/include/plus/newline_before_name/sass/input.sass +<===> include/plus/newline_before_name/sass/input.sass @mixin a b: c d + a -<===> error/include/plus/newline_before_name/sass/output.css +<===> include/plus/newline_before_name/sass/output.css -<===> error/include/plus/newline_before_name/sass/warning +<===> include/plus/newline_before_name/sass/warning WARNING: This selector doesn't have any properties and won't be rendered. , @@ -149,15 +149,15 @@ WARNING: This selector doesn't have any properties and won't be rendered. <===> ================================================================================ -<===> error/include/plus/before_name/sass/input.sass +<===> include/plus/before_name/sass/input.sass @mixin a b + a -<===> error/include/plus/before_name/sass/output.css +<===> include/plus/before_name/sass/output.css -<===> error/include/plus/before_name/sass/warning +<===> include/plus/before_name/sass/warning WARNING: This selector doesn't have any properties and won't be rendered. , diff --git a/spec/operators/boolean.hrx b/spec/operators/boolean.hrx index 613a52bba2..91d4c6cd9a 100644 --- a/spec/operators/boolean.hrx +++ b/spec/operators/boolean.hrx @@ -45,13 +45,13 @@ Error: Nothing may be indented beneath a variable declaration. <===> ================================================================================ -<===> error/whitespace/not/before/sass/input.sass +<===> whitespace/not/before/sass/input.sass $a: b not c -<===> error/whitespace/not/before/sass/output.css +<===> whitespace/not/before/sass/output.css -<===> error/whitespace/not/before/sass/warning +<===> whitespace/not/before/sass/warning WARNING: This selector doesn't have any properties and won't be rendered. , diff --git a/spec/parser/indentation.hrx b/spec/parser/indentation.hrx index af4561eb69..4ab5feaa81 100644 --- a/spec/parser/indentation.hrx +++ b/spec/parser/indentation.hrx @@ -32,11 +32,11 @@ Error: Expected newline. <===> ================================================================================ -<===> error/mixed-syntax/semicolon/input.sass +<===> mixed-syntax/semicolon/input.sass a b: c; -<===> error/mixed-syntax/semicolon/output.css +<===> mixed-syntax/semicolon/output.css a { b: c; } diff --git a/spec/values/lists/sass.hrx b/spec/values/lists/sass.hrx index 418102f72b..d54d733f4f 100644 --- a/spec/values/lists/sass.hrx +++ b/spec/values/lists/sass.hrx @@ -47,14 +47,14 @@ Error: () isn't a valid CSS value. <===> ================================================================================ -<===> error/paren/no-indent/input.sass +<===> paren/no-indent/input.sass a b: ( c, d ) -<===> error/paren/no-indent/output.css +<===> paren/no-indent/output.css a { b: c, d; } From c3835f0a92aad7bc3840dd4f973a16d1bd0a94d8 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Mon, 16 Dec 2024 13:46:05 -0500 Subject: [PATCH 35/38] Test indentation level in multiline --- spec/parser/indentation.hrx | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/spec/parser/indentation.hrx b/spec/parser/indentation.hrx index 4ab5feaa81..6c1cb117cd 100644 --- a/spec/parser/indentation.hrx +++ b/spec/parser/indentation.hrx @@ -41,6 +41,42 @@ a { b: c; } +<===> +================================================================================ +<===> multiline_indent_level/none/input.sass +a[ +b] + c: d; + +<===> multiline_indent_level/none/output.css +a[b] { + c: d; +} + +<===> +================================================================================ +<===> multiline_indent_level/same/input.sass +a[ + b] + c: d + +<===> multiline_indent_level/same/output.css +a[b] { + c: d; +} + +<===> +================================================================================ +<===> multiline_indent_level/more/input.sass +a[ + b] + c: d; + +<===> multiline_indent_level/more/output.css +a[b] { + c: d; +} + <===> ================================================================================ <===> error/semicolon-multiple-same-line/input.sass From e985ff6ed3104531ef5dd478da23a9776aa986a3 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Mon, 16 Dec 2024 14:01:42 -0500 Subject: [PATCH 36/38] Remove dangling files --- spec/css/selector/pseudoselector.hrx | 7 ------- spec/css/supports/whitespace.hrx | 7 ------- 2 files changed, 14 deletions(-) diff --git a/spec/css/selector/pseudoselector.hrx b/spec/css/selector/pseudoselector.hrx index 237607098b..0a13daba75 100644 --- a/spec/css/selector/pseudoselector.hrx +++ b/spec/css/selector/pseudoselector.hrx @@ -58,10 +58,3 @@ Error: expected "]". | ^ ' input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> with_attribute_mismatched/sass/output.css -a:b([c]) { - d: e; -} diff --git a/spec/css/supports/whitespace.hrx b/spec/css/supports/whitespace.hrx index ec700000ba..5ed6d81d8c 100644 --- a/spec/css/supports/whitespace.hrx +++ b/spec/css/supports/whitespace.hrx @@ -424,13 +424,6 @@ Error: expected selector. ' input.sass 2:7 root stylesheet -<===> -================================================================================ -<===> interpolation/no_paren/aren/after_second/output.css -@supports (a: b) and (c: d) and (e: f) { - @d; -} - <===> ================================================================================ <===> interpolation/no_paren/after_operator/input.sass From 978f587c3e83aa9bcaeb5f5bbb3b336be89a8d58 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Mon, 16 Dec 2024 14:15:40 -0500 Subject: [PATCH 37/38] Lint --- spec/css/comment.hrx | 24 +++---- spec/css/plain/import/whitespace.hrx | 18 +++--- spec/css/supports/whitespace.hrx | 62 +++++++++--------- spec/directives/for/comment.hrx | 46 +++++++------- spec/directives/if/whitespace.hrx | 32 +++++----- spec/directives/import/whitespace.hrx | 46 +++++++------- spec/directives/mixin/whitespace.hrx | 92 +++++++++++++-------------- spec/operators/boolean.hrx | 28 ++++---- spec/operators/equals.hrx | 16 ++--- spec/operators/gt.hrx | 16 ++--- spec/parser/indentation.hrx | 28 ++++---- spec/values/lists/brackets.hrx | 40 ++++++------ spec/values/lists/sass.hrx | 28 ++++---- 13 files changed, 238 insertions(+), 238 deletions(-) diff --git a/spec/css/comment.hrx b/spec/css/comment.hrx index 7181072789..877720e036 100644 --- a/spec/css/comment.hrx +++ b/spec/css/comment.hrx @@ -242,18 +242,6 @@ Error: expected more input. ' input.sass 2:12 root stylesheet -<===> -================================================================================ -<===> loud/multi_line/sass/input.sass -a - b: c /* d - e */ f - -<===> loud/multi_line/sass/output.css -a { - b: c f; -} - <===> ================================================================================ <===> error/loud/interpolation/unterminated/input.scss @@ -311,3 +299,15 @@ Error: Unexpected text after end of comment | ^ extra text ' input.sass 3:3 root stylesheet + +<===> +================================================================================ +<===> loud/multi_line/sass/input.sass +a + b: c /* d + e */ f + +<===> loud/multi_line/sass/output.css +a { + b: c f; +} diff --git a/spec/css/plain/import/whitespace.hrx b/spec/css/plain/import/whitespace.hrx index f76e4541b0..44aa88944f 100644 --- a/spec/css/plain/import/whitespace.hrx +++ b/spec/css/plain/import/whitespace.hrx @@ -102,6 +102,15 @@ <===> supports/condition_negation/after_not/sass/output.css @import "a.css" supports(not (a: b)); +<===> +================================================================================ +<===> supports/condition_negation/before_not/sass/input.sass +@import "a.css" supports( + not (a: b)) + +<===> supports/condition_negation/before_not/sass/output.css +@import "a.css" supports(not (a: b)); + <===> ================================================================================ <===> supports/calc/sass/input.sass @@ -138,15 +147,6 @@ Error: expected ":". ' input.sass 2:6 root stylesheet -<===> -================================================================================ -<===> supports/condition_negation/before_not/sass/input.sass -@import "a.css" supports( - not (a: b)) - -<===> supports/condition_negation/before_not/sass/output.css -@import "a.css" supports(not (a: b)); - <===> ================================================================================ <===> error/media/before/sass/input.sass diff --git a/spec/css/supports/whitespace.hrx b/spec/css/supports/whitespace.hrx index 5ed6d81d8c..dfa3c4f203 100644 --- a/spec/css/supports/whitespace.hrx +++ b/spec/css/supports/whitespace.hrx @@ -39,6 +39,37 @@ Error: expected selector. ' input.sass 2:7 root stylesheet +<===> +================================================================================ +<===> error/interpolation/no_paren/after_second/input.sass +@supports #{"(a: b)"} and (c: d) + and (e: f) + @d + +<===> error/interpolation/no_paren/after_second/error +Error: expected selector. + , +2 | and (e: f) + | ^ + ' + input.sass 2:7 root stylesheet + +<===> +================================================================================ +<===> error/multi_conditions/before_and/sass/input.sass +@supports (a) + and (b) + c + d: e + +<===> error/multi_conditions/before_and/sass/error +Error: expected selector. + , +2 | and (b) + | ^ + ' + input.sass 2:6 root stylesheet + <===> ================================================================================ <===> declaration/normal_prop/after_open_paren/scss/input.scss @@ -342,22 +373,6 @@ Error: expected selector. } } -<===> -================================================================================ -<===> error/multi_conditions/before_and/sass/input.sass -@supports (a) - and (b) - c - d: e - -<===> error/multi_conditions/before_and/sass/error -Error: expected selector. - , -2 | and (b) - | ^ - ' - input.sass 2:6 root stylesheet - <===> ================================================================================ <===> multi_conditions/after_and/sass/input.sass @@ -409,21 +424,6 @@ Error: expected selector. @d; } -<===> -================================================================================ -<===> error/interpolation/no_paren/after_second/input.sass -@supports #{"(a: b)"} and (c: d) - and (e: f) - @d - -<===> error/interpolation/no_paren/after_second/error -Error: expected selector. - , -2 | and (e: f) - | ^ - ' - input.sass 2:7 root stylesheet - <===> ================================================================================ <===> interpolation/no_paren/after_operator/input.sass diff --git a/spec/directives/for/comment.hrx b/spec/directives/for/comment.hrx index e4eac1cc15..e4626ea958 100644 --- a/spec/directives/for/comment.hrx +++ b/spec/directives/for/comment.hrx @@ -97,6 +97,29 @@ <===> before_through/silent/sass/output.css +<===> +================================================================================ +<===> before_through/silent/scss/input.scss +@for $i from 1 // + through 10 {} + +<===> before_through/silent/scss/output.css + +<===> +================================================================================ +<===> before_through/loud/scss/input.scss +@for $i from 1 /**/ through 10 {} + +<===> before_through/loud/scss/output.css + +<===> +================================================================================ +<===> before_through/loud/sass/input.sass +@for $i from 1 /**/ through 10 + + +<===> before_through/loud/sass/output.css + <===> ================================================================================ <===> after_through/silent/sass/input.sass @@ -128,29 +151,6 @@ <===> after_through/loud/sass/output.css -<===> -================================================================================ -<===> before_through/loud/scss/input.scss -@for $i from 1 /**/ through 10 {} - -<===> before_through/loud/scss/output.css - -<===> -================================================================================ -<===> before_through/loud/sass/input.sass -@for $i from 1 /**/ through 10 - - -<===> before_through/loud/sass/output.css - -<===> -================================================================================ -<===> before_through/silent/scss/input.scss -@for $i from 1 // - through 10 {} - -<===> before_through/silent/scss/output.css - <===> ================================================================================ <===> before_block/loud/scss/input.scss diff --git a/spec/directives/if/whitespace.hrx b/spec/directives/if/whitespace.hrx index 8dff2773d1..53dc063e5c 100644 --- a/spec/directives/if/whitespace.hrx +++ b/spec/directives/if/whitespace.hrx @@ -74,22 +74,6 @@ <===> condition/before_and/scss/output.css -<===> -================================================================================ -<===> condition/after_and/scss/input.scss -@if true and - true {} - -<===> condition/after_and/scss/output.css - -<===> -================================================================================ -<===> condition/after_and/sass/input.sass -@if true and - true - -<===> condition/after_and/sass/output.css - <===> ================================================================================ <===> condition/before_and/sass/input.sass @@ -107,6 +91,22 @@ WARNING: This selector doesn't have any properties and won't be rendered. ' input.sass 2:3 root stylesheet +<===> +================================================================================ +<===> condition/after_and/scss/input.scss +@if true and + true {} + +<===> condition/after_and/scss/output.css + +<===> +================================================================================ +<===> condition/after_and/sass/input.sass +@if true and + true + +<===> condition/after_and/sass/output.css + <===> ================================================================================ <===> error/top_level_else/sass/input.sass diff --git a/spec/directives/import/whitespace.hrx b/spec/directives/import/whitespace.hrx index b19ee78300..acfdcb8252 100644 --- a/spec/directives/import/whitespace.hrx +++ b/spec/directives/import/whitespace.hrx @@ -33,25 +33,6 @@ Error: Nothing may be indented beneath a @import rule. ' input.sass 2:3 root stylesheet -<===> -================================================================================ -<===> after_comma/sass/input.scss -@import "a.css", - "b.css" - -<===> after_comma/sass/output.css -@import "a.css"; -@import "b.css"; - -<===> -================================================================================ -<===> modifier/no_args/before/sass/input.scss -@import "a.css" - b - -<===> modifier/no_args/before/sass/output.css -@import "a.css" b; - <===> ================================================================================ <===> error/modifier/args/before/sass/input.sass @@ -68,11 +49,11 @@ Error: Nothing may be indented beneath a @import rule. <===> ================================================================================ -<===> before_comma/scss/input.scss -@import "a.css" - , "b.css" +<===> after_comma/sass/input.scss +@import "a.css", + "b.css" -<===> before_comma/scss/output.css +<===> after_comma/sass/output.css @import "a.css"; @import "b.css"; @@ -86,6 +67,15 @@ Error: Nothing may be indented beneath a @import rule. @import "a.css"; @import "b.css"; +<===> +================================================================================ +<===> modifier/no_args/before/sass/input.scss +@import "a.css" + b + +<===> modifier/no_args/before/sass/output.css +@import "a.css" b; + <===> ================================================================================ <===> modifier/no_args/before/scss/input.scss @@ -143,3 +133,13 @@ Error: Nothing may be indented beneath a @import rule. <===> modifier/args/before_close_paren/sass/output.css @import "a.css" b(c ); + +<===> +================================================================================ +<===> before_comma/scss/input.scss +@import "a.css" + , "b.css" + +<===> before_comma/scss/output.css +@import "a.css"; +@import "b.css"; diff --git a/spec/directives/mixin/whitespace.hrx b/spec/directives/mixin/whitespace.hrx index 17e780d6be..d40e9e2ae1 100644 --- a/spec/directives/mixin/whitespace.hrx +++ b/spec/directives/mixin/whitespace.hrx @@ -62,52 +62,6 @@ d { b: c; } -<===> -================================================================================ -<===> include/before_block/scss/input.scss -@mixin a {@content} -@include a() - {} - -<===> include/before_block/scss/output.css - -<===> -================================================================================ -<===> include/before_using/scss/input.scss -@mixin a {@content} -@include a() - using () {} - -<===> include/before_using/scss/output.css - -<===> -================================================================================ -<===> include/after_using/scss/input.scss -@mixin a {@content} -@include a() using - () {} - -<===> include/after_using/scss/output.css - -<===> -================================================================================ -<===> include/after_using/sass/input.sass -@mixin a - @content -@include a() using - () - -<===> include/after_using/sass/output.css - -<===> -================================================================================ -<===> include/after_using_arglist/scss/input.scss -@mixin a {@content} -@include a() using () - {} - -<===> include/after_using_arglist/scss/output.css - <===> ================================================================================ <===> include/plus/space_before_name/sass/input.sass @@ -166,6 +120,52 @@ WARNING: This selector doesn't have any properties and won't be rendered. ' input.sass 4:5 root stylesheet +<===> +================================================================================ +<===> include/before_block/scss/input.scss +@mixin a {@content} +@include a() + {} + +<===> include/before_block/scss/output.css + +<===> +================================================================================ +<===> include/before_using/scss/input.scss +@mixin a {@content} +@include a() + using () {} + +<===> include/before_using/scss/output.css + +<===> +================================================================================ +<===> include/after_using/scss/input.scss +@mixin a {@content} +@include a() using + () {} + +<===> include/after_using/scss/output.css + +<===> +================================================================================ +<===> include/after_using/sass/input.sass +@mixin a + @content +@include a() using + () + +<===> include/after_using/sass/output.css + +<===> +================================================================================ +<===> include/after_using_arglist/scss/input.scss +@mixin a {@content} +@include a() using () + {} + +<===> include/after_using_arglist/scss/output.css + <===> ================================================================================ <===> error/include/before_using/sass/input.sass diff --git a/spec/operators/boolean.hrx b/spec/operators/boolean.hrx index 91d4c6cd9a..b7a6182f41 100644 --- a/spec/operators/boolean.hrx +++ b/spec/operators/boolean.hrx @@ -29,20 +29,6 @@ $a: b not <===> whitespace/not/after/sass/output.css -<===> -================================================================================ -<===> error/whitespace/and/before_indent/sass/input.sass -$a: b - and c - -<===> error/whitespace/and/before_indent/sass/error -Error: Nothing may be indented beneath a variable declaration. - , -2 | and c - | ^ - ' - input.sass 2:3 root stylesheet - <===> ================================================================================ <===> whitespace/not/before/sass/input.sass @@ -60,6 +46,20 @@ WARNING: This selector doesn't have any properties and won't be rendered. ' input.sass 2:1 root stylesheet +<===> +================================================================================ +<===> error/whitespace/and/before_indent/sass/input.sass +$a: b + and c + +<===> error/whitespace/and/before_indent/sass/error +Error: Nothing may be indented beneath a variable declaration. + , +2 | and c + | ^ + ' + input.sass 2:3 root stylesheet + <===> ================================================================================ <===> error/whitespace/not/before_indent/sass/input.sass diff --git a/spec/operators/equals.hrx b/spec/operators/equals.hrx index b621723589..dbd3e34fc6 100644 --- a/spec/operators/equals.hrx +++ b/spec/operators/equals.hrx @@ -10,14 +10,6 @@ Error: Expected identifier. ' input.sass 2:2 root stylesheet -<===> -================================================================================ -<===> whitespace/after/sass/input.sass -$a: b == - c - -<===> whitespace/after/sass/output.css - <===> ================================================================================ <===> error/whitespace/before_indent/sass/input.sass @@ -32,3 +24,11 @@ Error: Nothing may be indented beneath a variable declaration. ' input.sass 2:3 root stylesheet + +<===> +================================================================================ +<===> whitespace/after/sass/input.sass +$a: b == + c + +<===> whitespace/after/sass/output.css diff --git a/spec/operators/gt.hrx b/spec/operators/gt.hrx index 5cad1edd9d..0f66b4de0e 100644 --- a/spec/operators/gt.hrx +++ b/spec/operators/gt.hrx @@ -18,14 +18,6 @@ Error: expected selector. ' input.sass 2:3 root stylesheet -<===> -================================================================================ -<===> whitespace/after/sass/input.sass -$a: 1 > - 2 - -<===> whitespace/after/sass/output.css - <===> ================================================================================ <===> error/whitespace/before_indent/sass/input.sass @@ -40,3 +32,11 @@ Error: Nothing may be indented beneath a variable declaration. ' input.sass 2:3 root stylesheet + +<===> +================================================================================ +<===> whitespace/after/sass/input.sass +$a: 1 > + 2 + +<===> whitespace/after/sass/output.css diff --git a/spec/parser/indentation.hrx b/spec/parser/indentation.hrx index 6c1cb117cd..9a464da800 100644 --- a/spec/parser/indentation.hrx +++ b/spec/parser/indentation.hrx @@ -30,6 +30,20 @@ Error: Expected newline. ' input.sass 1:3 root stylesheet +<===> +================================================================================ +<===> error/semicolon-multiple-same-line/input.sass +a + b: c; d: e; + +<===> error/semicolon-multiple-same-line/error +Error: multiple statements on one line are not supported in the indented syntax. + , +2 | b: c; d: e; + | ^ + ' + input.sass 2:7 root stylesheet + <===> ================================================================================ <===> mixed-syntax/semicolon/input.sass @@ -76,17 +90,3 @@ a[ a[b] { c: d; } - -<===> -================================================================================ -<===> error/semicolon-multiple-same-line/input.sass -a - b: c; d: e; - -<===> error/semicolon-multiple-same-line/error -Error: multiple statements on one line are not supported in the indented syntax. - , -2 | b: c; d: e; - | ^ - ' - input.sass 2:7 root stylesheet diff --git a/spec/values/lists/brackets.hrx b/spec/values/lists/brackets.hrx index 23fc73fb82..47b1ec29cc 100644 --- a/spec/values/lists/brackets.hrx +++ b/spec/values/lists/brackets.hrx @@ -18,16 +18,6 @@ a { b: []; } -<===> -================================================================================ -<===> single/input.scss -a {b: [c]} - -<===> single/output.css -a { - b: [c]; -} - <===> ================================================================================ <===> whitespace/single/after_lbracket/sass/input.sass @@ -52,16 +42,6 @@ a { b: [c]; } -<===> -================================================================================ -<===> multiple/input.scss -a {b: [c d]} - -<===> multiple/output.css -a { - b: [c d]; -} - <===> ================================================================================ <===> whitespace/multiple/after_lbracket/sass/input.sass @@ -98,6 +78,26 @@ a { b: [c d]; } +<===> +================================================================================ +<===> single/input.scss +a {b: [c]} + +<===> single/output.css +a { + b: [c]; +} + +<===> +================================================================================ +<===> multiple/input.scss +a {b: [c d]} + +<===> multiple/output.css +a { + b: [c d]; +} + <===> ================================================================================ <===> nested/empty/input.scss diff --git a/spec/values/lists/sass.hrx b/spec/values/lists/sass.hrx index d54d733f4f..ee95e32713 100644 --- a/spec/values/lists/sass.hrx +++ b/spec/values/lists/sass.hrx @@ -45,20 +45,6 @@ Error: () isn't a valid CSS value. ' input.sass 2:6 root stylesheet -<===> -================================================================================ -<===> paren/no-indent/input.sass -a - b: ( -c, -d -) - -<===> paren/no-indent/output.css -a { - b: c, d; -} - <===> ================================================================================ <===> error/no-parens/no-trailing-comma/input.sass @@ -89,6 +75,20 @@ Error: expected ":". ' input.sass 3:7 root stylesheet +<===> +================================================================================ +<===> paren/no-indent/input.sass +a + b: ( +c, +d +) + +<===> paren/no-indent/output.css +a { + b: c, d; +} + <===> ================================================================================ <===> paren/indented-under/input.sass From cf055c5993b139d71350a5512b85eb38da75e6cd Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Tue, 17 Dec 2024 12:11:16 -0500 Subject: [PATCH 38/38] Semicolon in sass tests --- spec/directives/error.hrx | 2 +- spec/parser/indentation.hrx | 11 ------- spec/parser/semicolon.hrx | 62 +++++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 12 deletions(-) create mode 100644 spec/parser/semicolon.hrx diff --git a/spec/directives/error.hrx b/spec/directives/error.hrx index 35496af6c9..ecc4b16162 100644 --- a/spec/directives/error.hrx +++ b/spec/directives/error.hrx @@ -5,7 +5,7 @@ Error: a , 1 | @error a; - | ^^^^^^^^^ + | ^^^^^^^^ ' input.sass 1:1 root stylesheet diff --git a/spec/parser/indentation.hrx b/spec/parser/indentation.hrx index 9a464da800..2decae3680 100644 --- a/spec/parser/indentation.hrx +++ b/spec/parser/indentation.hrx @@ -44,17 +44,6 @@ Error: multiple statements on one line are not supported in the indented syntax. ' input.sass 2:7 root stylesheet -<===> -================================================================================ -<===> mixed-syntax/semicolon/input.sass -a - b: c; - -<===> mixed-syntax/semicolon/output.css -a { - b: c; -} - <===> ================================================================================ <===> multiline_indent_level/none/input.sass diff --git a/spec/parser/semicolon.hrx b/spec/parser/semicolon.hrx new file mode 100644 index 0000000000..c2840493eb --- /dev/null +++ b/spec/parser/semicolon.hrx @@ -0,0 +1,62 @@ +<===> sass/style_rule/input.sass +a + b: c; + +<===> sass/style_rule/output.css +a { + b: c; +} + +<===> +================================================================================ +<===> sass/variable/input.sass +$a: b; +c + d: $a; + +<===> sass/variable/output.css +c { + d: b; +} + +<===> +================================================================================ +<===> sass/style_rule_multiple/cr/input.sass +a + b: c; + d: e; + +<===> sass/style_rule_multiple/cr/output.css +a { + b: c; + d: e; +} + +<===> +================================================================================ +<===> sass/style_rule_multiple/ff/input.sass +a + b: c; + d: e; + +<===> sass/style_rule_multiple/ff/output.css +a { + b: c; + d: e; +} + +<===> +================================================================================ +<===> sass/nested/cr/input.sass +a + b: c; + d + e: f; + +<===> sass/nested/cr/output.css +a { + b: c; +} +a d { + e: f; +}