sass 1.59.3 → 1.60.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/sass.dart.js +414 -218
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"sass","description":"A pure JavaScript implementation of Sass.","license":"MIT","bugs":"https://github.com/sass/dart-sass/issues","homepage":"https://github.com/sass/dart-sass","repository":{"type":"git","url":"https://github.com/sass/dart-sass"},"author":{"name":"Natalie Weizenbaum","email":"nweiz@google.com","url":"https://github.com/nex3"},"engines":{"node":">=12.0.0"},"dependencies":{"chokidar":">=3.0.0 <4.0.0","immutable":"^4.0.0","source-map-js":">=0.6.2 <2.0.0"},"keywords":["style","scss","sass","preprocessor","css"],"types":"types/index.d.ts","exports":{"types":"./types/index.d.ts","default":"./sass.default.js"},"version":"1.59.3","bin":{"sass":"sass.js"},"main":"sass.default.js"}
1
+ {"name":"sass","description":"A pure JavaScript implementation of Sass.","license":"MIT","bugs":"https://github.com/sass/dart-sass/issues","homepage":"https://github.com/sass/dart-sass","repository":{"type":"git","url":"https://github.com/sass/dart-sass"},"author":{"name":"Natalie Weizenbaum","email":"nweiz@google.com","url":"https://github.com/nex3"},"engines":{"node":">=12.0.0"},"dependencies":{"chokidar":">=3.0.0 <4.0.0","immutable":"^4.0.0","source-map-js":">=0.6.2 <2.0.0"},"keywords":["style","scss","sass","preprocessor","css"],"types":"types/index.d.ts","exports":{"types":"./types/index.d.ts","default":"./sass.default.js"},"version":"1.60.0","bin":{"sass":"sass.js"},"main":"sass.default.js"}
package/sass.dart.js CHANGED
@@ -115,7 +115,7 @@ self.readline = _cliPkgRequires.readline;
115
115
  self.immutable = _cliPkgRequires.immutable;
116
116
  self.util = _cliPkgRequires.util;
117
117
  self.fs = _cliPkgRequires.fs;
118
- // Generated by dart2js (NullSafetyMode.sound, trust primitives, omit checks, lax runtime type, csp, deferred-serialization, intern-composite-values), the Dart to JavaScript compiler version: 2.19.4.
118
+ // Generated by dart2js (NullSafetyMode.sound, trust primitives, omit checks, lax runtime type, csp, deferred-serialization, intern-composite-values), the Dart to JavaScript compiler version: 2.19.5.
119
119
  // The code supports the following hooks:
120
120
  // dartPrint(message):
121
121
  // if this function is defined it is called instead of the Dart [print]
@@ -21486,7 +21486,7 @@ self.fs = _cliPkgRequires.fs;
21486
21486
  J.set$sassFalse$x(self.exports, B.SassBoolean_false0);
21487
21487
  J.set$Exception$x(self.exports, $.$get$exceptionClass());
21488
21488
  J.set$Logger$x(self.exports, {silent: {warn: A.allowInteropNamed("sass.Logger.silent.warn", new A.main_closure0()), debug: A.allowInteropNamed("sass.Logger.silent.debug", new A.main_closure1())}});
21489
- J.set$info$x(self.exports, "dart-sass\t1.59.3\t(Sass Compiler)\t[Dart]\ndart2js\t2.19.4\t(Dart Compiler)\t[Dart]");
21489
+ J.set$info$x(self.exports, "dart-sass\t1.60.0\t(Sass Compiler)\t[Dart]\ndart2js\t2.19.5\t(Dart Compiler)\t[Dart]");
21490
21490
  A.updateSourceSpanPrototype();
21491
21491
  J.set$render$x(self.exports, A.allowInteropNamed("sass.render", A.legacy__render$closure()));
21492
21492
  J.set$renderSync$x(self.exports, A.allowInteropNamed("sass.renderSync", A.legacy__renderSync$closure()));
@@ -22183,7 +22183,7 @@ self.fs = _cliPkgRequires.fs;
22183
22183
  switch ($async$goto) {
22184
22184
  case 0:
22185
22185
  // Function start
22186
- $async$returnValue = "1.59.3 compiled with dart2js 2.19.4";
22186
+ $async$returnValue = "1.60.0 compiled with dart2js 2.19.5";
22187
22187
  // goto return
22188
22188
  $async$goto = 1;
22189
22189
  break;
@@ -41914,7 +41914,7 @@ self.fs = _cliPkgRequires.fs;
41914
41914
  else
41915
41915
  try {
41916
41916
  argVersion = A.Version_Version$parse(id);
41917
- sassVersion = A.Version_Version$parse("1.59.3");
41917
+ sassVersion = A.Version_Version$parse("1.60.0");
41918
41918
  if (J.compareTo$1$ns(argVersion, sassVersion) > 0)
41919
41919
  A.ExecutableOptions__fail("Invalid version " + A.S(argVersion) + ". --fatal-deprecation requires a version less than or equal to the current Dart Sass version.");
41920
41920
  J.addAll$1$ax(deprecations, A.Deprecation_forVersion(argVersion));
@@ -50783,7 +50783,7 @@ self.fs = _cliPkgRequires.fs;
50783
50783
  var t2, value, start, ident, lowerCase, calculation, _this = this,
50784
50784
  t1 = _this.scanner,
50785
50785
  next = t1.peekChar$0();
50786
- if (next === 43 || next === 45 || next === 46 || A.isDigit(next))
50786
+ if (next === 43 || next === 46 || A.isDigit(next))
50787
50787
  return _this._number$0();
50788
50788
  else if (next === 36)
50789
50789
  return _this._variable$0();
@@ -50798,15 +50798,13 @@ self.fs = _cliPkgRequires.fs;
50798
50798
  _this.whitespace$0();
50799
50799
  t1.expectChar$1(41);
50800
50800
  return new A.ParenthesizedExpression(value, t1.spanFrom$1(new A._SpanScannerState(t1, t2)));
50801
- } else if (!_this.lookingAtIdentifier$0())
50802
- t1.error$1(0, string$.Expectn);
50803
- else {
50801
+ } else if (_this.lookingAtIdentifier$0()) {
50804
50802
  start = new A._SpanScannerState(t1, t1._string_scanner$_position);
50805
50803
  ident = _this.identifier$0();
50806
50804
  if (t1.scanChar$1(46))
50807
50805
  return _this.namespacedExpression$2(ident, start);
50808
50806
  if (t1.peekChar$0() !== 40)
50809
- t1.error$1(0, 'Expected "(" or ".".');
50807
+ return new A.StringExpression(A.Interpolation$(A._setArrayType([ident], type$.JSArray_Object), t1.spanFrom$1(start)), false);
50810
50808
  lowerCase = ident.toLowerCase();
50811
50809
  calculation = _this._tryCalculation$2(lowerCase, start);
50812
50810
  if (calculation != null)
@@ -50815,7 +50813,10 @@ self.fs = _cliPkgRequires.fs;
50815
50813
  return new A.IfExpression(_this._argumentInvocation$0(), t1.spanFrom$1(start));
50816
50814
  else
50817
50815
  return new A.FunctionExpression(null, ident, _this._argumentInvocation$0(), t1.spanFrom$1(start));
50818
- }
50816
+ } else if (next === 45)
50817
+ return _this._number$0();
50818
+ else
50819
+ t1.error$1(0, string$.Expectn);
50819
50820
  },
