Skip to content

Commit d6f2079

Browse files
committed
Unless more are found, all braces have been fixed
I don't know, however, about closing the issue #2114. Several problems * We need a generic name that includes parentheses/braces/brackets * Do we need/want the test? It might include some verbosity * Sometimes parentheses (plural) is spelled parenthesis (singular).
1 parent 4e3b3d8 commit d6f2079

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

doc/Language/regexes.pod6

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,8 @@ Note that neither the colon C<:> nor balancing delimiters such as C<{}> or
11701170
C<()> can be substitution delimiters. Colons clash with adverbs such as
11711171
C<s:i/Foo/bar/> and the other delimiters are used for other purposes.
11721172
1173-
If you use balancing brackets, the substitution works like this instead:
1173+
If you use balancing brackets/braces/parentheses, the substitution works like
1174+
this instead:
11741175
11751176
s[replace] = 'with';
11761177
@@ -1610,7 +1611,7 @@ Whereas these two are not:
16101611
my $rx3 = rx/a :i b/; # matches only the b case insensitively
16111612
my $rx4 = rx/:i a b/; # matches completely case insensitively
16121613
1613-
Brackets and parentheses limit the scope of an adverb:
1614+
Square brackets and parentheses limit the scope of an adverb:
16141615
16151616
/ (:i a b) c /; # matches 'ABc' but not 'ABC'
16161617
/ [:i a b] c /; # matches 'ABc' but not 'ABC'
@@ -1958,10 +1959,10 @@ to the more readable
19581959
}
19591960
19601961
As a rule of thumb, use whitespace around atoms and inside groups; put
1961-
quantifiers directly after the atom; and vertically
1962-
align opening and closing brackets and parentheses.
1962+
quantifiers directly after the atom; and vertically align opening and closing
1963+
square brackets and parentheses.
19631964
1964-
When you use a list of alternations inside a parenthesis or brackets, align
1965+
When you use a list of alternations inside parentheses or square brackets, align
19651966
the vertical bars:
19661967
19671968
my regex example {
@@ -2036,8 +2037,8 @@ restrictive. Somebody might write C<[two words]>, or use dashes, etc.
20362037
Instead of asking what's allowed on the inside, it might be worth asking
20372038
instead: I<what's not allowed?>
20382039
2039-
Clearly, closing brackets are not allowed, because C<[a]b]> would be
2040-
ambiguous. By the same argument, opening brackets should be forbidden.
2040+
Clearly, closing square brackets are not allowed, because C<[a]b]> would be
2041+
ambiguous. By the same argument, opening square brackets should be forbidden.
20412042
This leaves us with
20422043
20432044
token header { '[' <-[ \[\] ]>+ ']' }

0 commit comments

Comments
 (0)