1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

More stuff for constant-as-operator handling. The constant !important is now by default the string "!important".

git-svn-id: svn://hamptoncatlin.com/haml/trunk@648 7063305b-7217-0410-af8c-cdc13e5119b9
This commit is contained in:
nex3 2007-11-23 14:49:54 +00:00
parent 61e5d0059e
commit a9418b307c
4 changed files with 10 additions and 2 deletions

View file

@ -101,7 +101,7 @@ module Sass
symbol = SYMBOLS[byte] symbol = SYMBOLS[byte]
# Adjacent values without an operator should be concatenated # Adjacent values without an operator should be concatenated
if (symbol.nil? || symbol == :open) && if (symbol.nil? || symbol == :open || symbol == :const) &&
last && (!last.is_a?(Symbol) || last == :close) last && (!last.is_a?(Symbol) || last == :close)
to_return << :concat to_return << :concat
end end

View file

@ -70,7 +70,7 @@ module Sass
}.merge! options }.merge! options
@template = template.split(/\n\r|\n/) @template = template.split(/\n\r|\n/)
@lines = [] @lines = []
@constants = {} @constants = {"important" => "!important"}
end end
# Processes the template and returns the result as a string. # Processes the template and returns the result as a string.

View file

@ -10,3 +10,5 @@
#div { num-num: 3.33333333333333; num-num2: 3; col-num: #092345; col-col: #0b0d0f; } #div { num-num: 3.33333333333333; num-num2: 3; col-num: #092345; col-col: #0b0d0f; }
#mod { num-num: 2; col-col: #0f0e05; col-num: #020001; } #mod { num-num: 2; col-col: #0f0e05; col-num: #020001; }
#const { escaped-quote: !foo; escaped-slash: !foo; default: Hello! !important; }

View file

@ -89,3 +89,9 @@
:col :col
:col= #5f6e7d % #10200a :col= #5f6e7d % #10200a
:num= #aaabac % 3 :num= #aaabac % 3
#const
:escaped
:quote = "!foo"
:slash = \!foo
:default = !str !important