mirror of
https://github.com/danog/dart-sass.git
synced 2024-12-13 01:27:22 +01:00
a25bbb3fc7
This allows us to accurately track the source spans for parenthesized expressions, which in turn allows us to print accurate error indications. Adding a new class for this more accurately represents the structure of the expression, but it also involves an extra allocation during parsing and an extra level of nesting during evaluation which could have a small but real performance impact. We could alternatively add a package-internal setter for Expression.span, and update the source span for parenthesized expressions after they're initially parsed. However, this has its own downsides: it adds complexity and mutability to the object model; and many expression classes currently use lazily-generated spans, so making them settable would require adding extra slots on those classes. I decided to go with the extra class because it only adds overhead when parentheses are actually used in practice, as opposed to adding overhead to every list/color/etc. The runtime overhead is also likely to be mitigated if at any point we add a constant-folding step. |
||
---|---|---|
.. | ||
cli | ||
dart_api | ||
node_api | ||
compressed_test.dart | ||
dart_api_test.dart | ||
ensure_npm_package.dart | ||
hybrid.dart | ||
io.dart | ||
node_api_test.dart | ||
source_map_test.dart | ||
synchronize_test.dart | ||
utils.dart |