50820
50821
  _containsCalculationInterpolation$0() {
50821
50822
  var t2, parens, next, target, t3, _null = null,
@@ -53145,14 +53146,7 @@ self.fs = _cliPkgRequires.fs;
53145
53146
  return true;
53146
53147
  },
53147
53148
  accept$1$1(visitor) {
53148
- var t2,
53149
- t1 = visitor._serialize$_buffer;
53150
- t1.write$1(0, this.name);
53151
- t1.writeCharCode$1(40);
53152
- t2 = visitor._style === B.OutputStyle_1 ? "," : ", ";
53153
- visitor._writeBetween$3(this.$arguments, t2, visitor.get$_writeCalculationValue());
53154
- t1.writeCharCode$1(41);
53155
- return null;
53149
+ return visitor.visitCalculation$1(this);
53156
53150
  },
53157
53151
  accept$1(visitor) {
53158
53152
  return this.accept$1$1(visitor, type$.dynamic);
@@ -57098,100 +57092,141 @@ self.fs = _cliPkgRequires.fs;
57098
57092
  _visitCalculationValue$body$_EvaluateVisitor(node, inMinMax) {
57099
57093
  var $async$goto = 0,
57100
57094
  $async$completer = A._makeAsyncAwaitCompleter(type$.Object),
57101
- $async$returnValue, $async$self = this, inner, result, t1, $async$temp1;
57095
+ $async$returnValue, $async$self = this, inner, result, t1, text, $async$temp1;
57102
57096
  var $async$_async_evaluate$_visitCalculationValue$2$inMinMax = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) {
57103
57097
  if ($async$errorCode === 1)
57104
57098
  return A._asyncRethrow($async$result, $async$completer);
57105
57099
  while (true)
57106
- switch ($async$goto) {
57107
- case 0:
57108
- // Function start
57109
- $async$goto = node instanceof A.ParenthesizedExpression ? 3 : 5;
57110
- break;
57111
- case 3:
57112
- // then
57113
- inner = node.expression;
57114
- $async$goto = 6;
57115
- return A._asyncAwait($async$self._async_evaluate$_visitCalculationValue$2$inMinMax(inner, inMinMax), $async$_async_evaluate$_visitCalculationValue$2$inMinMax);
57116
- case 6:
57117
- // returning from await.
57118
- result = $async$result;
57119
- if (inner instanceof A.FunctionExpression)
57120
- t1 = A.stringReplaceAllUnchecked(inner.originalName, "_", "-").toLowerCase() === "var" && result instanceof A.SassString && !result._hasQuotes;
57121
- else
57122
- t1 = false;
57123
- $async$returnValue = t1 ? new A.SassString("(" + result._string$_text + ")", false) : result;
57124
- // goto return
57125
- $async$goto = 1;
57126
- break;
57127
- // goto join
57128
- $async$goto = 4;
57129
- break;
57130
- case 5:
57131
- // else
57132
- $async$goto = node instanceof A.StringExpression ? 7 : 9;
57133
- break;
57134
- case 7:
57135
- // then
57136
- $async$temp1 = A;
57137
- $async$goto = 10;
57138
- return A._asyncAwait($async$self._async_evaluate$_performInterpolation$1(node.text), $async$_async_evaluate$_visitCalculationValue$2$inMinMax);
57139
- case 10:
57140
- // returning from await.
57141
- $async$returnValue = new $async$temp1.CalculationInterpolation($async$result);
57142
- // goto return
57143
- $async$goto = 1;
57144
- break;
57145
- // goto join
57146
- $async$goto = 8;
57147
- break;
57148
- case 9:
57149
- // else
57150
- $async$goto = node instanceof A.BinaryOperationExpression ? 11 : 13;
57151
- break;
57152
- case 11:
57153
- // then
57154
- $async$goto = 14;
57155
- return A._asyncAwait($async$self._addExceptionSpanAsync$1$2(node, new A._EvaluateVisitor__visitCalculationValue_closure0($async$self, node, inMinMax), type$.Object), $async$_async_evaluate$_visitCalculationValue$2$inMinMax);
57156
- case 14:
57157
- // returning from await.
57158
- $async$returnValue = $async$result;
57159
- // goto return
57160
- $async$goto = 1;
57161
- break;
57162
- // goto join
57163
- $async$goto = 12;
57164
- break;
57165
- case 13:
57166
- // else
57167
- $async$goto = 15;
57168
- return A._asyncAwait(node.accept$1($async$self), $async$_async_evaluate$_visitCalculationValue$2$inMinMax);
57169
- case 15:
57170
- // returning from await.
57171
- result = $async$result;
57172
- if (result instanceof A.SassNumber || result instanceof A.SassCalculation) {
57173
- $async$returnValue = result;
57100
+ $async$outer:
57101
+ switch ($async$goto) {
57102
+ case 0:
57103
+ // Function start
57104
+ $async$goto = node instanceof A.ParenthesizedExpression ? 3 : 5;
57105
+ break;
57106
+ case 3:
57107
+ // then
57108
+ inner = node.expression;
57109
+ $async$goto = 6;
57110
+ return A._asyncAwait($async$self._async_evaluate$_visitCalculationValue$2$inMinMax(inner, inMinMax), $async$_async_evaluate$_visitCalculationValue$2$inMinMax);
57111
+ case 6:
57112
+ // returning from await.
57113
+ result = $async$result;
57114
+ if (inner instanceof A.FunctionExpression)
57115
+ t1 = A.stringReplaceAllUnchecked(inner.originalName, "_", "-").toLowerCase() === "var" && result instanceof A.SassString && !result._hasQuotes;
57116
+ else
57117
+ t1 = false;
57118
+ $async$returnValue = t1 ? new A.SassString("(" + result._string$_text + ")", false) : result;
57174
57119
  // goto return
57175
57120
  $async$goto = 1;
57176
57121
  break;
57177
- }
57178
- if (result instanceof A.SassString && !result._hasQuotes) {
57179
- $async$returnValue = result;
57122
+ // goto join
57123
+ $async$goto = 4;
57124
+ break;
57125
+ case 5:
57126
+ // else
57127
+ $async$goto = node instanceof A.StringExpression ? 7 : 9;
57128
+ break;
57129
+ case 7:
57130
+ // then
57131
+ t1 = node.text;
57132
+ text = t1.get$asPlain();
57133
+ $async$goto = text == null ? 10 : 11;
57134
+ break;
57135
+ case 10:
57136
+ // then
57137
+ $async$temp1 = A;
57138
+ $async$goto = 12;
57139
+ return A._asyncAwait($async$self._async_evaluate$_performInterpolation$1(t1), $async$_async_evaluate$_visitCalculationValue$2$inMinMax);
57140
+ case 12:
57141
+ // returning from await.
57142
+ $async$returnValue = new $async$temp1.CalculationInterpolation($async$result);
57180
57143
  // goto return
57181
57144
  $async$goto = 1;
57182
57145
  break;
57183
- }
57184
- throw A.wrapException($async$self._async_evaluate$_exception$2("Value " + result.toString$0(0) + " can't be used in a calculation.", node.get$span(node)));
57185
- case 12:
57186
- // join
57187
- case 8:
57188
- // join
57189
- case 4:
57190
- // join
57191
- case 1:
57192
- // return
57193
- return A._asyncReturn($async$returnValue, $async$completer);
57194
- }
57146
+ case 11:
57147
+ // join
57148
+ switch (text.toLowerCase()) {
57149
+ case "pi":
57150
+ $async$returnValue = A.SassNumber_SassNumber(3.141592653589793, null);
57151
+ // goto return
57152
+ $async$goto = 1;
57153
+ break $async$outer;
57154
+ case "e":
57155
+ $async$returnValue = A.SassNumber_SassNumber(2.718281828459045, null);
57156
+ // goto return
57157
+ $async$goto = 1;
57158
+ break $async$outer;
57159
+ case "infinity":
57160
+ $async$returnValue = A.SassNumber_SassNumber(1 / 0, null);
57161
+ // goto return
57162
+ $async$goto = 1;
57163
+ break $async$outer;
57164
+ case "-infinity":
57165
+ $async$returnValue = A.SassNumber_SassNumber(-1 / 0, null);
57166
+ // goto return
57167
+ $async$goto = 1;
57168
+ break $async$outer;
57169
+ case "nan":
57170
+ $async$returnValue = A.SassNumber_SassNumber(0 / 0, null);
57171
+ // goto return
57172
+ $async$goto = 1;
57173
+ break $async$outer;
57174
+ default:
57175
+ $async$returnValue = new A.SassString(text, false);
57176
+ // goto return
57177
+ $async$goto = 1;
57178
+ break $async$outer;
57179
+ }
57180
+ // goto join
57181
+ $async$goto = 8;
57182
+ break;
57183
+ case 9:
57184
+ // else
57185
+ $async$goto = node instanceof A.BinaryOperationExpression ? 13 : 15;
57186
+ break;
57187
+ case 13:
57188
+ // then
57189
+ $async$goto = 16;
57190
+ return A._asyncAwait($async$self._addExceptionSpanAsync$1$2(node, new A._EvaluateVisitor__visitCalculationValue_closure0($async$self, node, inMinMax), type$.Object), $async$_async_evaluate$_visitCalculationValue$2$inMinMax);
57191
+ case 16:
57192
+ // returning from await.
57193
+ $async$returnValue = $async$result;
57194
+ // goto return
57195
+ $async$goto = 1;
57196
+ break;
57197
+ // goto join
57198
+ $async$goto = 14;
57199
+ break;
57200
+ case 15:
57201
+ // else
57202
+ $async$goto = 17;
57203
+ return A._asyncAwait(node.accept$1($async$self), $async$_async_evaluate$_visitCalculationValue$2$inMinMax);
57204
+ case 17:
57205
+ // returning from await.
57206
+ result = $async$result;
57207
+ if (result instanceof A.SassNumber || result instanceof A.SassCalculation) {
57208
+ $async$returnValue = result;
57209
+ // goto return
57210
+ $async$goto = 1;
57211
+ break;
57212
+ }
57213
+ if (result instanceof A.SassString && !result._hasQuotes) {
57214
+ $async$returnValue = result;
57215
+ // goto return
57216
+ $async$goto = 1;
57217
+ break;
57218
+ }
57219
+ throw A.wrapException($async$self._async_evaluate$_exception$2("Value " + result.toString$0(0) + " can't be used in a calculation.", node.get$span(node)));
57220
+ case 14:
57221
+ // join
57222
+ case 8:
57223
+ // join
57224
+ case 4:
57225
+ // join
57226
+ case 1:
57227
+ // return
57228
+ return A._asyncReturn($async$returnValue, $async$completer);
57229
+ }
57195
57230
  });
