fix(formatter): add fstring alignment and zfill
This commit is contained in:
@@ -193,6 +193,12 @@ class Formatter(Expr.Visitor[str], Stmt.Visitor[str]):
|
|||||||
|
|
||||||
def format_format_spec(self, spec: FormatSpec) -> str:
|
def format_format_spec(self, spec: FormatSpec) -> str:
|
||||||
res: 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:
|
if spec.options.sign is not None:
|
||||||
res += spec.options.sign.lexeme
|
res += spec.options.sign.lexeme
|
||||||
if spec.number.integral.width is not None:
|
if spec.number.integral.width is not None:
|
||||||
|
|||||||
Reference in New Issue
Block a user