Skip to content

Commit 17784d7

Browse files
authored
Merge pull request #2019 from xushiwei/q
mini spec: Label scopes, Blank identifier
2 parents 743944a + 0b4eb42 commit 17784d7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

doc/spec-mini.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,6 +1764,15 @@ The [package clause]() is not a declaration; the package name does not appear in
17641764

17651765
### Label scopes
17661766

1767+
Labels are declared by [labeled statements](#labeled-statements) and are used in the "[break](#break-statements)", "[continue](#continue-statements)", and "[goto](#goto-statements)" statements. It is illegal to define a label that is never used. In contrast to other identifiers, labels are not block scoped and do not conflict with identifiers that are not labels. The scope of a label is the body of the function in which it is declared and excludes the body of any nested function.
1768+
1769+
1770+
### Blank identifier
1771+
1772+
The _blank identifier_ is represented by the underscore character `_`. It serves as an anonymous placeholder instead of a regular (non-blank) identifier and has special meaning in [declarations](#declarations-and-scope), as an [operand](), and in [assignment statements](#assignment-statements).
1773+
1774+
### Predeclared identifiers
1775+
17671776
TODO
17681777

17691778

0 commit comments

Comments
 (0)