57196
57231
  return A._asyncStartSync($async$_async_evaluate$_visitCalculationValue$2$inMinMax, $async$completer);
57197
57232
  },
@@ -63370,7 +63405,7 @@ self.fs = _cliPkgRequires.fs;
63370
63405
  }
63371
63406
  },
63372
63407
  _visitCalculationValue$2$inMinMax(node, inMinMax) {
63373
- var inner, result, t1, _this = this;
63408
+ var inner, result, t1, text, _this = this, _null = null;
63374
63409
  if (node instanceof A.ParenthesizedExpression) {
63375
63410
  inner = node.expression;
63376
63411
  result = _this._visitCalculationValue$2$inMinMax(inner, inMinMax);
@@ -63379,9 +63414,26 @@ self.fs = _cliPkgRequires.fs;
63379
63414
  else
63380
63415
  t1 = false;
63381
63416
  return t1 ? new A.SassString("(" + result._string$_text + ")", false) : result;
63382
- } else if (node instanceof A.StringExpression)
63383
- return new A.CalculationInterpolation(_this._performInterpolation$1(node.text));
63384
- else if (node instanceof A.BinaryOperationExpression)
63417
+ } else if (node instanceof A.StringExpression) {
63418
+ t1 = node.text;
63419
+ text = t1.get$asPlain();
63420
+ if (text == null)
63421
+ return new A.CalculationInterpolation(_this._performInterpolation$1(t1));
63422
+ switch (text.toLowerCase()) {
63423
+ case "pi":
63424
+ return A.SassNumber_SassNumber(3.141592653589793, _null);
63425
+ case "e":
63426
+ return A.SassNumber_SassNumber(2.718281828459045, _null);
63427
+ case "infinity":
63428
+ return A.SassNumber_SassNumber(1 / 0, _null);
63429
+ case "-infinity":
63430
+ return A.SassNumber_SassNumber(-1 / 0, _null);
63431
+ case "nan":
63432
+ return A.SassNumber_SassNumber(0 / 0, _null);
63433
+ default:
63434
+ return new A.SassString(text, false);
63435
+ }
63436
+ } else if (node instanceof A.BinaryOperationExpression)
63385
63437
  return _this._addExceptionSpan$2(node, new A._EvaluateVisitor__visitCalculationValue_closure(_this, node, inMinMax));
