1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00
Commit graph

6 commits

Author SHA1 Message Date
Matt Wildig
079a8c3a4e Add test for closing loud scripts
"Loud" script nodes aren’t being closed, and so the @script_stack_level
isn't popped correctly, causing parse errors:

    -if true
      =if true
        - 'A'
    -else
      B

gives "Syntax error on line 4: "else" is indented at wrong level:
expected 1, but was at 0."
2012-08-15 00:13:28 +01:00
Matt Wildig
3460dfe9c2 Add test for lous script for else
"Loud" script meaning script with `=`, as opposed to silent_script.
They should allow `else` clauses.
2012-08-10 19:43:23 +01:00
Matt Wildig
8a476a789d Add test for else after if with nested case/unless
See issue #572.

Add test for condition in #572 and similar case with nested unless.
2012-07-13 23:58:32 +01:00
Norman Clarke
016408d7b5 Raise Haml::SyntaxError for else with missing if 2012-06-27 15:16:03 -03:00
Matt Wildig
04ae44fb31 Handle indent errors unless
Raise an Haml::Error when an `else` or `elsif` is wrongly nested after
an `unless` as well as after `if`.

See #535.
2012-06-26 23:07:53 +01:00
Norman Clarke
9aa403b5bb Handle indent errors for if/else
Nesting an else or elsif at the wrong level will now raise a
Haml::Error. I've also added parser_test.rb to serve as the new home for
parser-specific tests; we'll eventually move some tests that are in
engine_test.rb there.

Resolves #535
2012-06-25 18:13:16 -03:00