Skip to content

Commit

Permalink
fix: allow number as first character of ident with escape
Browse files Browse the repository at this point in the history
  • Loading branch information
zakybilfagih committed Feb 15, 2025
1 parent 9ffbe30 commit 4173886
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/parser/lib/Lexer.re
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ let rec get_next_token = lexbuf => {
consume_ident_like(lexbuf) |> handle_tokenizer_error(lexbuf);
/* --variable */
| ("-", "-", ident) => IDENT(lexeme(lexbuf))
| escape
| identifier_start_code_point =>
let _ = Sedlexing.backtrack(lexbuf);
consume_ident_like(lexbuf) |> handle_tokenizer_error(lexbuf);
Expand Down
1 change: 1 addition & 0 deletions packages/parser/test/Lexer_test.re
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ let success_tests =
({|inset-3\.5|}, [IDENT("inset-3.5")]),
({|-inset-3\.5|}, [IDENT("-inset-3.5")]),
({|inset-1\/3|}, [IDENT("inset-1/3")]),
({|\32xl\:container|}, [IDENT("2xl:container")]),
(" \n\t ", [WS]),
({|"something"|}, [STRING("something")]),
({|'tuturu'|}, [STRING("tuturu")]),
Expand Down

0 comments on commit 4173886

Please sign in to comment.