Struct.new(:text, :unstripped, :full, :index, :precompiler, :eod)
@private
@private
# File lib/haml/precompiler.rb, line 132
132: def tabs
133: line = self
134: @tabs ||= precompiler.instance_eval do
135: break 0 if line.text.empty? || !(whitespace = line.full[/^\s+/])
136:
137: if @indentation.nil?
138: @indentation = whitespace
139:
140: if @indentation.include?(\s\) && @indentation.include?(\t\)
141: raise SyntaxError.new("Indentation can't use both tabs and spaces.", line.index)
142: end
143:
144: @flat_spaces = @indentation * @template_tabs if flat?
145: break 1
146: end
147:
148: tabs = whitespace.length / @indentation.length
149: break tabs if whitespace == @indentation * tabs
150: break @template_tabs if flat? && whitespace =~ /^#{@indentation * @template_tabs}/
151:
152: raise SyntaxError.new(Inconsistent indentation: #{Haml::Shared.human_indentation whitespace, true} used for indentation,but the rest of the document was indented using #{Haml::Shared.human_indentation @indentation}..strip.gsub("\n", ' '), line.index)
153: end
154: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.