Files
2025-10-25 03:02:53 +03:00

36 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[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.4Compound 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.4Compound statement or block[stmt.block]")
{ [*statement-seq*](#nt:statement-seq "8.4Compound statement or block[stmt.block]")opt [*label-seq*](#nt:label-seq "8.4Compound statement or block[stmt.block]")opt }
[statement-seq:](#nt:statement-seq "8.4Compound statement or block[stmt.block]")
[*statement*](stmt.pre#nt:statement "8.1Preamble[stmt.pre]") [*statement-seq*](#nt:statement-seq "8.4Compound statement or block[stmt.block]")opt
[label-seq:](#nt:label-seq "8.4Compound statement or block[stmt.block]")
[*label*](stmt.label#nt:label "8.2Label[stmt.label]") [*label-seq*](#nt:label-seq "8.4Compound statement or block[stmt.block]")opt
A label at the end of a [*compound-statement*](#nt:compound-statement "8.4Compound 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.4Scope"))[.](#2.sentence-1)
A declaration is a [*statement*](stmt.pre#nt:statement "8.1Preamble[stmt.pre]") ([[stmt.dcl]](stmt.dcl "8.10Declaration statement"))[.](#2.sentence-2)
— *end note*]