diff --git a/main.py b/main.py index f27252d..9bfdf10 100755 --- a/main.py +++ b/main.py @@ -67,9 +67,10 @@ class UniConvScript(object): """Converts the script to Unicode, setting the properties required by EParse to report a meaningful error position. """ - def __init__(self, script, options = (), filename = b''): + def __init__(self, script, options=(), filename=b'', emap=False): self.linedir = [] self.filename = filename + self.emap = emap # We don't interpret #line here. In case of an encode error, # we're in the dark about which file it comes from. User needs # --preshow to view the #line directives and find the correspondence @@ -647,7 +648,8 @@ def main(argv): # errors with accurate line information. At this point we don't # need the result. UniConvScript(script, options, - fname if fname != '-' else '').to_unicode() + fname if fname != '-' else '', + emap).to_unicode() except EParse as e: # We don't call ReportError to prevent problems due to # displaying invalid UTF-8