haml-edge 2.3.225 → 2.3.226

Sign up to get free protection for your applications and to get access to all the features.
data/EDGE_GEM_VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.225
1
+ 2.3.226
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.225
1
+ 2.3.226
data/lib/haml/exec.rb CHANGED
@@ -23,7 +23,8 @@ module Haml
23
23
  rescue Exception => e
24
24
  raise e if @options[:trace] || e.is_a?(SystemExit)
25
25
 
26
- $stderr.puts e.message
26
+ $stderr.puts "#{e.class}: #{e.message}"
27
+ $stderr.puts " Use --trace for backtrace."
27
28
  exit 1
28
29
  end
29
30
  exit 0
@@ -99,7 +99,7 @@ module Sass
99
99
  class << self
100
100
  private
101
101
  def string_re(open, close)
102
- /#{open}((?:\\.|\#(?!\{)|[^#{close}\\#])*)(#{close}|(?=#\{))/
102
+ /#{open}((?:\\.|\#(?!\{)|[^#{close}\\#])*)(#{close}|#\{)/
103
103
  end
104
104
  end
105
105
 
@@ -114,8 +114,8 @@ module Sass
114
114
  [:single, false] => string_re("'", "'"),
115
115
  [:double, true] => string_re('', '"'),
116
116
  [:single, true] => string_re('', "'"),
117
- [:uri, false] => /url\(#{W}(#{URLCHAR}*?)(#{W}\)|(?=#\{))/,
118
- [:uri, true] => /(#{URLCHAR}*?)(#{W}\)|(?=#\{))/,
117
+ [:uri, false] => /url\(#{W}(#{URLCHAR}*?)(#{W}\)|#\{)/,
118
+ [:uri, true] => /(#{URLCHAR}*?)(#{W}\)|#\{)/,
119
119
  }
120
120
 
121
121
  # @param str [String, StringScanner] The source text to lex
@@ -251,10 +251,13 @@ module Sass
251
251
 
252
252
  def string(re, open)
253
253
  return unless scan(STRING_REGULAR_EXPRESSIONS[[re, open]])
254
- @interpolation_stack << re if @scanner[2].empty? # Started an interpolated section
254
+ if @scanner[2] == '#{' #'
255
+ @scanner.pos -= 2 # Don't actually consume the #{
256
+ @interpolation_stack << re
257
+ end
255
258
  str =
256
259
  if re == :uri
257
- Script::String.new("#{'url(' unless open}#{@scanner[1]}#{')' unless @scanner[2].empty?}")
260
+ Script::String.new("#{'url(' unless open}#{@scanner[1]}#{')' unless @scanner[2] == '#{'}")
258
261
  else
259
262
  Script::String.new(@scanner[1].gsub(/\\(['"]|\#\{)/, '\1'), :string)
260
263
  end
@@ -645,7 +645,11 @@ MESSAGE
645
645
 
646
646
  mid_re = Sass::Script::Lexer::STRING_REGULAR_EXPRESSIONS[[type, true]]
647
647
  # @scanner[2].empty? means we've started an interpolated section
648
- res << expr!(:interpolation) << tok(mid_re) while @scanner[2].empty?
648
+ while @scanner[2] == '#{'
649
+ @scanner.pos -= 2 # Don't consume the #{
650
+ res.last.slice!(-2..-1)
651
+ res << expr!(:interpolation) << tok(mid_re)
652
+ end
649
653
  res
650
654
  end
651
655
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml-edge
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.225
4
+ version: 2.3.226
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Weizenbaum