From 4f79e92e68587dfc85eb08e785ae6f24e9ffa136 Mon Sep 17 00:00:00 2001 From: Nathan Weizenbaum Date: Fri, 23 Apr 2010 00:26:44 -0700 Subject: [PATCH 1/2] [Sass] Make sass-convert -F sass -T sass require --in-place Closes gh-137 --- doc-src/SASS_CHANGELOG.md | 6 ++++++ lib/haml/exec.rb | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/doc-src/SASS_CHANGELOG.md b/doc-src/SASS_CHANGELOG.md index 22ff4cbb82..782bcf5130 100644 --- a/doc-src/SASS_CHANGELOG.md +++ b/doc-src/SASS_CHANGELOG.md @@ -13,6 +13,12 @@ now allow whitespace before the colon. For example: foo color : blue +### Minor Changes + +* Running `sass-convert --from sass --to sass` will raise an error + unless `--in-place` is provided, + to prevent accidental erasure of source files. + ### Bug Fixes * Variables are now allowed as arguments to `url()`. diff --git a/lib/haml/exec.rb b/lib/haml/exec.rb index 3dbb01bb2d..fca37dbd7e 100644 --- a/lib/haml/exec.rb +++ b/lib/haml/exec.rb @@ -666,6 +666,11 @@ def process_directory end @options[:output] ||= @options[:input] + if @options[:to] == @options[:from] && !@options[:in_place] + fmt = @options[:from] + raise "Error: converting from #{fmt} to #{fmt} without --in-place" + end + ext = @options[:from] ext = :sass if ext == :sass2 Dir.glob("#{@options[:input]}/**/*.#{ext}") do |f| From b84527f393f866bf36ba6f930374837555224098 Mon Sep 17 00:00:00 2001 From: Nathan Weizenbaum Date: Fri, 23 Apr 2010 12:48:27 -0700 Subject: [PATCH 2/2] [Sass] [SCSS] Faster! Faster! --- doc-src/SASS_CHANGELOG.md | 2 ++ lib/sass/scss/parser.rb | 1 + 2 files changed, 3 insertions(+) diff --git a/doc-src/SASS_CHANGELOG.md b/doc-src/SASS_CHANGELOG.md index 782bcf5130..2bfe654a25 100644 --- a/doc-src/SASS_CHANGELOG.md +++ b/doc-src/SASS_CHANGELOG.md @@ -19,6 +19,8 @@ now allow whitespace before the colon. For example: unless `--in-place` is provided, to prevent accidental erasure of source files. +* SCSS parsing speed is dramatically improved. + ### Bug Fixes * Variables are now allowed as arguments to `url()`. diff --git a/lib/sass/scss/parser.rb b/lib/sass/scss/parser.rb index ce1f73c714..e2555505ee 100644 --- a/lib/sass/scss/parser.rb +++ b/lib/sass/scss/parser.rb @@ -318,6 +318,7 @@ def block_contents(node, context) end def block_child(context) + return variable || directive || ruleset if context == :stylesheet variable || directive || declaration_or_ruleset end