1616from shasta .ast_node import AstNode
1717
1818from ast_util import PreprocessedAST , UnparsedScript , unzip
19- from transformation_options import (
20- TransformationType ,
21- TransformationState ,
22- AirflowTransformationState ,
23- AbstractTransformationState ,
24- )
19+ from transformation_options import TransformationState
2520from walk_preprocess import WalkPreprocess , PreprocessContext
2621from parse import parse_shell_to_asts , from_ast_objects_to_shell
2722from util import log , logging_prefix , print_time_delta
@@ -90,7 +85,6 @@ def __init__(self, *args, **kwargs):
9085 help = "(experimental) interpret the input as a bash script file" ,
9186 action = "store_true" ,
9287 )
93- self .set_defaults (preprocess_mode = "pash" )
9488
9589
9690@logging_prefix (LOGGING_PREFIX )
@@ -164,7 +158,7 @@ def preprocess(input_script_path, args):
164158
165159def preprocess_asts (ast_objects , args ):
166160 """
167- Preprocess AST objects based on the transformation mode .
161+ Preprocess AST objects by replacing candidate dataflow regions .
168162
169163 Args:
170164 ast_objects: List of parsed AST objects
@@ -173,13 +167,7 @@ def preprocess_asts(ast_objects, args):
173167 Returns:
174168 List of preprocessed AST objects
175169 """
176- trans_mode = TransformationType (args .preprocess_mode )
177-
178- if trans_mode is TransformationType .AIRFLOW :
179- trans_options = AirflowTransformationState ()
180- else :
181- trans_options = TransformationState ()
182-
170+ trans_options = TransformationState ()
183171 return replace_ast_regions (ast_objects , trans_options )
184172
185173
@@ -188,7 +176,7 @@ def preprocess_asts(ast_objects, args):
188176
189177def preprocess_node (
190178 ast_node : AstNode ,
191- trans_options : AbstractTransformationState ,
179+ trans_options : TransformationState ,
192180 last_object : bool ,
193181) -> PreprocessedAST :
194182 """
@@ -197,7 +185,7 @@ def preprocess_node(
197185
198186 Parameters:
199187 ast_node (AstNode): The AstNode to parse
200- trans_options (AbstractTransformationState ):
188+ trans_options (TransformationState ):
201189 A concrete transformation state instance corresponding to the output target
202190 last_object (bool): Flag for whether this is the last AstNode
203191
@@ -208,7 +196,7 @@ def preprocess_node(
208196 return _pash_walker .walk (ast_node , ctx )
209197
210198
211- def replace_ast_regions (ast_objects , trans_options : AbstractTransformationState ):
199+ def replace_ast_regions (ast_objects , trans_options : TransformationState ):
212200 """
213201 Replace candidate dataflow AST regions with calls to PaSh's runtime.
214202 """
0 commit comments