Skip to content

Commit 7e6716b

Browse files
RawkMattias Wallin
authored andcommitted
feat(lexer): Deny identifiers starting with number
1 parent c6ee0ca commit 7e6716b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rasn-compiler/src/lexer/common.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ where
9090
pub fn title_case_identifier(input: Input<'_>) -> ParserResult<'_, &str> {
9191
map_res(
9292
recognize(pair(
93-
one_of("ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890"),
93+
one_of("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),
9494
many0(alt((
9595
preceded(char('-'), into_inner(alphanumeric1)),
9696
into_inner(alphanumeric1),
@@ -268,14 +268,14 @@ pub fn default(input: Input<'_>) -> ParserResult<'_, Option<ASN1Value>> {
268268
pub fn uppercase_identifier(input: Input<'_>) -> ParserResult<'_, &str> {
269269
alt((
270270
into_inner(recognize(pair(
271-
one_of("ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"),
271+
one_of("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),
272272
many1(alt((
273273
preceded(char('-'), one_of("ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890")),
274274
one_of("ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"),
275275
))),
276276
))),
277277
terminated(
278-
into_inner(recognize(one_of("ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"))),
278+
into_inner(recognize(one_of("ABCDEFGHIJKLMNOPQRSTUVWXYZ"))),
279279
peek(is_not("abcdefghijklmnopqrstuvwxyz-")),
280280
),
281281
))

0 commit comments

Comments
 (0)