63386
63438
  else {
63387
63439
  result = node.accept$1(_this);
@@ -66377,9 +66429,46 @@ self.fs = _cliPkgRequires.fs;
66377
66429
  }
66378
66430
  }
66379
66431
  },
66432
+ visitCalculation$1(value) {
66433
+ var t2, _this = this,
66434
+ t1 = _this._serialize$_buffer;
66435
+ t1.write$1(0, value.name);
66436
+ t1.writeCharCode$1(40);
66437
+ t2 = _this._style === B.OutputStyle_1 ? "," : ", ";
66438
+ _this._writeBetween$3(value.$arguments, t2, _this.get$_writeCalculationValue());
66439
+ t1.writeCharCode$1(41);
66440
+ },
66380
66441
  _writeCalculationValue$1(value) {
66381
- var left, parenthesizeLeft, operatorWhitespace, t1, t2, right, parenthesizeRight, _this = this;
66382
- if (value instanceof A.Value)
66442
+ var t1, t2, unit, left, parenthesizeLeft, operatorWhitespace, right, parenthesizeRight, _this = this;
66443
+ if (value instanceof A.SassNumber && !isFinite(value._number$_value)) {
66444
+ t1 = J.getInterceptor$x(value);
66445
+ if (t1.get$numeratorUnits(value).length > 1 || t1.get$denominatorUnits(value).length !== 0) {
66446
+ if (!_this._inspect)
66447
+ throw A.wrapException(A.SassScriptException$(A.S(value) + " isn't a valid CSS value.", null));
66448
+ _this._writeNumber$1(value._number$_value);
66449
+ _this._serialize$_buffer.write$1(0, value.get$unitString());
66450
+ return;
66451
+ }
66452
+ t2 = value._number$_value;
66453
+ if (t2 === 1 / 0)
66454
+ _this._serialize$_buffer.write$1(0, "infinity");
66455
+ else if (t2 === -1 / 0)
66456
+ _this._serialize$_buffer.write$1(0, "-infinity");
66457
+ else if (isNaN(t2))
66458
+ _this._serialize$_buffer.write$1(0, "NaN");
66459
+ unit = A.IterableExtension_get_firstOrNull(t1.get$numeratorUnits(value));
66460
+ if (unit != null) {
66461
+ t1 = _this._style !== B.OutputStyle_1;
66462
+ if (t1)
66463
+ _this._serialize$_buffer.writeCharCode$1(32);
66464
+ t2 = _this._serialize$_buffer;
66465
+ t2.writeCharCode$1(42);
66466
+ if (t1)
66467
+ t2.writeCharCode$1(32);
66468
+ t2.writeCharCode$1(49);
66469
+ t2.write$1(0, unit);
66470
+ }
66471
+ } else if (value instanceof A.Value)
66383
66472
  value.accept$1(_this);
66384
66473
  else if (value instanceof A.CalculationInterpolation)
66385
66474
  _this._serialize$_buffer.write$1(0, value.value);
@@ -66404,7 +66493,11 @@ self.fs = _cliPkgRequires.fs;
66404
66493
  t1.writeCharCode$1(32);
66405
66494
  right = value.right;
66406
66495
  if (!(right instanceof A.CalculationInterpolation))
66407
- parenthesizeRight = right instanceof A.CalculationOperation && _this._parenthesizeCalculationRhs$2(t2, right.operator);
66496
+ if (!(right instanceof A.CalculationOperation && _this._parenthesizeCalculationRhs$2(t2, right.operator))) {
66497
+ t2 = t2 === B.CalculationOperator_OvN && right instanceof A.SassNumber && !isFinite(right._number$_value) && right.get$hasUnits();
66498
+ parenthesizeRight = t2;
66499
+ } else
66500
+ parenthesizeRight = true;
66408
66501
  else
66409
66502
  parenthesizeRight = true;
66410
66503
  if (parenthesizeRight)
@@ -66544,7 +66637,7 @@ self.fs = _cliPkgRequires.fs;
66544
66637
  this._serialize$_buffer.writeCharCode$1(41);
66545
66638
  },
