Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Indented syntax improvements] Specs #2041

Open
wants to merge 74 commits into
base: main
Choose a base branch
from

Conversation

jamesnw
Copy link
Contributor

@jamesnw jamesnw commented Dec 16, 2024

Blocked until proposal is accepted.

[skip dart-sass]
[skip sass-embedded]

@jamesnw jamesnw requested a review from nex3 January 11, 2025 02:10
Copy link
Contributor

@nex3 nex3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other expressions that should probably have whitespace tests include parentheses and function calls.

spec/callable/whitespace.hrx Outdated Show resolved Hide resolved
spec/css/comment.hrx Outdated Show resolved Hide resolved
spec/css/comment.hrx Outdated Show resolved Hide resolved
spec/css/custom_properties/syntax.hrx Outdated Show resolved Hide resolved
spec/css/custom_properties/syntax.hrx Outdated Show resolved Hide resolved
spec/operators/boolean.hrx Outdated Show resolved Hide resolved
spec/parser/interpolation.hrx Outdated Show resolved Hide resolved
spec/parser/selector.hrx Outdated Show resolved Hide resolved
spec/parser/selector.hrx Show resolved Hide resolved
spec/parser/semicolon.hrx Outdated Show resolved Hide resolved
Copy link
Contributor Author

@jamesnw jamesnw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nex3 I think I resolved all the issues.

Other expressions that should probably have whitespace tests include parentheses and function calls.

For parentheses, I do have tests in spec/values/maps/sass.hrx and spec/values/lists/sass.hrx, and also expanded tests in functions and parentheses in 2719995.

This also caught a bug in parsing @function a($b: c\nd). I fixed this and changed expressionUntilComma to always consume whitespace (because it is currently only called in places that can consume whitespace) here-
sass/dart-sass@e1df2ad

spec/parser/selector.hrx Outdated Show resolved Hide resolved
spec/css/custom_properties/syntax.hrx Outdated Show resolved Hide resolved
spec/expressions/comments.hrx Outdated Show resolved Hide resolved
spec/css/custom_properties/syntax.hrx Outdated Show resolved Hide resolved
spec/css/comment.hrx Outdated Show resolved Hide resolved
spec/directives/while.hrx Outdated Show resolved Hide resolved
spec/directives/return.hrx Outdated Show resolved Hide resolved
spec/operators/boolean.hrx Outdated Show resolved Hide resolved
spec/operators/boolean.hrx Outdated Show resolved Hide resolved
================================================================================
<===> whitespace/not/before/sass/input.sass
$a: b
not c
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cleaned this up a bit in b5065e4, but am wondering if there are additional cases I should test around differentiating binary and unary operations that use -?

@jamesnw jamesnw requested a review from nex3 January 28, 2025 18:52
Copy link
Contributor

@nex3 nex3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty close!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The core_functions directory is for testing the semantics of functions. Function call syntax doesn't differ between built-in, user-defined, and plain-CSS functions (except that the latter allows interpolation and not namepsaces) so syntactic tests for functions should go in a single, syntax-oriented location.

Copy link
Contributor Author

@jamesnw jamesnw Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to spec/expressions/functions in 5a5ff45, and also switched to using list.append so I'm not using a deprecated function.

@@ -18,6 +18,42 @@ Error: Expected identifier.
'
input.sass 1:7 root stylesheet

<===>
================================================================================
<===> error/logic_sequence/before_operator/sass/input.sass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error directory should go at the end of the HRX file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved in cd4eced


<===>
================================================================================
<===> error/after_arg/sass/input.sass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also test @extend a\nb.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in cd4eced

@@ -0,0 +1,5 @@
<===> content/semicolon/input.sass
@mixin a
@content;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why a semicolon?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was porting over a nonconformant test, originally in spec/non_conformant/sass/semicolon/content.hrx. Should it be removed?

@jamesnw jamesnw requested a review from nex3 January 30, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants