Skip to content

Commit

Permalink
Better handle hyphens and apostrophes after certain keywords (RT #646…
Browse files Browse the repository at this point in the history
…56).
  • Loading branch information
pmichaud committed Jul 21, 2009
1 parent b756ac9 commit ae29fbf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/parser/grammar.pg
Expand Up @@ -89,7 +89,7 @@ token unsp {
}

token unspacey { <.unsp>? }
token nofun { <!before '(' | '.(' | '\\' > }
token nofun { <!before '(' | '.(' | '\\' | '\'' | '-'> }

token unv {
|| \h+
Expand Down Expand Up @@ -390,7 +390,7 @@ rule statement_mod_cond {
}

rule statement_prefix {
$<sym>=[do|try|gather|contend|async|lazy]
$<sym>=[do|try|gather|contend|async|lazy]<.nofun>
<statement>
{*}
}
Expand All @@ -400,16 +400,16 @@ rule statement_prefix {

rule multi_declarator {
[
| $<sym>=[multi|proto|only] [ <declarator> || <routine_def> ]
| $<sym>=[multi|proto|only]<.nofun> [ <declarator> || <routine_def> ]
| <declarator>
]
{*}
}

token routine_declarator {
| $<sym>='sub' <routine_def> {*} #= sub
| $<sym>='method' <method_def> {*} #= method
| $<sym>='submethod' <method_def> {*} #= submethod
| $<sym>='sub' <.nofun> <routine_def> {*} #= sub
| $<sym>='method' <.nofun> <method_def> {*} #= method
| $<sym>='submethod' <.nofun> <method_def> {*} #= submethod
}

rule multisig {
Expand Down

0 comments on commit ae29fbf

Please sign in to comment.