66546
66639
  visitNumber$1(value) {
66547
- var _this = this,
66640
+ var t1, _this = this,
66548
66641
  asSlash = value.asSlash;
66549
66642
  if (asSlash != null) {
66550
66643
  _this.visitNumber$1(asSlash.item1);
@@ -66552,7 +66645,12 @@ self.fs = _cliPkgRequires.fs;
66552
66645
  _this.visitNumber$1(asSlash.item2);
66553
66646
  return;
66554
66647
  }
66555
- _this._writeNumber$1(value._number$_value);
66648
+ t1 = value._number$_value;
66649
+ if (!isFinite(t1)) {
66650
+ _this.visitCalculation$1(new A.SassCalculation("calc", A.List_List$unmodifiable(A._setArrayType([value], type$.JSArray_Object), type$.Object)));
66651
+ return;
66652
+ }
66653
+ _this._writeNumber$1(t1);
66556
66654
  if (!_this._inspect) {
66557
66655
  if (value.get$numeratorUnits(value).length > 1 || value.get$denominatorUnits(value).length !== 0)
66558
66656
  throw A.wrapException(A.SassScriptException$(value.toString$0(0) + " isn't a valid CSS value.", null));
@@ -73307,100 +73405,141 @@ self.fs = _cliPkgRequires.fs;
73307
73405
  _visitCalculationValue$body$_EvaluateVisitor0(node, inMinMax) {
73308
73406
  var $async$goto = 0,
73309
73407
  $async$completer = A._makeAsyncAwaitCompleter(type$.Object),
73310
- $async$returnValue, $async$self = this, inner, result, t1, $async$temp1;
73408
+ $async$returnValue, $async$self = this, inner, result, t1, text, $async$temp1;
73311
73409
  var $async$_async_evaluate0$_visitCalculationValue$2$inMinMax = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) {
73312
73410
  if ($async$errorCode === 1)
73313
73411
  return A._asyncRethrow($async$result, $async$completer);
73314
73412
  while (true)
73315
- switch ($async$goto) {
73316
- case 0:
73317
- // Function start
73318
- $async$goto = node instanceof A.ParenthesizedExpression0 ? 3 : 5;
73319
- break;
73320
- case 3:
73321
- // then
73322
- inner = node.expression;
73323
- $async$goto = 6;
73324
- return A._asyncAwait($async$self._async_evaluate0$_visitCalculationValue$2$inMinMax(inner, inMinMax), $async$_async_evaluate0$_visitCalculationValue$2$inMinMax);
73325
- case 6:
73326
- // returning from await.
73327
- result = $async$result;
73328
- if (inner instanceof A.FunctionExpression0)
73329
- t1 = A.stringReplaceAllUnchecked(inner.originalName, "_", "-").toLowerCase() === "var" && result instanceof A.SassString0 && !result._string0$_hasQuotes;
73330
- else
73331
- t1 = false;
73332
- $async$returnValue = t1 ? new A.SassString0("(" + result._string0$_text + ")", false) : result;
73333
- // goto return
73334
- $async$goto = 1;
73335
- break;
73336
- // goto join
73337
- $async$goto = 4;
73338
- break;
73339
- case 5:
73340
- // else
73341
- $async$goto = node instanceof A.StringExpression0 ? 7 : 9;
73342
- break;
73343
- case 7:
73344
- // then
73345
- $async$temp1 = A;
73346
- $async$goto = 10;
73347
- return A._asyncAwait($async$self._async_evaluate0$_performInterpolation$1(node.text), $async$_async_evaluate0$_visitCalculationValue$2$inMinMax);
73348
- case 10:
73349
- // returning from await.
73350
- $async$returnValue = new $async$temp1.CalculationInterpolation0($async$result);
73351
- // goto return
73352
- $async$goto = 1;
73353
- break;
73354
- // goto join
73355
- $async$goto = 8;
73356
- break;
73357
- case 9:
73358
- // else
73359
- $async$goto = node instanceof A.BinaryOperationExpression0 ? 11 : 13;
73360
- break;
73361
- case 11:
73362
- // then
73363
- $async$goto = 14;
73364
- return A._asyncAwait($async$self._async_evaluate0$_addExceptionSpanAsync$1$2(node, new A._EvaluateVisitor__visitCalculationValue_closure2($async$self, node, inMinMax), type$.Object), $async$_async_evaluate0$_visitCalculationValue$2$inMinMax);
73365
- case 14:
73366
- // returning from await.
73367
- $async$returnValue = $async$result;
73368
- // goto return
73369
- $async$goto = 1;
73370
- break;
73371
- // goto join
73372
- $async$goto = 12;
73373
- break;
73374
- case 13:
73375
- // else
73376
- $async$goto = 15;
73377
- return A._asyncAwait(node.accept$1($async$self), $async$_async_evaluate0$_visitCalculationValue$2$inMinMax);
73378
- case 15:
73379
- // returning from await.
73380
- result = $async$result;
73381
- if (result instanceof A.SassNumber0 || result instanceof A.SassCalculation0) {
73382
- $async$returnValue = result;
73413
+ $async$outer:
73414
+ switch ($async$goto) {
73415
+ case 0:
73416
+ // Function start
73417
+ $async$goto = node instanceof A.ParenthesizedExpression0 ? 3 : 5;
73418
+ break;
73419
+ case 3:
73420
+ // then
73421
+ inner = node.expression;
73422
+ $async$goto = 6;
73423
+ return A._asyncAwait($async$self._async_evaluate0$_visitCalculationValue$2$inMinMax(inner, inMinMax), $async$_async_evaluate0$_visitCalculationValue$2$inMinMax);
73424
+ case 6:
73425
+ // returning from await.
73426
+ result = $async$result;
73427
+ if (inner instanceof A.FunctionExpression0)
73428
+ t1 = A.stringReplaceAllUnchecked(inner.originalName, "_", "-").toLowerCase() === "var" && result instanceof A.SassString0 && !result._string0$_hasQuotes;
73429
+ else
73430
+ t1 = false;
73431
+ $async$returnValue = t1 ? new A.SassString0("(" + result._string0$_text + ")", false) : result;
73383
73432
  // goto return
73384
73433
  $async$goto = 1;
73385
73434
  break;
73386
- }
73387
- if (result instanceof A.SassString0 && !result._string0$_hasQuotes) {
73388
- $async$returnValue = result;
73435
+ // goto join
73436
+ $async$goto = 4;
73437
+ break;
73438
+ case 5:
73439
+ // else
73440
+ $async$goto = node instanceof A.StringExpression0 ? 7 : 9;
73441
+ break;
73442
+ case 7:
73443
+ // then
73444
+ t1 = node.text;
73445
+ text = t1.get$asPlain();
73446
+ $async$goto = text == null ? 10 : 11;
73447
+ break;
73448
+ case 10:
73449
+ // then
73450
+ $async$temp1 = A;
73451
+ $async$goto = 12;
73452
+ return A._asyncAwait($async$self._async_evaluate0$_performInterpolation$1(t1), $async$_async_evaluate0$_visitCalculationValue$2$inMinMax);
73453
+ case 12:
73454
+ // returning from await.
73455
+ $async$returnValue = new $async$temp1.CalculationInterpolation0($async$result);
73389
73456
  // goto return
73390
73457
  $async$goto = 1;
73391
73458
  break;
73392
- }
73393
- throw A.wrapException($async$self._async_evaluate0$_exception$2("Value " + result.toString$0(0) + " can't be used in a calculation.", node.get$span(node)));
73394
- case 12:
73395
- // join
73396
- case 8:
73397
- // join
73398
- case 4:
73399
- // join
73400
- case 1:
73401
- // return
73402
- return A._asyncReturn($async$returnValue, $async$completer);
73403
- }
73459
+ case 11:
73460
+ // join
73461
+ switch (text.toLowerCase()) {
73462
+ case "pi":
73463
+ $async$returnValue = A.SassNumber_SassNumber0(3.141592653589793, null);
73464
+ // goto return
73465
+ $async$goto = 1;
73466
+ break $async$outer;
73467
+ case "e":
73468
+ $async$returnValue = A.SassNumber_SassNumber0(2.718281828459045, null);
73469
+ // goto return
73470
+ $async$goto = 1;
73471
+ break $async$outer;
73472
+ case "infinity":
73473
+ $async$returnValue = A.SassNumber_SassNumber0(1 / 0, null);
73474
+ // goto return
73475
+ $async$goto = 1;
73476
+ break $async$outer;
73477
+ case "-infinity":
73478
+ $async$returnValue = A.SassNumber_SassNumber0(-1 / 0, null);
73479
+ // goto return
73480
+ $async$goto = 1;
73481
+ break $async$outer;
73482
+ case "nan":
73483
+ $async$returnValue = A.SassNumber_SassNumber0(0 / 0, null);
73484
+ // goto return
73485
+ $async$goto = 1;
73486
+ break $async$outer;
73487
+ default:
73488
+ $async$returnValue = new A.SassString0(text, false);
73489
+ // goto return
73490
+ $async$goto = 1;
73491
+ break $async$outer;
73492
+ }
73493
+ // goto join
73494
+ $async$goto = 8;
73495
+ break;
73496
+ case 9:
73497
+ // else
73498
+ $async$goto = node instanceof A.BinaryOperationExpression0 ? 13 : 15;
73499
+ break;
73500
+ case 13:
73501
+ // then
73502
+ $async$goto = 16;
73503
+ return A._asyncAwait($async$self._async_evaluate0$_addExceptionSpanAsync$1$2(node, new A._EvaluateVisitor__visitCalculationValue_closure2($async$self, node, inMinMax), type$.Object), $async$_async_evaluate0$_visitCalculationValue$2$inMinMax);
73504
+ case 16:
73505
+ // returning from await.
73506
+ $async$returnValue = $async$result;
73507
+ // goto return
73508
+ $async$goto = 1;
73509
+ break;
73510
+ // goto join
73511
+ $async$goto = 14;
73512
+ break;
73513
+ case 15:
73514
+ // else
73515
+ $async$goto = 17;
73516
+ return A._asyncAwait(node.accept$1($async$self), $async$_async_evaluate0$_visitCalculationValue$2$inMinMax);
73517
+ case 17:
73518
+ // returning from await.
73519
+ result = $async$result;
73520
+ if (result instanceof A.SassNumber0 || result instanceof A.SassCalculation0) {
73521
+ $async$returnValue = result;
73522
+ // goto return
73523
+ $async$goto = 1;
73524
+ break;
73525
+ }
73526
+ if (result instanceof A.SassString0 && !result._string0$_hasQuotes) {
73527
+ $async$returnValue = result;
73528
+ // goto return
73529
+ $async$goto = 1;
73530
+ break;
73531
+ }
73532
+ throw A.wrapException($async$self._async_evaluate0$_exception$2("Value " + result.toString$0(0) + " can't be used in a calculation.", node.get$span(node)));
73533
+ case 14:
73534
+ // join
73535
+ case 8:
73536
+ // join
73537
+ case 4:
73538
+ // join
73539
+ case 1:
73540
+ // return
73541
+ return A._asyncReturn($async$returnValue, $async$completer);
73542
+ }
73404
73543
  });
73405
73544
  return A._asyncStartSync($async$_async_evaluate0$_visitCalculationValue$2$inMinMax, $async$completer);
73406
73545
  },
