Skip to content
This repository has been archived by the owner on Feb 23, 2022. It is now read-only.

Commit

Permalink
only translates chars in a parse error
Browse files Browse the repository at this point in the history
  • Loading branch information
Felienne committed Mar 2, 2021
1 parent f7b1c4c commit 0afe8bc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,16 @@ def parse():
error_template = hedy_errors[E.error_code]
response["Code"] = "# coding=utf8\n" + E.arguments['fixed_code']
response["Warning"] = error_template.format(**E.arguments)
else:
elif E.args[0] == "Parse":
error_template = hedy_errors[E.error_code]
# Localize the names of characters
# Localize the names of characters
if 'character_found' in E.arguments:
E.arguments['character_found'] = hedy_errors[E.arguments['character_found']]
response["Error"] = error_template.format(**E.arguments)
else:
error_template = hedy_errors[E.error_code]
response["Error"] = error_template.format(**E.arguments)
except Exception as E:
print(f"error transpiling {code}")
response["Error"] = str(E)
Expand Down

0 comments on commit 0afe8bc

Please sign in to comment.