Skip to content

Commit

Permalink
Update sass-spec test suite to 2024-12-12.
Browse files Browse the repository at this point in the history
* Minor changes in agrument syntax errors.
  • Loading branch information
kaj committed Jan 4, 2025
1 parent 277b95d commit f319274
Show file tree
Hide file tree
Showing 15 changed files with 793 additions and 129 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ project adheres to
Many parse errors now match the dart sass error message.
Also allow "loud" comments in more places.
* Pure css `round()` may take an expression argument.
* Updated sass-spec test suite to 2024-11-15.
* Minor changes in agrument syntax errors.
* Updated sass-spec test suite to 2024-12-12.


## Release 0.28.10
Expand Down
25 changes: 18 additions & 7 deletions rsass/src/parser/formalargs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,14 @@ pub fn formal_args(input: Span) -> PResult<FormalArgs> {
|(name, d)| (name.into(), d),
),
)(input)?;
let (input, _) = terminated(opt(tag(",")), opt_spacelike)(input)?;
let (input, va) = terminated(opt(tag("...")), opt_spacelike)(input)?;
let (input, va) = if !v.is_empty() {
terminated(
opt(tag("...")),
preceded(opt_spacelike, terminated(opt(tag(",")), opt_spacelike)),
)(input)?
} else {
(input, None)
};
let (input, _) = char(')')(input)?;
Ok((
input,
Expand All @@ -43,8 +49,8 @@ pub fn call_args(input: Span) -> PResult<CallArgs> {
delimited(
terminated(char('('), opt_spacelike),
map_res(
pair(
separated_list0(
|input| {
let (input, args) = separated_list0(
terminated(tag(","), opt_spacelike),
pair(
opt(map(
Expand All @@ -61,9 +67,14 @@ pub fn call_args(input: Span) -> PResult<CallArgs> {
)),
terminated(space_list, opt_spacelike),
),
),
opt(terminated(char(','), opt_spacelike)),
),
)(input)?;
let (input, trail) = if !args.is_empty() {
opt(terminated(char(','), opt_spacelike))(input)?
} else {
(input, None)
};
Ok((input, (args, trail)))
},
|(args, trail)| CallArgs::new(args, trail.is_some()),
),
cut(char(')')),
Expand Down
2 changes: 1 addition & 1 deletion rsass/src/sass/formal_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ impl fmt::Display for ArgsError {
write!(out, "Missing argument ${name}.")
}
Self::Unexpected(name) => {
write!(out, "No argument named ${name}.")
write!(out, "No parameter named ${name}.")
}
Self::Eval(e) => e.fmt(out),
}
Expand Down
104 changes: 0 additions & 104 deletions rsass/tests/spec/arguments/invocation.rs

This file was deleted.

8 changes: 0 additions & 8 deletions rsass/tests/spec/arguments/mod.rs

This file was deleted.

Loading

0 comments on commit f319274

Please sign in to comment.