Skip to content

Commit

Permalink
Refactor check for curly brace statement terminator.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Feb 28, 2009
1 parent dd9b61c commit 36314e0
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/parser/grammar.pg
Expand Up @@ -194,13 +194,7 @@ token stdstopper {
token eat_terminator {
|| ';'
|| <?terminator>
|| <?{{
$P0 = get_global '$!endstmt'
$P1 = get_global '$!ws'
$P2 = $P1.'from'()
$I0 = iseq $P0, $P2
.return ($I0)
}}>
|| <?AT_STATEMENT_END>
|| $
|| <.panic: "Statement not terminated properly">
}
Expand All @@ -213,6 +207,17 @@ token MARK_STATEMENT_END {
<.ws>
}

token AT_STATEMENT_END {
<?{{
$P0 = get_global '$!endstmt'
$P1 = get_global '$!ws'
$P2 = $P1.'from'()
$I0 = iseq $P0, $P2
.return ($I0)
}}>
}



## Parse a single statement, which may be either a bare block
## or an expression. Any statement termination is handled by
Expand Down

0 comments on commit 36314e0

Please sign in to comment.