@@ -79242,14 +79381,7 @@ self.fs = _cliPkgRequires.fs;
79242
79381
  return true;
79243
79382
  },
79244
79383
  accept$1$1(visitor) {
79245
- var t2,
79246
- t1 = visitor._serialize0$_buffer;
79247
- t1.write$1(0, this.name);
79248
- t1.writeCharCode$1(40);
79249
- t2 = visitor._serialize0$_style === B.OutputStyle_10 ? "," : ", ";
79250
- visitor._serialize0$_writeBetween$3(this.$arguments, t2, visitor.get$_serialize0$_writeCalculationValue());
79251
- t1.writeCharCode$1(41);
79252
- return null;
79384
+ return visitor.visitCalculation$1(this);
79253
79385
  },
79254
79386
  accept$1(visitor) {
79255
79387
  return this.accept$1$1(visitor, type$.dynamic);
@@ -83059,7 +83191,7 @@ self.fs = _cliPkgRequires.fs;
83059
83191
  }
83060
83192
  },
83061
83193
  _evaluate0$_visitCalculationValue$2$inMinMax(node, inMinMax) {
83062
- var inner, result, t1, _this = this;
83194
+ var inner, result, t1, text, _this = this, _null = null;
83063
83195
  if (node instanceof A.ParenthesizedExpression0) {
83064
83196
  inner = node.expression;
83065
83197
  result = _this._evaluate0$_visitCalculationValue$2$inMinMax(inner, inMinMax);
@@ -83068,9 +83200,26 @@ self.fs = _cliPkgRequires.fs;
83068
83200
  else
83069
83201
  t1 = false;
83070
83202
  return t1 ? new A.SassString0("(" + result._string0$_text + ")", false) : result;
83071
- } else if (node instanceof A.StringExpression0)
83072
- return new A.CalculationInterpolation0(_this._evaluate0$_performInterpolation$1(node.text));
83073
- else if (node instanceof A.BinaryOperationExpression0)
83203
+ } else if (node instanceof A.StringExpression0) {
83204
+ t1 = node.text;
83205
+ text = t1.get$asPlain();
83206
+ if (text == null)
83207
+ return new A.CalculationInterpolation0(_this._evaluate0$_performInterpolation$1(t1));
83208
+ switch (text.toLowerCase()) {
83209
+ case "pi":
83210
+ return A.SassNumber_SassNumber0(3.141592653589793, _null);
83211
+ case "e":
83212
+ return A.SassNumber_SassNumber0(2.718281828459045, _null);
83213
+ case "infinity":
83214
+ return A.SassNumber_SassNumber0(1 / 0, _null);
83215
+ case "-infinity":
83216
+ return A.SassNumber_SassNumber0(-1 / 0, _null);
83217
+ case "nan":
83218
+ return A.SassNumber_SassNumber0(0 / 0, _null);
83219
+ default:
83220
+ return new A.SassString0(text, false);
83221
+ }
83222
+ } else if (node instanceof A.BinaryOperationExpression0)
83074
83223
  return _this._evaluate0$_addExceptionSpan$2(node, new A._EvaluateVisitor__visitCalculationValue_closure1(_this, node, inMinMax));
