From e8a71b6e6660188cc4302969d7ee5e274595c59b Mon Sep 17 00:00:00 2001 From: Nathan Weizenbaum Date: Mon, 21 Dec 2009 22:43:05 -0800 Subject: [PATCH] [Sass] [SCSS] Support @if. --- lib/sass/scss/parser.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/sass/scss/parser.rb b/lib/sass/scss/parser.rb index 9e0ef8fe..93b1d541 100644 --- a/lib/sass/scss/parser.rb +++ b/lib/sass/scss/parser.rb @@ -36,7 +36,7 @@ module Sass true end - DIRECTIVES = Set[:mixin, :include, :debug, :for] + DIRECTIVES = Set[:mixin, :include, :debug, :for, :if] def directive return unless name = tok(ATRULE) @@ -97,6 +97,12 @@ module Sass block(node(Sass::Tree::ForNode.new(var, from, to, exclusive))) end + def if + expr = sass_script_parser.parse + ss + block(node(Sass::Tree::IfNode.new(expr))) + end + def variable return unless raw '!' name = tok! IDENT