Skip to content

Commit

Permalink
Clean up some obsolete code
Browse files Browse the repository at this point in the history
  • Loading branch information
angelhof committed May 26, 2023
1 parent a1d9732 commit 0f1ffe7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
5 changes: 1 addition & 4 deletions compiler/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,8 @@ def set_config_globals_from_pash_args(given_pash_args):
# Set debug level
if given_pash_args.debug == 1:
logging.getLogger().setLevel(logging.INFO)
elif given_pash_args.debug == 2:
elif given_pash_args.debug >= 2:
logging.getLogger().setLevel(logging.DEBUG)
elif given_pash_args.debug >= 3:
logging.getLogger().setLevel(logging.TRACE)


## Increase the recursion limit (it seems that the parser/unparser needs it for bigger graphs)
sys.setrecursionlimit(10000)
Expand Down
19 changes: 0 additions & 19 deletions compiler/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,6 @@ def from_ast_objects_to_shell_file(asts, new_shell_filename):
with open(new_shell_filename, 'w') as new_shell_file:
new_shell_file.write(script)

def parse_shell(input_script_path):
if(not os.path.isfile(input_script_path)):
log("Error! File:", input_script_path, "does not exist.", level=0)
sys.exit(1)
parser_output = subprocess.run([config.PARSER_BINARY, input_script_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
if (not parser_output.returncode == 0):
log(parser_output.stderr)
parser_output.check_returncode()
return parser_output.stdout


## Simply wraps the string_of_arg
def pash_string_of_arg(arg, quoted=False):
return string_of_arg(arg, quoted)

### Legacy

def from_ir_to_shell_legacy(ir_filename):
printer_output = subprocess.run([config.PRINTER_BINARY, ir_filename], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
printer_output.check_returncode()
preprocessed_script = printer_output.stdout
return preprocessed_script

0 comments on commit 0f1ffe7

Please sign in to comment.