fix(fstring): use x/X for hexadecimal instead of h/H

This commit is contained in:
2026-02-07 22:23:51 +01:00
parent eb5c731ee5
commit 7e55e9296a
2 changed files with 2 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
let a = 42
print(f"int: {a:d}; hex: {a:h}; HEX: {a:H}; oct: {a:o}; bin: {a:b}")
print(f"int: {a:d}; hex: {a:x}; HEX: {a:X}; oct: {a:o}; bin: {a:b}")
let b = 1234567890
print(f"{b:,}")
print(f"{b:_}")

View File

@@ -95,7 +95,7 @@ class FormatSpecLexer:
self.add_token(TokenType.T_DEC)
case "o":
self.add_token(TokenType.T_OCT)
case "h" | "H":
case "x" | "X":
self.add_token(TokenType.T_HEX)
case "e":
self.add_token(TokenType.T_SCI)