Skip to content

Commit f6fc962

Browse files
committed
Begin documenting Q
1 parent 8fe2c15 commit f6fc962

File tree

1 file changed

+50
-2
lines changed

1 file changed

+50
-2
lines changed

lib/terms.pod

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,23 @@ L<Num> with value C<3 * 10**8>.
4242
4343
=head2 Str
4444
45-
see the section on quoting constructs below.
45+
'a string'
46+
'I\'m escaped!'
47+
"I don't need to be"
48+
"\"But I still can be,\" he said."
49+
q|Other delimters can be used too!|
50+
51+
String literals are most often created with C<'> or C<">, but strings
52+
are actually a powerful sub-language of Perl 6. See the section on
53+
quoting constructs below.
4654
4755
=head2 Regex
4856
49-
see the section on quoting constructs below.
57+
/ match some text /
58+
rx/slurp \s rest (.*) $/
59+
60+
These forms produce regex literals. See the section on quoting
61+
constructs below as well as L<the documentation on regexes|regexes>.
5062
5163
=head2 Pair
5264
@@ -91,8 +103,44 @@ list, or several quoting constructs
91103
92104
=head1 Quoting constructs
93105
106+
=head2 The Q Lang
107+
108+
Quoting constructs make up a sub-language of Perl 6, which are based of
109+
the simplest form, usable via the shortcut C<「…」>, or via C<Q> and any pair of delimiters.
110+
111+
Q[A literal string]
112+
「More plainly.」
113+
Q ^Almost any non-word character can be a delimiter!^
114+
115+
Delimiters can nested, but in the plain C<Q> form, backslash escapes aren't allowed.
116+
117+
Q<Make sure you <match> opening and closing delimiters>
118+
Q{This is still a closing brace → \}
119+
120+
=head3 Backslashes: :q
121+
122+
TODO
123+
124+
=head3 Interpolation: :qq
125+
94126
TODO
95127
128+
=head3 Word quoting: :qw
129+
130+
TODO
131+
132+
=head3 Shell quoting: :qqw
133+
134+
TODO
135+
136+
=head3 Heredocs: :to
137+
138+
TODO
139+
140+
=head2 Regexes
141+
142+
TODO -- or just point to regexes.pod?
143+
96144
=head1 Identifier terms
97145
98146
There are built-in identifier terms in Perl 6, which are listed below.

0 commit comments

Comments
 (0)