mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Woo multiline comments.
git-svn-id: svn://hamptoncatlin.com/haml/trunk@439 7063305b-7217-0410-af8c-cdc13e5119b9
This commit is contained in:
parent
30e4560c3c
commit
162f2b0eb8
4 changed files with 29 additions and 11 deletions
|
@ -144,18 +144,27 @@ module Sass
|
|||
|
||||
return node, index
|
||||
end
|
||||
|
||||
while has_children
|
||||
child, index = build_tree(index)
|
||||
|
||||
if child == :constant
|
||||
raise SyntaxError.new("Constants may only be declared at the root of a document.", @line)
|
||||
elsif child.is_a? Tree::Node
|
||||
child.line = @line
|
||||
node << child
|
||||
if node.is_a? Tree::CommentNode
|
||||
while has_children
|
||||
line, index = raw_next_line(index)
|
||||
node << line
|
||||
|
||||
has_children = has_children?(index, tabs)
|
||||
end
|
||||
else
|
||||
while has_children
|
||||
child, index = build_tree(index)
|
||||
|
||||
if child == :constant
|
||||
raise SyntaxError.new("Constants may only be declared at the root of a document.", @line)
|
||||
elsif child.is_a? Tree::Node
|
||||
child.line = @line
|
||||
node << child
|
||||
end
|
||||
|
||||
has_children = has_children?(index, tabs)
|
||||
has_children = has_children?(index, tabs)
|
||||
end
|
||||
end
|
||||
|
||||
return node, index
|
||||
|
@ -165,6 +174,10 @@ module Sass
|
|||
next_line = @lines[index]
|
||||
next_line && next_line[1] > tabs
|
||||
end
|
||||
|
||||
def raw_next_line(index)
|
||||
[@lines[index][0], index + 1]
|
||||
end
|
||||
|
||||
def parse_line(line)
|
||||
case line[0]
|
||||
|
|
|
@ -7,7 +7,8 @@ module Sass::Tree
|
|||
end
|
||||
|
||||
def to_s(parent_name = nil)
|
||||
"/* #{value} */"
|
||||
join_string = @style == :compact ? ' ' : "\n * "
|
||||
"/* #{value}#{join_string unless children.empty?}#{children.join join_string} */"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -34,7 +34,7 @@ body { margin: 0; font: 0.85em "Lucida Grande", "Trebuchet MS", Verdana, sans-se
|
|||
#content .container.video .column.left .box { margin-top: 10px; }
|
||||
#content .container.video .column.left .box p { margin: 0 1em auto 1em; }
|
||||
#content .container.video .column.left .box.participants img { float: left; margin: 0 1em auto 1em; border: 1px solid #6e000d; border-style: solid; }
|
||||
#content .container.video .column.left .box.participants h2 { margin: 0 0 10px 0; padding: 0.5em; /* The background image is a gif! */ background: #6e000d url(/images/hdr_participant.gif) 2px 2px no-repeat; text-indent: -9999px; border-top-width: 5px; border-top-style: solid; border-top-color: #a20013; border-right-width: 1px; border-right-style: dotted; }
|
||||
#content .container.video .column.left .box.participants h2 { margin: 0 0 10px 0; padding: 0.5em; /* The background image is a gif! */ background: #6e000d url(/images/hdr_participant.gif) 2px 2px no-repeat; /* Okay check this out Multiline comments Wow dude I mean seriously, WOW */ text-indent: -9999px; border-top-width: 5px; border-top-style: solid; border-top-color: #a20013; border-right-width: 1px; border-right-style: dotted; }
|
||||
#content .container.video .column.middle { width: 500px; }
|
||||
#content .container.video .column.right { width: 200px; }
|
||||
#content .container.video .column.right .box { margin-top: 0; }
|
||||
|
|
|
@ -133,6 +133,10 @@ body
|
|||
:padding 0.5em
|
||||
/* The background image is a gif!
|
||||
:background #6e000d url(/images/hdr_participant.gif) 2px 2px no-repeat
|
||||
/* Okay check this out
|
||||
Multiline comments
|
||||
Wow dude
|
||||
I mean seriously, WOW
|
||||
:text-indent -9999px
|
||||
:border
|
||||
:top
|
||||
|
|
Loading…
Reference in a new issue