Skip to content

Commit 6304b24

Browse files
committed
Now files that start with 'a' letter can be compiled.
I'm not sure about Type/IO/Socket/Async, since it contains examples that are running infinitely. Because of that I just skipped this pieces of code, but it will be great if someone can find more awesome solution. Rest of the changes is trivial: empty bodies for a method signatures, catching of exceptions with formatted output and some skipping for console-line command, etc.
1 parent 14a6114 commit 6304b24

File tree

10 files changed

+46
-34
lines changed

10 files changed

+46
-34
lines changed

doc/Language/about.pod6

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,16 @@ highlighting
3939
4040
Then, to generate the documentation into the C<html/> folder, run:
4141
42+
=begin code :skip-test
4243
perl6 htmlify.p6
44+
=end code
4345
4446
Currently, to serve the generated documentation for your browser, Perl 5
4547
with Mojolicious::Lite must be installed. Then run:
4648
49+
=begin code :skip-test
4750
perl app.pl daemon
51+
=end code
4852
4953
=head1 Contributing
5054
@@ -57,7 +61,7 @@ All of the paragraphs and blocks following that directive, up until the
5761
next directive of the same level, will be considered part of the
5862
documentable. So, in:
5963
60-
=begin code :allow<R>
64+
=begin code :allow<R> :skip-test
6165
=head2 R<My Definition>
6266
6367
Some paragraphs, followed by some code:

