Created
July 12, 2015 21:32
-
-
Save yorickpeterse/a8a6c9ba6be60d687bf8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test, predicate = *ast | |
catch_arg = symbol(:predicate_matched) | |
process(test, input) do |matched_test_node| | |
catch_var = literal('predicate_matched') | |
catch_block = send_message('catch', catch_arg).add_block do | |
process(predicate, matched_test_node) do | |
send_message('throw', catch_arg, literal('true')) | |
end | |
end | |
catch_var.assign(catch_block) | |
.followed_by(catch_var.if_true { yield matched_test_node }) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment