Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds unless and elsif support #27

Merged
merged 1 commit into from
Apr 6, 2016
Merged

Conversation

tcsc
Copy link
Contributor

@tcsc tcsc commented Mar 29, 2016

Adds unless support (see #23) to the if_block.rs module. Also adds
support for elsif blocks in an if, which are parsed into
recursive else blocks.

Also adds a sub-block aware splitter function that can be used to
split a tag body on any of a set of delimiters, where the split is
guaranteed to happen at the top levek of nesting (e.g, attempting
to split the tokens inside an if block on an else is guaranteed
to split the token stream only on an else block at the same
nesting level as the if (as opposed to, say, the else block of
a for_loop nested inside the body of the if).

@johannhof
Copy link
Contributor

I merged your #26, wanna rebase? :)

@tcsc
Copy link
Contributor Author

tcsc commented Mar 29, 2016

Rebased.

@tcsc tcsc force-pushed the unless branch 4 times, most recently from e8db609 to f8c7d1c Compare March 30, 2016 13:07
Adds `unless` support to the if_block.rs module. Also adds
support for `elsif` blocks in an `if`, which are parsed into
recursive else blocks.

Also adds a sub-block aware splitter function that can be used to
split a tag body on any of a set of delimiters, where the split is
guaranteed to happen at the top levek of nesting (e.g, attempting
to split the tokens inside an `if` block on an `else` is guaranteed
to split the token stream only on an  `else` block at the same
nesting level as the `if` (as opposed to, say, the `else` block of
a `for_loop` nested inside the body of the `if`).

Rewrites the `for_loop` parser to use the new sub-block aware
splitter.
@johannhof
Copy link
Contributor

Sorry, took me a while to look at this but I wanted to be sure I understand the BlockSplit concept. I think I can live with this solution, thanks for the effort!

@johannhof johannhof merged commit b0a6e82 into cobalt-org:master Apr 6, 2016
@johannhof johannhof mentioned this pull request Apr 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants