From 9cf4d0037892dc766cb9eef1e0b62533c52eaa34 Mon Sep 17 00:00:00 2001 From: Anirudh Narsipur Date: Mon, 20 Nov 2023 23:56:34 -0500 Subject: [PATCH] initialize libdash only on first call Signed-off-by: Anirudh Narsipur --- compiler/parse.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/parse.py b/compiler/parse.py index 3d2bfc01b..74514b987 100644 --- a/compiler/parse.py +++ b/compiler/parse.py @@ -14,10 +14,12 @@ ## Parses straight a shell script to an AST ## through python without calling it as an executable +INITIALIZE_LIBDASH = True def parse_shell_to_asts(input_script_path): + global INITIALIZE_LIBDASH try: - new_ast_objects = libdash.parser.parse(input_script_path) - + new_ast_objects = libdash.parser.parse(input_script_path, INITIALIZE_LIBDASH) + INITIALIZE_LIBDASH = False ## Transform the untyped ast objects to typed ones typed_ast_objects = [] for untyped_ast, original_text, linno_before, linno_after, in new_ast_objects: