Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Cleaning up "Separating statements by semicolons"
Trying to address #1477
  • Loading branch information
molecules committed Aug 30, 2017
1 parent 9b26feb commit 4d069f9
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions doc/Language/syntax.pod6
Expand Up @@ -74,19 +74,27 @@ routine argument lists.
=head2 Separating Statements with Semicolons
A Perl 6 program is a list of statements, separated by semicolons C<;>.
=begin code
say "Hello";
say "world";
=end code
A semicolon after the final statement (or after the final statement inside a
block) is optional, though it's good form to include it.
block) is optional.
=begin code
say "Hello";
say "world"
=end code
=begin code
if True {
say "Hello";
say "Hello"
}
say "world";
say "world"
=end code
Both semicolons are optional here, but leaving them out increases the chance
of syntax errors when adding more lines later.
=head2 Implied Separator Rule (for statements ending in blocks)
Complete statements ending in blocks can omit the trailing semicolon, if no
Expand Down

0 comments on commit 4d069f9

Please sign in to comment.