Permalink
Browse files

Blocks

  • Loading branch information...
1 parent c37ddf1 commit 0cfde50231318e1670ebc731de7f69b371aad6f6 Brian Gernhardt committed Jan 25, 2011
Showing with 12 additions and 2 deletions.
  1. +9 −1 cish/src/cish/Actions.pm
  2. +3 −1 cish/src/cish/Grammar.pm
@@ -13,7 +13,15 @@ method TOP($/) {
}
method statement($/) {
- make $<simple>.ast;
+ if $<block> {
+ make $<block>.ast;
+ } else {
+ make $<simple>.ast;
+ }
+}
+
+method block($/) {
+ make past_block($/, $<statement>);
}
method simple($/) {
@@ -22,9 +22,11 @@ token ws {
## Statements
rule statement {
- <simple> ';'
+ <block> | <simple> ';'
}
+rule block { '{' <statement>* '}' }
+
rule simple {
| <builtin>
| <EXPR>

0 comments on commit 0cfde50

Please sign in to comment.