diff --git a/spec/functions.md b/spec/functions.md index a70d6ed21b..b29fa78439 100644 --- a/spec/functions.md +++ b/spec/functions.md @@ -44,6 +44,28 @@ matching is case-insensitive. ## Syntax +
+**FunctionExpression**¹ ::= [CssMinMax]
+                      | [SpecialFunctionExpression]
+                      | [CalculationExpression]
+                      | FunctionCall
+**FunctionCall**²       ::= [NamespacedIdentifier] ArgumentInvocation
+
+ +[CssMinMax]: types/calculation.md#cssminmax +[SpecialFunctionExpression]: syntax.md#specialfunctionexpression +[CalculationExpression]: types/calculation.md#calculationexpression +[NamespacedIdentifier]: modules.md#syntax + +1: If both `CssMinMax` and `FunctionCall` could be consumed, `CssMinMax` + takes precedence. + +2: `FunctionCall` may not have any whitespace between the `NamespacedIdentifier` + and the `ArgumentInvocation`. It may not start with [`SpecialFunctionName`], + `'calc('`, or `'clamp('` (case-insensitively). + +[`SpecialFunctionName`]: #specialfunctionexpression +
 **FunctionCall** ::= [NamespacedIdentifier][] ArgumentInvocation
 
diff --git a/spec/syntax.md b/spec/syntax.md index bc53695e1d..42569d0b5b 100644 --- a/spec/syntax.md +++ b/spec/syntax.md @@ -9,6 +9,7 @@ * [`InterpolatedIdentifier`](#interpolatedidentifier) * [`InterpolatedUrl`](#interpolatedurl) * [`Name`](#name) + * [`FunctionExpression`](#functionexpression) * [`SpecialFunctionExpression`](#specialfunctionexpression) * [`PseudoSelector`](#pseudoselector) * [Procedures](#procedures) @@ -71,6 +72,8 @@ No whitespace is allowed between components of an `InterpolatedUnquotedUrlConten [identifier code point]: https://drafts.csswg.org/css-syntax-3/#identifier-code-point [escape]: https://drafts.csswg.org/css-syntax-3/#escape-diagram +### `FunctionExpression` + ### `SpecialFunctionExpression` > These functions are "special" in the sense that their arguments don't use the diff --git a/spec/types/calculation.md b/spec/types/calculation.md index ef95681b4b..d76e92cc7e 100644 --- a/spec/types/calculation.md +++ b/spec/types/calculation.md @@ -4,7 +4,7 @@ * [Syntax](#syntax) * [`CalculationExpression`](#calculationexpression) - * [`MinMaxExpression`](#minmaxexpression) + * [`CssMinMax`](#cssminmax) * [Types](#types) * [Operations](#operations) * [Equality](#equality) @@ -18,7 +18,7 @@ * [Semantics](#semantics) * [`CalcExpression`](#calcexpression) * [`ClampExpression`](#clampexpression) - * [`CssMinMax`](#cssminmax) + * [`CssMinMax`](#cssminmax-1) * [`CalcArgument`](#calcargument) * [`CalcSum`](#calcsum) * [`CalcProduct`](#calcproduct) @@ -73,21 +73,13 @@ case-insensitively. > expression regardless of syntax, for full compatibility it's necessary to > parse it very expansively. -### `MinMaxExpression` - -This production is parsed in a SassScript context when an expression is expected -and the input stream starts with an identifier with value `min` or `max` -(ignoring case) followed immediately by `(`. +### `CssMinMax`
-**MinMaxExpression**¹ ::= CssMinMax | FunctionExpression
-**CssMinMax**         ::= ('min(' | 'max(')² CalcArgument (',' CalcArgument)* ')'
+**CssMinMax**         ::= ('min(' | 'max(')¹ CalcArgument (',' CalcArgument)* ')'
 
-1: If both `CssMinMax` and `FunctionExpression` could be consumed, `CssMinMax` - takes precedence. - -2: The strings `min(` and `max(` are matched case-insensitively. +1: The strings `min(` and `max(` are matched case-insensitively. ## Types