diff --git a/src/formatter.py b/src/formatter.py index 4bbb02f..dff9c81 100644 --- a/src/formatter.py +++ b/src/formatter.py @@ -193,6 +193,12 @@ class Formatter(Expr.Visitor[str], Stmt.Visitor[str]): def format_format_spec(self, spec: FormatSpec) -> str: res: str = "" + if spec.options.alignment is not None: + if spec.options.alignment.fill is not None: + res += spec.options.alignment.fill.lexeme + res += spec.options.alignment.align.lexeme + if spec.options.zfill: + res += "0" if spec.options.sign is not None: res += spec.options.sign.lexeme if spec.number.integral.width is not None: