Skip to content

Commit ca1d926

Browse files
authored
Merge pull request #162 from brauliobz/grammar_const_item
Constant item grammar
2 parents 50b05b0 + 825f76e commit ca1d926

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/items/constant-items.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Constant items
22

3+
> **<sup>Syntax</sup>**
4+
> _ConstantItem_ :
5+
> &nbsp;&nbsp; `const` [IDENTIFIER] `:` [_Type_] `=` [_Expression_] `;`
6+
37
A *constant item* is a named _[constant value]_ which is not associated with a
48
specific memory location in the program. Constants are essentially inlined
59
wherever they are used, meaning that they are copied directly into the relevant
@@ -37,4 +41,7 @@ const BITS_N_STRINGS: BitsNStrings<'static> = BitsNStrings {
3741

3842
[constant value]: expressions.html#constant-expressions
3943
[static lifetime elision]: items/static-items.html#static-lifetime-elision
40-
[`Drop`]: the-drop-trait.html
44+
[`Drop`]: the-drop-trait.html
45+
[IDENTIFIER]: identifiers.html
46+
[_Type_]: types.html
47+
[_Expression_]: expressions.html

0 commit comments

Comments
 (0)