Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
lose the battle, win the war
We'll just support smart quotes because auto-"correcting" clients aren't going away.
  • Loading branch information
TimToady committed Feb 23, 2015
1 parent 0966e98 commit a2a1afb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Perl6/Actions.nqp
Expand Up @@ -6038,7 +6038,9 @@ class Perl6::Actions is HLL::Actions does STDActions {
}

method quote:sym<apos>($/) { make $<nibble>.ast; }
method quote:sym<sapos>($/){ make $<nibble>.ast; }
method quote:sym<dblq>($/) { make $<nibble>.ast; }
method quote:sym<sdblq>($/){ make $<nibble>.ast; }
method quote:sym<crnr>($/) { make $<nibble>.ast; }
method quote:sym<qq>($/) { make $<quibble>.ast; }
method quote:sym<q>($/) { make $<quibble>.ast; }
Expand Down
8 changes: 8 additions & 0 deletions src/Perl6/Grammar.nqp
Expand Up @@ -3442,7 +3442,9 @@ grammar Perl6::Grammar is HLL::Grammar does STD {

proto token quote { <...> }
token quote:sym<apos> { :dba('single quotes') "'" ~ "'" <nibble(self.quote_lang(%*LANG<Q>, "'", "'", ['q']))> }
token quote:sym<sapos> { :dba('smart single quotes') "β€˜" ~ "’" <nibble(self.quote_lang(%*LANG<Q>, "β€˜", "’", ['q']))> }
token quote:sym<dblq> { :dba('double quotes') '"' ~ '"' <nibble(self.quote_lang(%*LANG<Q>, '"', '"', ['qq']))> }
token quote:sym<sdblq> { :dba('smart double quotes') 'β€œ' ~ '”' <nibble(self.quote_lang(%*LANG<Q>, 'β€œ', '”', ['qq']))> }
token quote:sym<crnr> { :dba('corner quotes') 'ο½’' ~ 'ο½£' <nibble(self.quote_lang(%*LANG<Q>, 'ο½’', 'ο½£'))> }
token quote:sym<q> {
:my $qm;
Expand Down Expand Up @@ -4611,9 +4613,15 @@ grammar Perl6::QGrammar is HLL::Grammar does STD {
token escape:sym<' '> {
<?[']> <quote=.LANG('MAIN','quote')>
}
token escape:sym<β€˜ ’> {
<?[β€˜]> <quote=.LANG('MAIN','quote')>
}
token escape:sym<" "> {
<?["]> <quote=.LANG('MAIN','quote')>
}
token escape:sym<β€œ ”> {
<?[β€œ]> <quote=.LANG('MAIN','quote')>
}
token escape:sym<colonpair> {
<?[:]> <colonpair=.LANG('MAIN','colonpair')>
}
Expand Down

0 comments on commit a2a1afb

Please sign in to comment.