Skip to content

Commit

Permalink
Fix error-checking for deprotofying clamp()
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Jul 31, 2023
1 parent 8a3fd41 commit 85c6e4e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/src/embedded/protofier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -313,14 +313,17 @@ final class Protofier {
Value_Calculation(name: "calc") => throw paramsError(
"Value.Calculation.arguments must have exactly one argument for "
"calc()."),
Value_Calculation(name: "clamp", arguments: [var arg1, ...var rest]) =>
Value_Calculation(
name: "clamp",
arguments: [var arg1, ...var rest] && List(length: < 4)
) =>
SassCalculation.clamp(
_deprotofyCalculationValue(arg1),
rest.elementAtOrNull(0).andThen(_deprotofyCalculationValue),
rest.elementAtOrNull(1).andThen(_deprotofyCalculationValue)),
Value_Calculation(name: "clamp") => throw paramsError(
"Value.Calculation.arguments must have exactly 1 to 3 arguments "
"for clamp()."),
"Value.Calculation.arguments must have 1 to 3 arguments for "
"clamp()."),
Value_Calculation(name: "min" || "max", arguments: []) =>
throw paramsError(
"Value.Calculation.arguments must have at least 1 argument for "
Expand Down

0 comments on commit 85c6e4e

Please sign in to comment.