File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
src/lexlucid/pretokenisation Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ enum RuleName {
2929 LineComment ,
3030 BlockComment ,
3131 UnterminatedBlockComment ,
32+ ReservedHashForms2024 ,
3233 Punctuation ,
3334 SingleQuotedLiteral ,
3435 RawLifetimeOrLabel2021 ,
@@ -108,6 +109,7 @@ const RULES_FOR_EDITION_2024: &[RuleName] = [
108109 RuleName :: LineComment ,
109110 RuleName :: BlockComment ,
110111 RuleName :: UnterminatedBlockComment ,
112+ RuleName :: ReservedHashForms2024 ,
111113 RuleName :: Punctuation ,
112114 RuleName :: SingleQuotedLiteral ,
113115 RuleName :: RawLifetimeOrLabel2021 ,
@@ -177,6 +179,14 @@ fn make_named_rules() -> BTreeMap<RuleName, Rule> {
177179 / \*
178180 "## ) ) ,
179181
182+ // Reserved hashes (Rust 2024)
183+ ( RuleName :: ReservedHashForms2024 ,
184+ Rule :: new_regex (
185+ |_| PretokenData :: Reserved , r##"\A
186+ \#
187+ ( \# | " )
188+ "## ) ) ,
189+
180190 // Punctuation
181191 ( RuleName :: Punctuation ,
182192 Rule :: new_regex (
Original file line number Diff line number Diff line change 44[ Line comment] ( #line-comment ) \
55[ Block comment] ( #block-comment ) \
66[ Unterminated block comment] ( #unterminated-block-comment ) \
7+ [ Reserved hash forms (Rust 2024)] ( #reserved-hash-forms-rust-2024 ) \
78[ Punctuation] ( #punctuation ) \
89[ Single-quoted literal] ( #single-quoted-literal ) \
910[ Raw lifetime or label (Rust 2021)] ( #raw-lifetime-or-label-rust-2021 ) \
@@ -139,6 +140,21 @@ when `character_sequence` represents an iterator over the sequence of characters
139140(none)
140141
141142
143+ #### Reserved hash forms (Rust 2024) { .rule }
144+
145+ ##### Pattern
146+ ```
147+ \#
148+ ( \# | " )
149+ ```
150+
151+ ##### Pretoken kind
152+ ` Reserved `
153+
154+ ##### Attributes
155+ (none)
156+
157+
142158#### Punctuation { .rule }
143159
144160##### Pattern
You can’t perform that action at this time.
0 commit comments