Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

\x{} now recommends \x[]

  • Loading branch information...
commit b469b4232614f9bbf891cc9c85af43f8a715c0bb 1 parent 8adbc60
Larry Wall TimToady authored

Showing 1 changed file with 9 additions and 6 deletions. Show diff stats Hide diff stats

  1. +9 6 STD.pm6
15 STD.pm6
@@ -425,6 +425,7 @@ token charspec {
425 425 | :dba('character name') '[' ~ ']' <charnames>
426 426 | \d+
427 427 | <[ ?..Z \\.._ ]>
  428 + | <.obsbrack>
428 429 | <?> <.sorry: "Unrecognized \\c character"> .
429 430 ]
430 431 }
@@ -849,6 +850,8 @@ token rad_number {
849 850 ]
850 851 }
851 852
  853 +token obsbrack { '{' <.obs('curly brackets','square brackets')> }
  854 +
852 855 token terminator:sym<)>
853 856 { <sym> <O(|%terminator)> }
854 857
@@ -4290,10 +4293,10 @@ grammar Q is STD {
4290 4293 <sym>
4291 4294 [ <?before '{'> <.worryobs('\N{...}', '\c[...]')> ]?
4292 4295 }
4293   - token backslash:o { :dba('octal character') <sym> [ <octint> | '[' ~ ']' <octints> ] }
  4296 + token backslash:o { :dba('octal character') <sym> [ <octint> | '[' ~ ']' <octints> ] | <.obsbrack> }
4294 4297 token backslash:r { <sym> }
4295 4298 token backslash:t { <sym> }
4296   - token backslash:x { :dba('hex character') <sym> [ <hexint> | '[' ~ ']' <hexints> ] }
  4299 + token backslash:x { :dba('hex character') <sym> [ <hexint> | '[' ~ ']' <hexints> | <.obsbrack> ] }
4297 4300 token backslash:sym<0> { <sym> }
4298 4301 }
4299 4302
@@ -4464,13 +4467,13 @@ grammar Q is STD {
4464 4467 token backslash:f { :i <sym> }
4465 4468 token backslash:h { :i <sym> { $*CCSTATE = '' } }
4466 4469 token backslash:n { :i <sym> }
4467   - token backslash:o { :i :dba('octal character') <sym> [ <octint> | '[' ~ ']' <octints> ] }
  4470 + token backslash:o { :i :dba('octal character') <sym> [ <octint> | '[' ~ ']' <octints> | <.obsbrack> ] }
4468 4471 token backslash:r { :i <sym> }
4469 4472 token backslash:s { :i <sym> { $*CCSTATE = '' } }
4470 4473 token backslash:t { :i <sym> }
4471 4474 token backslash:v { :i <sym> { $*CCSTATE = '' } }
4472 4475 token backslash:w { :i <sym> { $*CCSTATE = '' } }
4473   - token backslash:x { :i :dba('hex character') <sym> [ <hexint> | '[' ~ ']' <hexints> ] }
  4476 + token backslash:x { :i :dba('hex character') <sym> [ <hexint> | '[' ~ ']' <hexints> ] | <.obsbrack> }
4474 4477 token backslash:sym<0> { <sym> }
4475 4478
4476 4479 # keep random backslashes like qq does
@@ -5127,7 +5130,7 @@ grammar Regex is STD {
5127 5130 <sym> <.SIGOK>
5128 5131 [ <?before '{'> <.worryobs('\N{...}', '\c[...], or disambiguate with whitespace')> ]?
5129 5132 }
5130   - token backslash:o { :i :dba('octal character') <sym> [ <octint> | '[' ~ ']' <octints> ] <.SIGOK> }
  5133 + token backslash:o { :i :dba('octal character') <sym> [ <octint> | '[' ~ ']' <octints> | <.obsbrack> ] <.SIGOK> }
5131 5134 token backslash:p {
5132 5135 :my $s;
5133 5136 :my $m;
@@ -5146,7 +5149,7 @@ grammar Regex is STD {
5146 5149 token backslash:t { :i <sym> <.SIGOK> }
5147 5150 token backslash:v { :i <sym> <.SIGOK> }
5148 5151 token backslash:w { :i <sym> <.SIGOK> }
5149   - token backslash:x { :i :dba('hex character') <sym> [ <hexint> | '[' ~ ']' <hexints> ] <.SIGOK> }
  5152 + token backslash:x { :i :dba('hex character') <sym> [ <hexint> | '[' ~ ']' <hexints> | <.obsbrack> ] <.SIGOK> }
5150 5153 token backslash:z { <sym> <.obs('\\z as end-of-string matcher', '$')> }
5151 5154 token backslash:Z { <sym> <.obs('\\Z as end-of-string matcher', '\\n?$')> }
5152 5155 token backslash:misc { $<litchar>=(\W) <.SIGOK> }

0 comments on commit b469b42

Please sign in to comment.
Something went wrong with that request. Please try again.