Commit Graph

1326 Commits

Author SHA1 Message Date
Natalie Weizenbaum
4c7b6cc0e5
Merge pull request #593 from sass/merge-use
Merge branch 'feature.use' into master
2019-02-13 14:56:17 -08:00
Natalie Weizenbaum
e3a5eed4da Revert "Run tests against sass-spec's feature.use branch"
This reverts commit 4d23acd119.
2019-02-13 13:59:44 -08:00
Natalie Weizenbaum
776e2bfcc2 Disable @use parsing 2019-02-13 00:36:36 -08:00
Natalie Weizenbaum
96510f2a1e
Merge pull request #592 from sass/use.syntax
Add support for parsing @use
2019-02-13 00:28:41 -08:00
Natalie Weizenbaum
4b10c22bd4 Add more explanatory error messages 2019-02-13 00:02:42 -08:00
Natalie Weizenbaum
6354cdd02a Don't parse private module member references 2019-02-11 17:17:31 -08:00
Natalie Weizenbaum
d757d99569 Add support for parsing @use 2019-02-11 17:17:31 -08:00
Natalie Weizenbaum
4d23acd119 Run tests against sass-spec's feature.use branch 2019-02-11 17:17:31 -08:00
Natalie Weizenbaum
7ca989a4f7
Produce a better error for invalid function contents (#587)
Closes #584
2019-02-04 13:14:25 -08:00
Natalie Weizenbaum
a81017275a
Produce a better error message for unclosed style rules (#586)
Closes #577
2019-02-01 17:21:15 -08:00
Natalie Weizenbaum
b102dc496a
Allow individual directories to be passed on the command-line (#581)
Closes #543
2019-02-01 14:59:58 -08:00
Natalie Weizenbaum
cd3b82e2be
Fix a check for adjusting parse errors (#582) 2019-02-01 14:55:34 -08:00
Natalie Weizenbaum
e8ac314f56
Support dart-lang/source_span#25 (#566)
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.
2019-01-28 20:42:32 -05:00
Matt Felten
923615a7f8 Fix "compound selectors may *no* longer be extended" error message (#576) 2019-01-25 20:52:05 -05:00
Natalie Weizenbaum
d1fcdbec75
Merge pull request #578 from sass/css-refactor
Split the CSS AST into mutable and immutable variants
2019-01-25 17:24:49 -05:00
Natalie Weizenbaum
d3c3a3d515 Delete ModifiableCssNode.modifyChildren
Instead of doing this, we now construct a new (unmodifiable)
CssStylesheet if additional imports need to be added.
2019-01-24 16:25:37 -08:00
Natalie Weizenbaum
93f4876b28 Split the CSS AST into mutable and immutable variants
This codifies in types the constraint that only the evaluator should
modify CSS nodes. It also makes it possible to create non-mutable
classes that don't need to care about stuff like tracking parent nodes.
2019-01-24 15:59:39 -08:00
Natalie Weizenbaum
9fdf5612ea
Fix a performance bug in BinaryOperatorExpression.span (#569)
Previously, evaluator called BinaryOperationExpression.span for each
binary operation it evaluated, which in turn called spanForList() to
create a span covering both child expressions. spanForList() then
called .span for both the left and right child operations *twice*,
leading to exponential behavior.

This is now avoided in three complementary ways:

1. The evaluator avoids eagerly calling AstNode.span, instead keeping
   the original AstNode until the span itself needs to be accessed.
   This means that a span will only be accessed when an error actually
   occurs, and then only one operation's span will be accessed.

2. BinaryOperationExpression.span now iterates through any child
   operations before calling their .span methods, so it only performs
   O(1) allocations.

3. spanForList() now only calls each AstNode.span once.
2019-01-17 18:04:14 -05:00
Natalie Weizenbaum
b0242767ee
Temporarily limit source_span to 1.4.x (#570)
Getting all the tests update and the output looking nice is proving
more difficult than expected, and I want to unblock other pull
requests for Dart Sass in the meantime.
2019-01-15 03:02:06 -05:00
Natalie Weizenbaum
3368e890cd
Add a grind script to sanity-check a release (#563)
Add a grind script to sanity-check a release

This will help avoid accidentally releasing dev versions 😖.
2019-01-09 19:45:27 -05:00
Natalie Weizenbaum
e3ae4705f1
Release 1.16.0 (#562) 2019-01-09 19:18:45 -05:00
Natalie Weizenbaum
55ebe56d3c
Add support for new special number strings (#556)
See sass/sass#2584
2019-01-09 15:50:04 -05:00
Natalie Weizenbaum
12f53f5e1c
Release 1.15.3 (#561) 2019-01-04 15:32:45 -05:00
Natalie Weizenbaum
32be730b6e
Emit tab characters as \9 (#553)
Closes #552
2019-01-04 14:20:28 -05:00
Natalie Weizenbaum
7a75b7b786
Don't canonicalize file case in source maps (#541)
Closes #540
2019-01-04 14:17:18 -05:00
Nicholas Shahan
948fe17a53
Remove unused import (#559)
Originally added in #548 but after changes during review it is no longer needed.
2019-01-03 15:36:05 -08:00
Natalie Weizenbaum
18c0cbdaea
Match Node Sass's this.includePaths behavior for importers (#551)
On Windows, paths are separated with a semicolon rather than a colon.

Closes #549
2019-01-03 10:48:20 -08:00
Natalie Weizenbaum
759b587364
Don't omit units in numbers in compressed mode (#545)
See https://github.com/sass/sass/issues/649#issuecomment-447033060
2019-01-03 10:47:54 -08:00
Natalie Weizenbaum
dbda396401
Compile to JS with -O4 (#555)
Closes #526
2019-01-03 10:47:12 -08:00
Natalie Weizenbaum
06b9fbd812
Merge branch 'master' into windows-path-separator 2018-12-26 14:17:45 -08:00
Natalie Weizenbaum
9f2f11682e
Merge pull request #546 from sass/source-map-urls
Properly use ImportResult.sourceMapUrl for source map URLs
2018-12-20 17:39:28 -08:00
Natalie Weizenbaum
7ae11f1c0e Make synchronize_test draw from the canonical list of synced files 2018-12-20 16:22:43 -08:00
Natalie Weizenbaum
23968148d0 Properly use ImportResult.sourceMapUrl for source map URLs
This also uses data: URLs to refer to stylesheets from stdin in source
maps.
2018-12-20 16:22:43 -08:00
Nicholas Shahan
3a493f23ab
Add documentation comment collection to AST (#548)
- Documentation comments are simply identified by starting with a triple-slash "///". 
- Adjacent comments in indented syntax are now coalesced into a single comment.
2018-12-20 16:08:26 -08:00
Natalie Weizenbaum
9d6de5af23 Add a missing import 2018-12-17 15:52:49 -08:00
Natalie Weizenbaum
519bfa3d6b Match Node Sass's this.includePaths behavior for importers
On Windows, paths are separated with a semicolon rather than a colon.

Closes #549
2018-12-17 15:30:17 -08:00
Natalie Weizenbaum
94fd7e6e50
Match Ruby Sass's number behavior (#544)
This introduces two changes:

1. It changes the epsilon within which two numbers are considered
   equal to be an order of magnitude smaller than the numeric
   precision. Ruby Sass has always done this, and Dart Sass should
   have but did not until now.

2. It parses the component of a number after the decimal point using
   double.parse() to avoid accumulating floating point errors.
2018-12-13 15:27:08 -08:00
Natalie Weizenbaum
fa29e80d29
Merge pull request #542 from sass/compile-refactor
Move some compilation logic from the executable to compile.dart
2018-12-13 11:58:46 -08:00
Natalie Weizenbaum
a09a62538e Remove extra importer parameters from internal compile functions
These can be passed as an ImportCache now, so they make the API more
confusing for relatively little benefit.

This also changes the const AsyncImportCache.none field to a non-const
AsyncImportCache.none() constructor. The const field didn't make sense
for a couple reasons: first, it wouldn't use a user's custom logger;
and second, it couldn't cache any relative imports, which were still
possible when the initial file was loaded from disk.
2018-12-12 15:54:32 -08:00
Natalie Weizenbaum
4c2d3af3b0 Move some compilation logic from the executable to compile.dart 2018-12-11 00:12:27 -08:00
Natalie Weizenbaum
56247975ed Automatically synchronize lib/src/compile.dart 2018-12-10 17:39:21 -08:00
Natalie Weizenbaum
f3db1d6a66
Properly merge "all and" media queries (#539)
Closes #537
2018-12-10 13:13:19 -08:00
Natalie Weizenbaum
cc009fb235
Update the Chocolatey push URL (#538) 2018-12-06 17:08:59 -08:00
Natalie Weizenbaum
dad8491035
Make types.String.prototype.setValue() de-quote a string (#535)
Closes #513
2018-12-06 15:06:32 -08:00
Natalie Weizenbaum
f914c39067
Fix pushing to Bazel again (#531)
With #506, we're pushing the master branch to the Bazel repo. But
we're actually committing to a detached HEAD, rather than the master
branch. This pushes the current HEAD instead.

Closes bazelbuild/rules_sass#61
2018-11-19 16:38:15 -08:00
Natalie Weizenbaum
aa52cf1474
Always add quotes to attribute selector values that begin with -- (#529)
Closes #527
2018-11-16 13:51:36 -08:00
Natalie Weizenbaum
d4adea7569
Merge pull request #528 from sass/dart-2-everywhere
Enable support for Dart 2.1
2018-11-16 13:07:35 -08:00
Natalie Weizenbaum
487e5025ff Reformat with Dart-2-only features 2018-11-15 15:16:24 -08:00
Natalie Weizenbaum
5d885e6905 Enforce non-whitespace formatting rules 2018-11-14 13:53:55 -08:00
Natalie Weizenbaum
80afdd88f8 Run in Dart 2 runtime mode everywhere 2018-11-14 13:53:53 -08:00