36 lines
1.7 KiB
Markdown
36 lines
1.7 KiB
Markdown
[stmt.block]
|
||
|
||
# 8 Statements [[stmt]](./#stmt)
|
||
|
||
## 8.4 Compound statement or block [stmt.block]
|
||
|
||
[1](#1)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/statements.tex#L243)
|
||
|
||
A [*compound statement*](#def:statement,compound "8.4 Compound statement or block [stmt.block]") (also known as a block) groups a
|
||
sequence of statements into a single statement[.](#1.sentence-1)
|
||
|
||
[compound-statement:](#nt:compound-statement "8.4 Compound statement or block [stmt.block]")
|
||
{ [*statement-seq*](#nt:statement-seq "8.4 Compound statement or block [stmt.block]")opt [*label-seq*](#nt:label-seq "8.4 Compound statement or block [stmt.block]")opt }
|
||
|
||
[statement-seq:](#nt:statement-seq "8.4 Compound statement or block [stmt.block]")
|
||
[*statement*](stmt.pre#nt:statement "8.1 Preamble [stmt.pre]") [*statement-seq*](#nt:statement-seq "8.4 Compound statement or block [stmt.block]")opt
|
||
|
||
[label-seq:](#nt:label-seq "8.4 Compound statement or block [stmt.block]")
|
||
[*label*](stmt.label#nt:label "8.2 Label [stmt.label]") [*label-seq*](#nt:label-seq "8.4 Compound statement or block [stmt.block]")opt
|
||
|
||
A label at the end of a [*compound-statement*](#nt:compound-statement "8.4 Compound statement or block [stmt.block]") is treated as if it were followed by a null statement[.](#1.sentence-2)
|
||
|
||
[2](#2)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/statements.tex#L265)
|
||
|
||
[*Note [1](#note-1)*:
|
||
|
||
A compound statement defines a block scope ([[basic.scope]](basic.scope "6.4 Scope"))[.](#2.sentence-1)
|
||
|
||
A declaration is a [*statement*](stmt.pre#nt:statement "8.1 Preamble [stmt.pre]") ([[stmt.dcl]](stmt.dcl "8.10 Declaration statement"))[.](#2.sentence-2)
|
||
|
||
â *end note*]
|