I found a tilde ~
in this Config::INI Perl 6 Grammar:
token header { ^^ \h* '[' ~ ']' $<text>=<-[ \] \n ]>+ \h* <.eol>+ }
There are no tildes ~
in the text I am processing. I know that '[' ~ ']'
is important because omitting any or all of '['
, ~
, and ']'
makes the grammar no longer match my text.
Since I knew what the pattern was that I was matching, I changed it so that the square brackets were around the text expression, thus:
token header { ^^ \h* '[' $<text>=<-[ \] \n ]>+ ']' \h* <.eol>+ }
So it seems to me that '[' ~ ']'
is really saying match a square bracket here and expect the closing bracket afterwards.
Anyway, I know that in normal Perl 6 syntax, the tilde ~
is used for concatenating strings. But this obviously means something different inside this Grammar. (In Perl 6, you can use Grammars to extract complicated data structures from text. They are like regular expressions taken to the next level.).
Anyway, I searched the documentation for Grammars and for Regular Expressions for a single ~
, but I didn't find any inside a grammar nor inside a regular expression.