Hard tabs in empty lines in Haml and Sass no longer throw errors.

git-svn-id: svn://hamptoncatlin.com/haml/trunk@459 7063305b-7217-0410-af8c-cdc13e5119b9
This commit is contained in:
nex3 2007-03-30 06:49:03 +00:00
parent ff17efc1fc
commit bf5049cfca
4 changed files with 10 additions and 0 deletions

View File

@ -716,6 +716,8 @@ END
def count_soft_tabs(line)
spaces = line.index(/[^ ]/)
if line[spaces] == ?\t
return nil if line.strip.empty?
raise SyntaxError.new("Illegal Indentation: Only two space characters are allowed as tabulation.")
end
[spaces, spaces/2]

View File

@ -142,6 +142,9 @@ module Sass
spaces = line.index(/[^ ]/)
if spaces
if spaces % 2 == 1 || line[spaces] == ?\t
# Make sure a line with just tabs isn't an error
return nil if line.strip.empty?
raise SyntaxError.new("Illegal Indentation: Only two space characters are allowed as tabulation.", @line)
end
spaces / 2

View File

@ -39,6 +39,8 @@
Woah a period.
= "test" |
"test" |
-# Hard tabs shouldn't throw errors.
- case :foo
- when :bar
%br Blah

View File

@ -109,6 +109,9 @@ body
a:hover
:text-decoration underline
// A hard tab:
#content
p, div
:width 40em