Skip to content

Commit

Permalink
Merge pull request #701 from binpash/libdash_parser_init_fix
Browse files Browse the repository at this point in the history
initialize libdash only on first call
  • Loading branch information
angelhof authored Nov 21, 2023
2 parents 5fd6cdb + 9cf4d00 commit c875873
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions compiler/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c875873

Please sign in to comment.