Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Tidy up; whitespace only.

  • Loading branch information...
commit 65746649224293450394a4ca00796db35913e81d 1 parent 8e3a463
Carlos Lima authored
Showing with 243 additions and 243 deletions.
  1. +243 −243 t/parse.t
View
486 t/parse.t
@@ -18,10 +18,10 @@ is_deeply($haml->tape, []);
$haml->parse(' ');
is_deeply(
$haml->tape,
- [ { 'level' => 3,
- 'type' => 'text',
- 'line' => '',
- 'lineno'=> 1,
+ [ { 'level' => 3,
+ 'type' => 'text',
+ 'line' => '',
+ 'lineno' => 1,
}
]
);
@@ -36,29 +36,29 @@ $haml->parse(<<'EOF');
EOF
is_deeply(
$haml->tape,
- [ { type => 'tag',
- level => 0,
- name => 'a',
- attrs => [
+ [ { type => 'tag',
+ level => 0,
+ name => 'a',
+ attrs => [
href => {type => 'text', text => 'foo'},
target => {type => 'text', text => '_blank'},
title => {type => 'expr', text => 'help_me'},
do => {type => 'boolean', text => 1}
],
- line =>
+ line =>
qq/%a{href => 'foo', target => "_blank", title => help_me, do => true}/,
- lineno=> 1,
+ lineno => 1,
},
- { type => 'tag',
- level => 0,
- name => 'script',
- attrs => [
+ { type => 'tag',
+ level => 0,
+ name => 'script',
+ attrs => [
type => {type => 'text', text => 'text/javascript'},
src => {type => 'text', text => 'javascripts/script.js'}
],
- line =>
+ line =>
qq|%script{:type => "text/javascript",\n :src => "javascripts/script.js"}|,
- lineno=> '2-3',
+ lineno => '2-3',
},
{type => 'text', level => 0, line => '', lineno => 4}
]
@@ -71,29 +71,29 @@ $haml->parse(<<'EOF');
EOF
is_deeply(
$haml->tape,
- [ { type => 'tag',
- level => 0,
- name => 'a',
- attrs => [
+ [ { type => 'tag',
+ level => 0,
+ name => 'a',
+ attrs => [
href => {type => 'text', text => 'foo'},
target => {type => 'text', text => '_blank'},
title => {type => 'expr', text => 'help_me'},
do => {type => 'boolean', text => 1}
],
- line =>
+ line =>
qq/%a(href = 'foo' target = "_blank" title = help_me do = true)/,
- lineno=> 1,
+ lineno => 1,
},
- { type => 'tag',
- level => 0,
- name => 'script',
- attrs => [
+ { type => 'tag',
+ level => 0,
+ name => 'script',
+ attrs => [
type => {type => 'text', text => 'text/javascript'},
src => {type => 'text', text => 'javascripts/script.js'}
],
- line =>
+ line =>
qq|%script(type = "text/javascript"\n src = "javascripts/script.js")|,
- lineno=> '2-3',
+ lineno => '2-3',
},
{type => 'text', level => 0, line => '', lineno => 4}
]
@@ -107,33 +107,33 @@ $haml->parse(<<'EOF');
EOF
is_deeply(
$haml->tape,
- [ { type => 'tag',
- level => 0,
- name => 'a',
- attrs => [foo => {type => 'text', text => '#{bar}'}],
- line => '%a{:foo => "#{bar}"}',
- lineno=> 1,
+ [ { type => 'tag',
+ level => 0,
+ name => 'a',
+ attrs => [foo => {type => 'text', text => '#{bar}'}],
+ line => '%a{:foo => "#{bar}"}',
+ lineno => 1,
},
- { type => 'tag',
- level => 0,
- name => 'a',
- attrs => [bar => {type => 'text', text => "b'az"}],
- line => q/%a{:bar => "b'az"}/,
- lineno=> 2,
+ { type => 'tag',
+ level => 0,
+ name => 'a',
+ attrs => [bar => {type => 'text', text => "b'az"}],
+ line => q/%a{:bar => "b'az"}/,
+ lineno => 2,
},
- { type => 'tag',
- level => 0,
- name => 'a',
- attrs => [bar => {type => 'text', text => 'b"az'}],
- line => q/%a{:bar => "b\"az"}/,
- lineno=> 3,
+ { type => 'tag',
+ level => 0,
+ name => 'a',
+ attrs => [bar => {type => 'text', text => 'b"az'}],
+ line => q/%a{:bar => "b\"az"}/,
+ lineno => 3,
},
- { type => 'tag',
- level => 0,
- name => 'a',
- attrs => [bar => {type => 'text', text => 'baz\\'}],
- line => q/%a{:bar => "baz\\"}/,
- lineno=> 4,
+ { type => 'tag',
+ level => 0,
+ name => 'a',
+ attrs => [bar => {type => 'text', text => 'baz\\'}],
+ line => q/%a{:bar => "baz\\"}/,
+ lineno => 4,
},
{type => 'text', level => 0, line => '', lineno => 5}
]
@@ -150,61 +150,61 @@ EOF
is_deeply(
$haml->tape,
[ {type => 'tag', level => 0, name => 'gee', line => '%gee', lineno => 1},
- { type => 'tag',
- level => 2,
- name => 'div',
- class => [qw/class class2/],
- id => 'id',
- attrs => [foo => {type => 'text', text => 'bar'}],
- line => ".class.class2#id{foo => 'bar'}",
- lineno=> 2,
+ { type => 'tag',
+ level => 2,
+ name => 'div',
+ class => [qw/class class2/],
+ id => 'id',
+ attrs => [foo => {type => 'text', text => 'bar'}],
+ line => ".class.class2#id{foo => 'bar'}",
+ lineno => 2,
},
- { type => 'tag',
- level => 4,
- name => 'baz',
- expr => 1,
- text => '1 + 2',
- line => '%baz= 1 + 2',
- lineno=> 3,
+ { type => 'tag',
+ level => 4,
+ name => 'baz',
+ expr => 1,
+ text => '1 + 2',
+ line => '%baz= 1 + 2',
+ lineno => 3,
},
- { type => 'text',
- level => 6,
- text => 'Wow this is cool!',
- line => 'Wow this is cool!',
- lineno=> 4,
- },
- { type => 'tag',
- level => 6,
- name => 'a',
- attrs => [
+ { type => 'text',
+ level => 6,
+ text => 'Wow this is cool!',
+ line => 'Wow this is cool!',
+ lineno => 4,
+ },
+ { type => 'tag',
+ level => 6,
+ name => 'a',
+ attrs => [
href => {type => 'text', text => 'foo'},
name => {
type => 'expr',
text => 'helper'
}
],
- text => 'Link',
- line => "%a{href => 'foo', name => helper} Link",
- lineno=> 5,
- },
- { type => 'tag',
- level => 6,
- name => 'a',
- attrs => [
+ text => 'Link',
+ line => "%a{href => 'foo', name => helper} Link",
+ lineno => 5,
+ },
+ { type => 'tag',
+ level => 6,
+ name => 'a',
+ attrs => [
href => {type => 'text', text => 'foo'},
name => {
type => 'expr',
text => 'helper'
}
],
- text => 'Link',
- line => q/%a(href="foo" name=helper) Link/,
- lineno=> 6,
+ text => 'Link',
+ line => q/%a(href="foo" name=helper) Link/,
+ lineno => 6,
},
- { type => 'text',
- level => 0,
- line => '',
- lineno=> 7,
+ { type => 'text',
+ level => 0,
+ line => '',
+ lineno => 7,
}
]
);
@@ -215,24 +215,24 @@ $haml->parse(<<'EOF');
EOF
is_deeply(
$haml->tape,
- [ { type => 'tag',
- level => 0,
- name => 'b',
- attrs => [foo => {type => 'boolean', text => 1}],
- line => q/%b(foo=true)/,
- lineno=> 1,
+ [ { type => 'tag',
+ level => 0,
+ name => 'b',
+ attrs => [foo => {type => 'boolean', text => 1}],
+ line => q/%b(foo=true)/,
+ lineno => 1,
},
- { type => 'tag',
- level => 0,
- name => 'b',
- attrs => [foo => {type => 'boolean', text => 0}],
- line => q/%b{:foo=>false}/,
- lineno=> 2,
+ { type => 'tag',
+ level => 0,
+ name => 'b',
+ attrs => [foo => {type => 'boolean', text => 0}],
+ line => q/%b{:foo=>false}/,
+ lineno => 2,
},
- { type => 'text',
- level => 0,
- line => '',
- lineno=> 3,
+ { type => 'text',
+ level => 0,
+ line => '',
+ lineno => 3,
}
]
);
@@ -244,18 +244,18 @@ $haml->parse(<<'EOF');
EOF
is_deeply(
$haml->tape,
- [ { type => 'tag',
- level => 0,
- name => 'blockquote',
- trim_in => 1,
- line => '%blockquote<',
- lineno => 1,
- },
- { type => 'tag',
- level => 2,
- name => 'foo',
- line => '%foo',
- lineno=> 2,
+ [ { type => 'tag',
+ level => 0,
+ name => 'blockquote',
+ trim_in => 1,
+ line => '%blockquote<',
+ lineno => 1,
+ },
+ { type => 'tag',
+ level => 2,
+ name => 'foo',
+ line => '%foo',
+ lineno => 2,
},
{ type => 'tag',
level => 2,
@@ -265,10 +265,10 @@ is_deeply(
line => '%bar> trim out',
lineno => 3,
},
- { type => 'text',
- level => 0,
- line => '',
- lineno=> 4,
+ { type => 'text',
+ level => 0,
+ line => '',
+ lineno => 4,
}
]
);
@@ -281,35 +281,35 @@ $haml->parse(<<'EOF');
EOF
is_deeply(
$haml->tape,
- [ { type => 'comment',
- level => 0,
- text => 'haml comment',
- line => '-# haml comment',
- lineno=> 1,
+ [ { type => 'comment',
+ level => 0,
+ text => 'haml comment',
+ line => '-# haml comment',
+ lineno => 1,
},
- { type => 'text',
- level => 2,
- text => '= "just text"',
- line => '\= "just text"',
- lineno=> 2,
+ { type => 'text',
+ level => 2,
+ text => '= "just text"',
+ line => '\= "just text"',
+ lineno => 2,
},
- { type => 'html_comment',
- level => 2,
- text => 'html comment',
- line => '/ html comment',
- lineno=> 3,
+ { type => 'html_comment',
+ level => 2,
+ text => 'html comment',
+ line => '/ html comment',
+ lineno => 3,
},
- { type => 'html_comment',
- level => 2,
- if => 'IE',
- text => 'if html comment',
- line => '/[if IE] if html comment',
- lineno=> 4,
+ { type => 'html_comment',
+ level => 2,
+ if => 'IE',
+ text => 'if html comment',
+ line => '/[if IE] if html comment',
+ lineno => 4,
},
- { type => 'text',
- level => 0,
- line => '',
- lineno=> 5,
+ { type => 'text',
+ level => 0,
+ line => '',
+ lineno => 5,
}
]
);
@@ -322,22 +322,22 @@ normal
EOF
is_deeply(
$haml->tape,
- [ { type => 'text',
- level => 0,
- text => 'multiline comment parsing',
- line => "multiline |\ncomment |\nparsing |",
- lineno=> '1-3',
+ [ { type => 'text',
+ level => 0,
+ text => 'multiline comment parsing',
+ line => "multiline |\ncomment |\nparsing |",
+ lineno => '1-3',
},
- { type => 'text',
- level => 0,
- text => 'normal',
- line => 'normal',
- lineno=> 4,
+ { type => 'text',
+ level => 0,
+ text => 'normal',
+ line => 'normal',
+ lineno => 4,
},
- { type => 'text',
- level => 0,
- line => '',
- lineno=> 5,
+ { type => 'text',
+ level => 0,
+ line => '',
+ lineno => 5,
}
]
);
@@ -350,23 +350,23 @@ normal
EOF
is_deeply(
$haml->tape,
- [ { type => 'tag',
- level => 0,
- name => 'p',
- text => 'multiline comment parsing',
- line => "%p multiline |\ncomment |\nparsing |",
- lineno=> '1-3',
+ [ { type => 'tag',
+ level => 0,
+ name => 'p',
+ text => 'multiline comment parsing',
+ line => "%p multiline |\ncomment |\nparsing |",
+ lineno => '1-3',
},
- { type => 'text',
- level => 0,
- text => 'normal',
- line => 'normal',
- lineno=> 4,
+ { type => 'text',
+ level => 0,
+ text => 'normal',
+ line => 'normal',
+ lineno => 4,
},
- { type => 'text',
- level => 0,
- line => '',
- lineno=> 5,
+ { type => 'text',
+ level => 0,
+ line => '',
+ lineno => 5,
}
]
);
@@ -391,9 +391,9 @@ is_deeply(
line => '%a/',
lineno => 2,
},
- { type => 'text',
- level => 0,
- line => '',
+ { type => 'text',
+ level => 0,
+ line => '',
lineno => 3,
}
]
@@ -407,38 +407,38 @@ $haml->parse(<<'EOF');
EOF
is_deeply(
$haml->tape,
- [ { type => 'text',
- level => 0,
- expr => 1,
- text => '1 + 2',
- line => '= 1 + 2',
- lineno=> 1,
+ [ { type => 'text',
+ level => 0,
+ expr => 1,
+ text => '1 + 2',
+ line => '= 1 + 2',
+ lineno => 1,
},
- { type => 'block',
- level => 0,
- text => '"foo"',
- line => '- "foo"',
- lineno=> 2,
+ { type => 'block',
+ level => 0,
+ text => '"foo"',
+ line => '- "foo"',
+ lineno => 2,
},
- { type => 'text',
- level => 0,
- expr => 1,
- text => '$foo->{bar}',
- line => '= $foo->{bar}',
- lineno=> 3,
+ { type => 'text',
+ level => 0,
+ expr => 1,
+ text => '$foo->{bar}',
+ line => '= $foo->{bar}',
+ lineno => 3,
},
- { type => 'tag',
- level => 0,
- name => 'p',
- expr => 1,
- text => '$i',
- line => '%p= $i',
- lineno=> 4,
+ { type => 'tag',
+ level => 0,
+ name => 'p',
+ expr => 1,
+ text => '$i',
+ line => '%p= $i',
+ lineno => 4,
},
- { type => 'text',
- level => 0,
- line => '',
- lineno=> 5,
+ { type => 'text',
+ level => 0,
+ line => '',
+ lineno => 5,
}
]
);
@@ -450,12 +450,12 @@ $haml->parse(<<'EOF');
EOF
is_deeply(
$haml->tape,
- [ { type => 'text',
- level => 0,
- expr => 1,
- text => "'foo' if 1",
- line => "= 'foo' if 1",
- lineno=> 1,
+ [ { type => 'text',
+ level => 0,
+ expr => 1,
+ text => "'foo' if 1",
+ line => "= 'foo' if 1",
+ lineno => 1,
},
{ type => 'text',
level => 0,
@@ -473,10 +473,10 @@ is_deeply(
line => "!= '<noescape>'",
lineno => 3,
},
- { type => 'text',
- level => 0,
- line => '',
- lineno=> 4,
+ { type => 'text',
+ level => 0,
+ line => '',
+ lineno => 4,
}
]
);
@@ -489,16 +489,16 @@ EOF
is_deeply(
$haml->tape,
[ {type => 'tag', level => 0, name => 'foo', line => '%foo', lineno => 1},
- { type => 'text',
- level => 0,
- line => '',
- lineno=> 2,
+ { type => 'text',
+ level => 0,
+ line => '',
+ lineno => 2,
},
{type => 'tag', level => 0, name => 'bar', line => '%bar', lineno => 3},
- { type => 'text',
- level => 0,
- line => '',
- lineno=> 4,
+ { type => 'text',
+ level => 0,
+ line => '',
+ lineno => 4,
}
]
);
@@ -534,24 +534,24 @@ $haml->parse(<<'EOF');
EOF
is_deeply(
$haml->tape,
- [ { type => 'filter',
- level => 0,
- name => 'escaped',
- text => '<foo>',
- line => ":escaped\n <foo>",
- lineno=> '1-2',
+ [ { type => 'filter',
+ level => 0,
+ name => 'escaped',
+ text => '<foo>',
+ line => ":escaped\n <foo>",
+ lineno => '1-2',
},
- { type => 'filter',
- level => 0,
- name => 'preserve',
- text => "Hello\n\nthere.",
- line => ":preserve\n Hello\n\n there.",
- lineno=> '3-6',
+ { type => 'filter',
+ level => 0,
+ name => 'preserve',
+ text => "Hello\n\nthere.",
+ line => ":preserve\n Hello\n\n there.",
+ lineno => '3-6',
},
- { type => 'text',
- level => 0,
- line => '',
- lineno=> 7,
+ { type => 'text',
+ level => 0,
+ line => '',
+ lineno => 7,
}
]
);
Please sign in to comment.
Something went wrong with that request. Please try again.