83075
83224
  else {
83076
83225
  result = node.accept$1(_this);
@@ -94259,9 +94408,46 @@ self.fs = _cliPkgRequires.fs;
94259
94408
  }
94260
94409
  }
94261
94410
  },
94411
+ visitCalculation$1(value) {
94412
+ var t2, _this = this,
94413
+ t1 = _this._serialize0$_buffer;
94414
+ t1.write$1(0, value.name);
94415
+ t1.writeCharCode$1(40);
94416
+ t2 = _this._serialize0$_style === B.OutputStyle_10 ? "," : ", ";
94417
+ _this._serialize0$_writeBetween$3(value.$arguments, t2, _this.get$_serialize0$_writeCalculationValue());
94418
+ t1.writeCharCode$1(41);
94419
+ },
94262
94420
  _serialize0$_writeCalculationValue$1(value) {
94263
- var left, parenthesizeLeft, operatorWhitespace, t1, t2, right, parenthesizeRight, _this = this;
94264
- if (value instanceof A.Value0)
94421
+ var t1, t2, unit, left, parenthesizeLeft, operatorWhitespace, right, parenthesizeRight, _this = this;
94422
+ if (value instanceof A.SassNumber0 && !isFinite(value._number1$_value)) {
94423
+ t1 = J.getInterceptor$x(value);
94424
+ if (t1.get$numeratorUnits(value).length > 1 || t1.get$denominatorUnits(value).length !== 0) {
94425
+ if (!_this._serialize0$_inspect)
94426
+ throw A.wrapException(A.SassScriptException$0(A.S(value) + " isn't a valid CSS value.", null));
94427
+ _this._serialize0$_writeNumber$1(value._number1$_value);
94428
+ _this._serialize0$_buffer.write$1(0, value.get$unitString());
94429
+ return;
94430
+ }
94431
+ t2 = value._number1$_value;
94432
+ if (t2 === 1 / 0)
94433
+ _this._serialize0$_buffer.write$1(0, "infinity");
94434
+ else if (t2 === -1 / 0)
94435
+ _this._serialize0$_buffer.write$1(0, "-infinity");
94436
+ else if (isNaN(t2))
94437
+ _this._serialize0$_buffer.write$1(0, "NaN");
94438
+ unit = A.IterableExtension_get_firstOrNull(t1.get$numeratorUnits(value));
94439
+ if (unit != null) {
94440
+ t1 = _this._serialize0$_style !== B.OutputStyle_10;
94441
+ if (t1)
94442
+ _this._serialize0$_buffer.writeCharCode$1(32);
94443
+ t2 = _this._serialize0$_buffer;
94444
+ t2.writeCharCode$1(42);
94445
+ if (t1)
94446
+ t2.writeCharCode$1(32);
94447
+ t2.writeCharCode$1(49);
94448
+ t2.write$1(0, unit);
94449
+ }
94450
+ } else if (value instanceof A.Value0)
94265
94451
  value.accept$1(_this);
94266
94452
  else if (value instanceof A.CalculationInterpolation0)
94267
94453
  _this._serialize0$_buffer.write$1(0, value.value);
@@ -94286,7 +94472,11 @@ self.fs = _cliPkgRequires.fs;
94286
94472
  t1.writeCharCode$1(32);
94287
94473
  right = value.right;
94288
94474
  if (!(right instanceof A.CalculationInterpolation0))
94289
- parenthesizeRight = right instanceof A.CalculationOperation0 && _this._serialize0$_parenthesizeCalculationRhs$2(t2, right.operator);
94475
+ if (!(right instanceof A.CalculationOperation0 && _this._serialize0$_parenthesizeCalculationRhs$2(t2, right.operator))) {
94476
+ t2 = t2 === B.CalculationOperator_OvN0 && right instanceof A.SassNumber0 && !isFinite(right._number1$_value) && right.get$hasUnits();
94477
+ parenthesizeRight = t2;
94478
+ } else
94479
+ parenthesizeRight = true;
94290
94480
  else
94291
94481
  parenthesizeRight = true;
94292
94482
  if (parenthesizeRight)
@@ -94426,7 +94616,7 @@ self.fs = _cliPkgRequires.fs;
94426
94616
  this._serialize0$_buffer.writeCharCode$1(41);
94427
94617
  },
