Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Rename <escape> subrule to <quote_escape>.
  • Loading branch information
pmichaud committed Oct 31, 2009
1 parent 2e786f4 commit 1e17347
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
18 changes: 9 additions & 9 deletions src/HLL/Actions.pm
Expand Up @@ -163,22 +163,22 @@ method quote_delimited($/) {
}

method quote_atom($/) {
make $<escape> ?? $<escape>.ast !! ~$/;
make $<quote_escape> ?? $<quote_escape>.ast !! ~$/;
}

method escape:sym<backslash>($/) { make "\\"; }
method escape:sym<stopper>($/) { make ~$<stopper> }
method quote_escape:sym<backslash>($/) { make "\\"; }
method quote_escape:sym<stopper>($/) { make ~$<stopper> }

method escape:sym<bs>($/) { make "\b"; }
method escape:sym<nl>($/) { make "\n"; }
method escape:sym<cr>($/) { make "\r"; }
method escape:sym<tab>($/) { make "\t"; }
method quote_escape:sym<bs>($/) { make "\b"; }
method quote_escape:sym<nl>($/) { make "\n"; }
method quote_escape:sym<cr>($/) { make "\r"; }
method quote_escape:sym<tab>($/) { make "\t"; }

method escape:sym<hex>($/) {
method quote_escape:sym<hex>($/) {
make ints_to_string( $<hexint> ?? $<hexint> !! $<hexints><hexint> );
}

method escape:sym<oct>($/) {
method quote_escape:sym<oct>($/) {
make ints_to_string( $<octint> ?? $<octint> !! $<octints><octint> );
}

24 changes: 12 additions & 12 deletions src/HLL/Grammar.pm
Expand Up @@ -34,8 +34,8 @@ grammar HLL::Grammar;
token quote_atom {
<!stopper>
[
| <escape>
| [ <-escape-stopper> ]+
| <quote_escape>
| [ <-quote_escape-stopper> ]+
]
}

Expand All @@ -56,23 +56,23 @@ grammar HLL::Grammar;
]
}

proto token escape { <...> }
token escape:sym<backslash> { \\ \\ <?quotemod_check('q')> }
token escape:sym<stopper> { \\ <?quotemod_check('q')> <stopper> }
proto token quote_escape { <...> }
token quote_escape:sym<backslash> { \\ \\ <?quotemod_check('q')> }
token quote_escape:sym<stopper> { \\ <?quotemod_check('q')> <stopper> }

token escape:sym<bs> { \\ b <?quotemod_check('b')> }
token escape:sym<nl> { \\ n <?quotemod_check('b')> }
token escape:sym<cr> { \\ r <?quotemod_check('b')> }
token escape:sym<tab> { \\ t <?quotemod_check('b')> }
token escape:sym<hex> {
token quote_escape:sym<bs> { \\ b <?quotemod_check('b')> }
token quote_escape:sym<nl> { \\ n <?quotemod_check('b')> }
token quote_escape:sym<cr> { \\ r <?quotemod_check('b')> }
token quote_escape:sym<tab> { \\ t <?quotemod_check('b')> }
token quote_escape:sym<hex> {
\\ x <?quotemod_check('b')>
[ <hexint> | '[' <hexints> ']' ]
}
token escape:sym<oct> {
token quote_escape:sym<oct> {
\\ o <?quotemod_check('b')>
[ <octint> | '[' <octints> ']' ]
}
token escape:sym<chr> { \\ c <?quotemod_check('b')> <charspec> }
token quote_escape:sym<chr> { \\ c <?quotemod_check('b')> <charspec> }

token charname {
|| <integer>
Expand Down

0 comments on commit 1e17347

Please sign in to comment.