doc/Type/IO/Socket/Async.pod6

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ server and the client side.
1212
Here is the equivalent example to that in L<IO::Socket::INET> of a simple
1313
echo server that listens on port 3333:
1414
15-
=begin code
15+
=begin code :skip-test
1616
use v6;
1717
1818
react {
@@ -26,7 +26,7 @@ react {
2626
2727
And a client that connects to it, and prints out what the server answers:
2828
29-
=begin code
29+
=begin code :skip-test
3030
use v6;
3131
3232
await IO::Socket::Async.connect('localhost', 3333).then( -> $p {
@@ -48,7 +48,7 @@ await IO::Socket::Async.connect('localhost', 3333).then( -> $p {
4848
Alternatively L<IO::Socket::Async> can send and receive UDP messages.
4949
An example server that outputs all the data it receives would be:
5050
51-
=begin code
51+
=begin code :skip-test
5252
my $socket = IO::Socket::Async.bind-udp('localhost', 3333);
5353
5454
react {
@@ -62,7 +62,7 @@ react {
6262
6363
And an associated client might be:
6464
65-
=begin code
65+
=begin code :skip-test
6666
6767
my $socket = IO::Socket::Async.udp();
6868
await $socket.print-to('localhost', 3333, "Hello, Perl 6!");
@@ -77,14 +77,14 @@ data,) should be used to create a client or a server respectively.
7777
7878
=head2 method connect
7979
80-
method connect(Str $host, Int $port) returns Promise
80+
method connect(Str $host, Int $port) returns Promise {}
8181
8282
Attempts to connect to the TCP server specified by C<$host> and C<$port>,
8383
returning a L<Promise> that will either be kept with a connected L<IO::Socket::Async> or broken if the connection cannot be made.
8484
8585
=head2 method listen
8686
87-
method listen(Str $host, Int $port) returns Supply
87+
method listen(Str $host, Int $port) returns Supply {}
8888
8989
Creates a listening socket on the specified C<$host> and C<$port>, returning
9090
a L<Supply> to which the accepted client L<IO::Socket::Async>s will be C<emit>ted. This L<Supply> should be tapped to
@@ -95,7 +95,7 @@ should be C<close>d.
9595
9696
=head2 method udp
9797
98-
method udp(IO::Socket::Async:U: :$broadcast ) returns IO::Socket::Async
98+
method udp(IO::Socket::Async:U: :$broadcast ) returns IO::Socket::Async {}
9999
100100
Returns an initialised C<IO::Socket::Async> client object that is
101101
configured to send UDP messages using C<print-to> or C<write-to>. The
@@ -104,7 +104,7 @@ the socket to send packets to a broadcast address.
104104
105105
=head2 method bind-udp
106106
107-
method bind-udp(IO::Socket::Async:U: Str() $host, Int() $port, :$broadcast) returns IO::Socket::Async
107+
method bind-udp(IO::Socket::Async:U: Str() $host, Int() $port, :$broadcast) returns IO::Socket::Async {}
108108
109109
This returns an initialised C<IO::Socket::Async> server object that is
110110
configured to receive UDP messages sent to the specified C<$host> and C<$port>
@@ -114,7 +114,7 @@ address.
114114
115115
=head2 method print
116116
117-
method print(Str $str) returns Promise
117+
method print(Str $str) returns Promise {}
118118
119119
Attempt to send C<$str> on the L<IO::Socket::Async> that will
120120
have been obtained indirectly via C<connect> or C<listen>, returning a
@@ -123,7 +123,7 @@ sent or broken if there was an error sending.
123123
124124
=head2 method print-to
125125
126-
method print-to(IO::Socket::Async:D: Str() $host, Int() $port, Str() $str) returns Promise
126+
method print-to(IO::Socket::Async:D: Str() $host, Int() $port, Str() $str) returns Promise {}
127127
128128
This is the equivalent of C<print> for UDP sockets that have been created with
129129
the C<udp> method, it will try send a UDP message of C<$str> to the specified
@@ -134,7 +134,7 @@ have been specified when the socket was created.
134134
135135
=head2 method write
136136
137-
method write(Blob $b) returns Promise
137+
method write(Blob $b) returns Promise {}
138138
139139
Attempt to send the bytes in C<$b> on the L<IO::Socket::Async> that will
140140
have been obtained indirectly via C<connect> or C<listen>, returning a
@@ -143,7 +143,7 @@ sent or broken if there was an error sending.
143143
144144
=head2 method write-to
145145
146-
method write-to(IO::Socket::Async:D: Str() $host, Int() $port, Blob $b) returns Promise
146+
method write-to(IO::Socket::Async:D: Str() $host, Int() $port, Blob $b) returns Promise {}
147147
148148
This is the equivalent of C<write> for UDP sockets that have been created
149149
with the C<udp> method, it will try send a UDP message comprised of
@@ -155,7 +155,7 @@ flag must have been specified when the socket was created.
155155
156156
=head2 method Supply
157157
158-
method Supply(:$bin, :$buf = buf8.new) returns Supply
158+
method Supply(:$bin, :$buf = buf8.new) returns Supply {}
159159
160160
Returns a L<Supply> which can be tapped to obtain the data read from
161161
the connected L<IO::Socket::Async> as it arrives. By default the data
@@ -165,7 +165,7 @@ case you can provide your own C<Buf> with the C<:buf> named parameter.
165165
166166
=head2 method close
167167
168-
method close()
168+
method close() {}
169169
170170
Close the connected client L<IO::Socket::Async> which will have been
171171
obtained from the C<listen> L<Supply> or the C<connect>

doc/Type/Setty.pod6

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ See L<Set> and L<SetHash>.
1313
1414
=head2 method grab
1515
16-
method grab($count = 1)
16+
method grab($count = 1) {}
1717
1818
Removes and returns C<$count> elements chosen at random (without repetition)
1919
from the set.
@@ -26,7 +26,7 @@ exception.
2626
2727
=head2 method grabpairs
2828
29-
method grabpairs($count = 1)
29+
method grabpairs($count = 1) {}
3030
3131
Removes C<$count> elements chosen at random (without repetition) from the set,
3232
and returns a list of C<Pair> objects whose keys are the grabbed elements and
@@ -41,7 +41,7 @@ exception.
4141
4242
=head2 method pick
4343
44-
multi method pick($count = 1)
44+
multi method pick($count = 1) {}
4545
4646
Returns C<$count> elements chosen at random (without repetition) from the set.
4747
@@ -50,7 +50,7 @@ size of the set, then all its elements are returned in random order.
5050
5151
=head2 method roll
5252
53-
multi method roll($count = 1)
53+
multi method roll($count = 1) {}
5454
5555
Returns a lazy list of C<$count> elements, each randomly selected from the set.
5656
Each random choice is made independently, like a separate die roll where each
@@ -72,20 +72,20 @@ Returns a list of the set's elements and C<True> values interleaved.
7272
7373
=head2 method elems
7474
75-
method elems(--> Int)
75+
method elems(--> Int) {}
7676
7777
The number of elements of the set.
7878
7979
=head2 method total
8080
81-
method total(--> Int)
81+
method total(--> Int) {}
8282
8383
The total of all the values of the C<QuantHash> object. For a C<Setty>
8484
object, this is just the number of elements.
8585
8686
=head2 method ACCEPTS
8787
88-
method ACCEPTS($other)
88+
method ACCEPTS($other) {}
8989
9090
Returns C<True> if C<$other> and C<self> contain all the same elements,
9191
and no others.

doc/Type/X/AdHoc.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ C<.message> method, which all C<Exception>s must have, is preferable.
3333
3434
=head2 method payload
3535
36-
method payload(X::AdHoc:D)
36+
method payload(X::AdHoc:D) {}
3737
3838
Returns the original object which was passed to C<die>.
3939

doc/Type/X/Anon/Augment.pod6

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,23 @@ Compile time error thrown when trying to augment an anonymous package.
1010
1111
For example
1212
13+
=begin code :skip-test
1314
use MONKEY-TYPING;
1415
augment class { }
16+
=end code
1517
1618
Dies with
1719
20+
=begin code :skip-test
1821
===SORRY!===
1922
Cannot augment anonymous class
23+
=end code
2024
2125
=head1 Methods
2226
2327
=head2 method package-kind
2428
25-
method package-kind returns Str:D
29+
method package-kind returns Str:D {}
2630
2731
Returns the kind of package (module, class, grammar, ...) that the code
2832
tried to augment.

doc/Type/X/Assignment/RO.pod6

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Code like
1010
1111
sub f() { 42 };
1212
f() = 'new value'; # throws an X::Assignment::RO
13+
CATCH { default { put .^name, ': ', .Str } };
14+
# OUTPUT: «X::Assignment::RO: Cannot modify an immutable Any␤»
1315
1416
throws an exception of type C<X::Assignment::RO>.
1517

doc/Type/X/Proc/Async.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ All exceptions thrown by L<Proc::Async> do this common role.
1212
1313
=head2 method proc
1414
15-
method fproc(X::Proc::Async:D) returns Proc::Async
15+
method fproc(X::Proc::Async:D) returns Proc::Async {}
1616
1717
Returns the object that threw the exception.
1818

doc/Type/X/Proc/Async/AlreadyStarted.pod6

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ C<X::Proc::Async::AlreadyStarted> exception.
1212
1313
my $proc = Proc::Async.new("echo");
1414
$proc.start;
15-
$proc.start; # Process has already been started
15+
$proc.start;
16+
CATCH { default { put .^name, ': ', .Str } };
17+
# OUTPUT: «X::Proc::Async::AlreadyStarted: Process has already been started␤»
1618
1719
=end pod

doc/Type/X/Syntax/Regex/Adverb.pod6

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,24 @@ encountered.
1111
1212
For example C<rx:g/a/> dies with
1313
14+
=begin code :skip-test
1415
===SORRY!===
1516
Adverb g not allowed on rx
17+
=end code
1618
1719
because C<:g> belongs to a match operation, not a regex itself.
1820
1921
=head1 Methods
2022
2123
=head2 method adverb
2224
23-
method adverb() returns Str:D
25+
method adverb() returns Str:D {}
2426
2527
Returns the illegally used adverb
2628
2729
=head2 method construct
2830
29-
method construct() returns Str:D
31+
method construct() returns Str:D {}
3032
3133
Returns the name of the construct that adverb was used on (C<m>, C<ms>,
3234
C<rx>, C<s>, C<ss>).

doc/Type/X/TypeCheck/Assignment.pod6

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@
88
99
Error class thrown when the type check of an assignment fails.
1010
11-
For example
11+
For example, this will die
1212
13-
my Int $x = "foo"
14-
15-
dies with
16-
17-
Type check failed in assignment to '$x'; expected 'Int' but got 'Str'
13+
my Int $x = "foo";
14+
CATCH { default { put .^name, ': ', .Str } };
15+
# OUTPUT: «X::Assignment::RO: Cannot modify an immutable Any␤»
1816
1917
though compilers are allowed to detect obvious cases like this example
2018
and complain at compile time with a different error.

0 commit comments

Comments
 (0)