* Add fatal/futureDeprecations to Dart API
This adds a new `Deprecation` class that specifies an ID for each
deprecated feature along with what Dart Sass version deprecated it.
The compile functions allow you to pass a set of `fatalDeprecations`
that will cause an error instead of a warning. You can also pass a set
of `futureDeprecations`, which let you opt-in to deprecations (like
`@import`) early.
* Add future deprecation for `@import`
* Add flags
* Merge colorUnits and randomWithUnits
* Update changelogs and pubspecs
* Add tests
* Use isFuture instead of deprecatedIn == null
* Split warnForDeprecation from warn
* Add missing word to error message
Rather than constructing this explicitly to match Node Sass's API, we
construct it with canonical URLs and convert it into the format
expected by the Node Sass API (a mix of paths and URLs) in the
compatibility layer.
As far as I can tell, the root cause of this failure is just the
Node.js watcher failing to emit an event entirely, so there's not much
more we can do to work around it.
Doing this for variable *nodes* was breaking in extremely specific
circumstances:
* A null node is passed into setVariable() and, if source maps are
enabled, recorded in _variableNodes.
* Later on, getVariableNode() is called for that variable. Because
that variable's node is null, it calls
_getVariableNodeFromGlobalModule() even though the variable is
actually defined.
* _getVariableNodeFromGlobalModule() sets _lastVariableIndex to 0 on
the assumption that the variable is undefined, which turns out to be
incorrect in this specific case.
The next commit will fix the issue where a null node can be passed
into setVariable() when source maps are enabled, but it makes more
sense to assign the variable index to 0 in the variable access anyway,
since it happens first and isn't skipped when source maps are
disabled.
For any @errors encountered in mixins or functions, use the call-site
(instead of the @error rule) as the span printed in the error message.
Closes#474
See sass/sass-spec#1494
The automatic @charset adding is useful in general, but there are
consistently cases where it trips up naïve downstream tools. This
option makes it easier for users to control when it occurs.
This adds a --no-unicode option to disable Unicode span rendering,
decouples repl highlighting from SourceSpan.highlight, and updates
tests to work with the new error highlighting.
It also tightly scopes source spans for statements with children.
Previously, source spans for these nodes extended all the way through
any whitespace that followed the node. This led to messy-looking
multiline span highlights with dart-lang/source_span#25.
Now, StylesheetParser.children doesn't consume trailing whitespace.
Instead, we add a helper method StylesheetParser._withChildren that
parses children, creates the appropriate span, and then consumes the
trailing whitespace.