94428
94618
  visitNumber$1(value) {
94429
- var _this = this,
94619
+ var t1, _this = this,
94430
94620
  asSlash = value.asSlash;
94431
94621
  if (asSlash != null) {
94432
94622
  _this.visitNumber$1(asSlash.item1);
@@ -94434,7 +94624,12 @@ self.fs = _cliPkgRequires.fs;
94434
94624
  _this.visitNumber$1(asSlash.item2);
94435
94625
  return;
94436
94626
  }
94437
- _this._serialize0$_writeNumber$1(value._number1$_value);
94627
+ t1 = value._number1$_value;
94628
+ if (!isFinite(t1)) {
94629
+ _this.visitCalculation$1(new A.SassCalculation0("calc", A.List_List$unmodifiable(A._setArrayType([value], type$.JSArray_Object), type$.Object)));
94630
+ return;
94631
+ }
94632
+ _this._serialize0$_writeNumber$1(t1);
94438
94633
  if (!_this._serialize0$_inspect) {
94439
94634
  if (value.get$numeratorUnits(value).length > 1 || value.get$denominatorUnits(value).length !== 0)
94440
94635
  throw A.wrapException(A.SassScriptException$0(value.toString$0(0) + " isn't a valid CSS value.", null));
@@ -98617,7 +98812,7 @@ self.fs = _cliPkgRequires.fs;
98617
98812
  var t2, value, start, ident, lowerCase, calculation, _this = this,
98618
98813
  t1 = _this.scanner,
98619
98814
  next = t1.peekChar$0();
98620
- if (next === 43 || next === 45 || next === 46 || A.isDigit0(next))
98815
+ if (next === 43 || next === 46 || A.isDigit0(next))
98621
98816
  return _this._stylesheet0$_number$0();
98622
98817
  else if (next === 36)
98623
98818
  return _this._stylesheet0$_variable$0();
@@ -98632,15 +98827,13 @@ self.fs = _cliPkgRequires.fs;
98632
98827
  _this.whitespace$0();
98633
98828
  t1.expectChar$1(41);
98634
98829
  return new A.ParenthesizedExpression0(value, t1.spanFrom$1(new A._SpanScannerState(t1, t2)));
98635
- } else if (!_this.lookingAtIdentifier$0())
98636
- t1.error$1(0, string$.Expectn);
98637
- else {
98830
+ } else if (_this.lookingAtIdentifier$0()) {
98638
98831
  start = new A._SpanScannerState(t1, t1._string_scanner$_position);
98639
98832
  ident = _this.identifier$0();
98640
98833
  if (t1.scanChar$1(46))
98641
98834
  return _this.namespacedExpression$2(ident, start);
98642
98835
  if (t1.peekChar$0() !== 40)
98643
- t1.error$1(0, 'Expected "(" or ".".');
98836
+ return new A.StringExpression0(A.Interpolation$0(A._setArrayType([ident], type$.JSArray_Object), t1.spanFrom$1(start)), false);
98644
98837
  lowerCase = ident.toLowerCase();
98645
98838
  calculation = _this._stylesheet0$_tryCalculation$2(lowerCase, start);
98646
98839
  if (calculation != null)
@@ -98649,7 +98842,10 @@ self.fs = _cliPkgRequires.fs;
98649
98842
  return new A.IfExpression0(_this._stylesheet0$_argumentInvocation$0(), t1.spanFrom$1(start));
98650
98843
  else
98651
98844
  return new A.FunctionExpression0(null, ident, _this._stylesheet0$_argumentInvocation$0(), t1.spanFrom$1(start));
98652
- }
98845
+ } else if (next === 45)
98846
+ return _this._stylesheet0$_number$0();
98847
+ else
98848
+ t1.error$1(0, string$.Expectn);
98653
98849
  },
98654
98850
  _stylesheet0$_containsCalculationInterpolation$0() {
98655
98851
  var t2, parens, next, target, t3, _null = null,