I found the 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 the exclusion of any or all of '[' , ~ and ']' makes the grammar no longer relevant to my text.
Since I knew that the pattern was what I matched, I changed it so that the square brackets were around the text expression, like this:
token header { ^^ \h* '[' $<text>=<-[ \] \n ]>+ ']' \h* <.eol>+ }
So, it seems to me that the '[' ~ ']' really says that there is a square bracket, and after that a closing bracket is expected.
In any case, I know that the regular Perl 6 syntax uses the ~ tilde to concatenate strings. But this obviously means something else inside this grammar . (In Perl 6, you can use Grammars to extract complex data structures from text. They are like regular expressions taken to the next level.).
In any case, I was looking for documentation for Grammars and for Regular expressions for one ~ , but I did not find any inside the grammar or inside the regular expression.
intersection located at StackOverflow en español
source share