From 3c75e946c843caca3908dec25b011cb1b5328cb5 Mon Sep 17 00:00:00 2001 From: Robert Muth Date: Thu, 22 Feb 2024 19:11:17 -0500 Subject: [PATCH] typing cleanup --- FrontEnd/pp.py | 16 ++++++++-------- FrontEnd/symbolize.py | 32 ++++++++++++++++---------------- FrontEnd/type_corpus.py | 20 ++++++++++---------- FrontEnd/typify.py | 8 ++++---- 4 files changed, 38 insertions(+), 38 deletions(-) diff --git a/FrontEnd/pp.py b/FrontEnd/pp.py index 5cc1102b..54f7ab17 100755 --- a/FrontEnd/pp.py +++ b/FrontEnd/pp.py @@ -11,7 +11,7 @@ import pathlib import dataclasses -from typing import List, Optional, Tuple +from typing import Optional from FrontEnd import cwast from FrontEnd import parse @@ -102,7 +102,7 @@ def GetDoc(node): return None -def RenderColonList(val: List, field: str, out, indent: int): +def RenderColonList(val: list, field: str, out, indent: int): extra_indent = GetColonIndent(field) line = out[-1] @@ -122,7 +122,7 @@ def RenderColonList(val: List, field: str, out, indent: int): out.append([" " * indent]) -def ListIsCompact(val: List): +def ListIsCompact(val: list): for v in val: if GetDoc(v): return False @@ -134,7 +134,7 @@ def ListIsCompact(val: List): return True -def RenderList(val: List, field: str, out, indent: int): +def RenderList(val: list, field: str, out, indent: int): extra_indent = GetExprIndent(field) line = out[-1] if not val: @@ -198,7 +198,7 @@ def RenderShortAttr(node): def RenderRecursivelyToIR(node, out, indent: int): if cwast.NF.TOP_LEVEL in node.FLAGS: out.append([""]) - line: List[str] = out[-1] + line: list[str] = out[-1] abbrev = MaybeSimplifyLeafNode(node) if abbrev: line.append(abbrev) @@ -360,7 +360,7 @@ def RenderRecursivelyHTML(node, tc, out, indent: int): out.append(["

"]) -def PrettyPrintHTML(mod: cwast.DefMod, tc): # -> List[Tuple[int, str]]: +def PrettyPrintHTML(mod: cwast.DefMod, tc): # -> list[Tuple[int, str]]: out = [[ """