From a4a973cc70e80d2f1b8ed3c7a007556245653df9 Mon Sep 17 00:00:00 2001 From: Nathan Weizenbaum Date: Mon, 19 Apr 2010 18:37:43 -0700 Subject: [PATCH] [Sass] Deprecate parent refs in the middle of selectors. --- doc-src/SASS_CHANGELOG.md | 7 +++++++ lib/sass/tree/rule_node.rb | 10 +++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc-src/SASS_CHANGELOG.md b/doc-src/SASS_CHANGELOG.md index 7455fc29..117d1d66 100644 --- a/doc-src/SASS_CHANGELOG.md +++ b/doc-src/SASS_CHANGELOG.md @@ -3,6 +3,13 @@ * Table of contents {:toc} +## 2.2.24 (Unreleased) + +* Parent references -- the `&` character -- + may only be placed at the beginning of simple selector sequences in Sass 3. + Placing them elsewhere is deprecated in 2.2.24 and will print a warning. + For example, `foo &.bar` is allowed, but `foo .bar&` is not. + ## 2.2.23 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.23). diff --git a/lib/sass/tree/rule_node.rb b/lib/sass/tree/rule_node.rb index 375019ba..e856d9ba 100644 --- a/lib/sass/tree/rule_node.rb +++ b/lib/sass/tree/rule_node.rb @@ -202,7 +202,15 @@ module Sass::Tree while scanner.rest? rules.last << scanner.scan(/[^",&]*/) case scanner.scan(/./) - when '&'; rules.last << :parent + when '&' + warn <