Skip to content

Commit

Permalink
Merge pull request #2019 from xushiwei/q
Browse files Browse the repository at this point in the history
mini spec: Label scopes, Blank identifier
  • Loading branch information
xushiwei authored Nov 20, 2024
2 parents 743944a + 0b4eb42 commit 17784d7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions doc/spec-mini.md
Original file line number Diff line number Diff line change
Expand Up @@ -1764,6 +1764,15 @@ The [package clause]() is not a declaration; the package name does not appear in

### Label scopes

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.


### Blank identifier

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).

### Predeclared identifiers

TODO


Expand Down

0 comments on commit 17784d7

Please sign in to comment.