Coverage for pysource_codegen/types.py: 100%

18 statements  

« prev     ^ index     » next       coverage.py v7.5.3, created at 2024-06-13 21:17 +0200

1import ast 

2from dataclasses import dataclass 

3from typing import Dict 

4from typing import List 

5from typing import Tuple 

6from typing import Type 

7from typing import Union 

8 

9from typing_extensions import Literal # noqa 

10 

11 

12@dataclass 

13class NodeType: 

14 fields: Dict[str, Tuple[str, Union[Literal["?"], Literal["*"], Literal[""]]]] 

15 ast_type: Type[ast.AST] 

16 

17 

18@dataclass 

19class BuiltinNodeType: 

20 kind: Union[ 

21 Literal["identifier"], Literal["int"], Literal["string"], Literal["constant"] 

22 ] 

23 

24 

25@dataclass 

26class UnionNodeType: 

27 options: List[str]