diff --git a/src/core/format_spec/lexer.py b/src/core/format_spec/lexer.py index 578aa51..70696f9 100644 --- a/src/core/format_spec/lexer.py +++ b/src/core/format_spec/lexer.py @@ -116,5 +116,5 @@ class FormatSpecLexer: while self.peek().isdigit(): self.advance() - value: float = float(self.source[self.start:self.idx]) + value: int = int(self.source[self.start:self.idx]) self.add_token(TokenType.NUMBER, value) diff --git a/src/core/format_spec/parser.py b/src/core/format_spec/parser.py index 7ad7eba..a1084b2 100644 --- a/src/core/format_spec/parser.py +++ b/src/core/format_spec/parser.py @@ -94,7 +94,7 @@ class FormatSpecParser: if self.match(TokenType.NUMBER): width = self.previous().value if self.match(TokenType.COMMA, TokenType.UNDERSCORE): - grouping = self.previous().value + grouping = self.previous() return FormatSpecIntegral( width=width, grouping=grouping @@ -107,7 +107,7 @@ class FormatSpecParser: if self.match(TokenType.NUMBER): precision = self.previous().value if self.match(TokenType.COMMA, TokenType.UNDERSCORE): - grouping = self.previous().value + grouping = self.previous() return FormatSpecDecimal( precision=precision, grouping=grouping