public
Rubygem
Fork of nex3/haml
Description: HTML Abstraction Markup Language - A Markup Haiku
Homepage: http://haml.hamptoncatlin.com
Clone URL: git://github.com/chriseppstein/haml.git
Search Repo:
Getting rid of a lot of the stuff needed to prop up flat filtering.


git-svn-id: svn://hamptoncatlin.com/haml/trunk@535 
7063305b-7217-0410-af8c-cdc13e5119b9
nex3 (author)
Fri Jun 22 13:17:55 -0700 2007
commit  392a69fab722a88c6f5b48780abb7c923b8d3090
tree    38af70df7515a9be63aeba582a513b5ca0b9ef7e
parent  96f8800d71e41f87e1cd187e0be1f562cf185ceb
...
42
43
44
45
46
47
48
49
50
51
 
 
52
53
54
...
153
154
155
156
157
158
159
160
161
162
163
164
...
42
43
44
 
 
 
 
 
 
 
45
46
47
48
49
...
148
149
150
 
 
 
 
 
 
151
152
153
0
@@ -42,13 +42,8 @@ module Haml
0
 
0
     # Renders +text+ with the proper tabulation. This also deals with
0
     # making a possible one-line tag one line or not.
0
- def push_text(text, tabulation, flattened = false)
0
- if flattened
0
- # In this case, tabulation is the number of spaces, rather
0
- # than the number of tabs.
0
- @buffer << "#{' ' * tabulation}#{flatten(text + "\n")}"
0
- @one_liner_pending = true
0
- elsif @one_liner_pending && Buffer.one_liner?(text)
0
+ def push_text(text, tabulation)
0
+ if @one_liner_pending && Buffer.one_liner?(text)
0
         @buffer << text
0
       else
0
         if @one_liner_pending
0
@@ -153,12 +148,6 @@ module Haml
0
         push_text(close_tag, tabulation)
0
       end
0
     end
0
-
0
- # Stops parsing a flat section.
0
- def stop_flat
0
- buffer.concat("\n")
0
- @one_liner_pending = false
0
- end
0
 
0
     # Some of these methods are exposed as public class methods
0
     # so they can be re-used in helpers.
...
182
183
184
185
 
186
187
188
...
494
495
496
497
498
499
500
501
 
502
503
504
...
538
539
540
541
542
543
544
545
...
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
...
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
...
182
183
184
 
185
186
187
188
...
494
495
496
 
 
 
 
 
497
498
499
500
...
534
535
536
 
 
537
538
539
...
562
563
564
 
 
 
 
 
 
 
 
 
 
 
565
566
567
...
818
819
820
 
 
 
 
 
 
 
 
 
 
 
 
821
822
823
0
@@ -182,7 +182,7 @@ END
0
       @scope_object = scope
0
       @buffer = Haml::Buffer.new(@options)
0
 
0
- # Compile the @precompiled buffer
0
+ # Run the compiled evaluator function
0
       compile &block
0
 
0
       # Return the result string
0
@@ -494,11 +494,7 @@ END
0
     def push_flat(text, spaces)
0
       tabulation = spaces - @flat_spaces
0
       tabulation = tabulation > -1 ? tabulation : 0
0
- if @filter_buffer
0
- @filter_buffer << "#{' ' * tabulation}#{text}\n"
0
- else
0
- @precompiled << "_hamlout.push_text(#{text.dump}, #{tabulation}, true)\n"
0
- end
0
+ @filter_buffer << "#{' ' * tabulation}#{text}\n"
0
     end
0
 
0
     # Causes <tt>text</tt> to be evaluated in the context of
0
@@ -538,8 +534,6 @@ END
0
         close_comment value
0
       when :element
0
         close_tag value
0
- when :flat
0
- close_flat value
0
       when :loud
0
         close_loud value
0
       when :filtered
0
@@ -568,17 +562,6 @@ END
0
       push_silent "_hamlout.close_comment(#{has_conditional}, #{@output_tabs})"
0
     end
0
     
0
- # Closes a flattened section.
0
- def close_flat(in_tag)
0
- @flat_spaces = -1
0
- if in_tag
0
- close
0
- else
0
- push_silent('_hamlout.stop_flat')
0
- @template_tabs -= 1
0
- end
0
- end
0
-
0
     # Closes a loud Ruby block.
0
     def close_loud(command)
0
       push_silent 'end', false, true
0
@@ -835,18 +818,6 @@ END
0
       end
0
       push_text doctype
0
     end
0
-
0
- # Starts a flattened block.
0
- def start_flat(in_tag)
0
- # @flat_spaces is the number of indentations in the template
0
- # that forms the base of the flattened area
0
- if in_tag
0
- @to_close_stack.push([:flat, true])
0
- else
0
- push_and_tabulate([:flat])
0
- end
0
- @flat_spaces = @template_tabs * 2
0
- end
0
 
0
     # Starts a filtered block.
0
     def start_filtered(filter)

Comments

    No one has commented yet.