File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -941,12 +941,26 @@ match and so usually contains objects of type L<Match>.
941
941
say $/.Str; # abc
942
942
943
943
The C < Grammar.parse > method also sets the caller's C < $/ > to the resulting
944
- L < Match > object.
944
+ L < Match > object. For the following code:
945
945
946
- use XML;
947
- XML.parse(slurp "filename.xml")
946
+ use XML::Grammar; # panda install XML
947
+ XML.Grammar. parse("<p>some text</p>");
948
948
say $/;
949
949
950
+ the output is:
951
+
952
+ 「<p>some text</p>」
953
+ root => 「<p>some text</p>」
954
+ name => 「p」
955
+ child => 「some text」
956
+ text => 「some text」
957
+ textnode => 「some text」
958
+ element => 「<p>some text</p>」
959
+ name => 「p」
960
+ child => 「some text」
961
+ text => 「some text」
962
+ textnode => 「some text」
963
+
950
964
= head4 X « Positional Attributes|variable,$0;variable,$1;variable,@() »
951
965
952
966
C < $/ > can have positional attributes if the L < Regex|regex > had
You can’t perform that action at this time.
0 commit comments