diff --git a/psl.py b/psl.py index 78e2a4cfeb5c722e62b5f1b687877befb100cda8..dfea68cb9a41b0c258c08ebaa8037f114ef253f1 100755 --- a/psl.py +++ b/psl.py @@ -373,6 +373,7 @@ def gen_intermediate(parseTree, theoryFileName): def gen_NPA_code(maudeCode, theoryFileName, parseTree): maudeCommand = [MAUDE_COMMAND, NO_PRELUDE, '-no-banner', '-no-advise', '-no-wrap', PRELUDE, NPA_SYNTAX, theoryFileName, TRANSLATION_FILE] + print(maudeCommand) maudeExecution = subprocess.Popen(maudeCommand, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = maudeExecution.communicate('\n'.join(maudeCode)) @@ -428,7 +429,10 @@ def process_error(error, parseTree): Given a partially evaluated PSL specification, extracts the offending error term, and extracts from the error term the information need for a usable error message. Then raises a TranslationError containing said usable error message. """ - errorTermStart = error.index("$$$") + try: + errorTermStart = error.index("$$$") + except ValueError as e: + raise ValueError(error) errorType, errorTerm = error[errorTermStart:].split('(', 1) numParens = 1 endOfTerm = compute_end_of_term(errorType, errorTerm) diff --git a/psl.sh b/psl.sh index 437b22a6f678a30748d7cc2c5696307d47f82459..785676c29c568268d385296dadf3bb02d2ce7f3a 100755 --- a/psl.sh +++ b/psl.sh @@ -5,7 +5,7 @@ then echo "Usage: ./psl.sh FILENAME.psl" else pslFile=$1 - ./psl.py $pslFile + python psl.py $pslFile maudeExtension="maude" pslExtension=".psl" maudeFile="${pslFile/psl/$maudeExtension}"