Commit 51fbb5c0 authored by AKA Russell's avatar AKA Russell

Unknown malformed terms are printed.

--Now, if Maude-PSL encounters an error that it doesn't know how to
handle, it just prints the error message from Maude directly.
parent c5c5e17e
......@@ -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.
"""
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)
......
......@@ -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}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment