Skip to content

Commit

Permalink
Merge parsing fix from 'master' into st3
Browse files Browse the repository at this point in the history
  • Loading branch information
msiniscalchi committed Jul 29, 2013
2 parents a441deb + 5c27f23 commit 2d84708
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions parseTeXlog.py
Expand Up @@ -296,7 +296,7 @@ def handle_warning(l):
continue
if state==STATE_REPORT_ERROR:
# skip everything except "l.<nn> <text>"
debug(line)
debug("Reporting error in line: " + line)
# We check for emergency stops here, too, because it may occur before the l.nn text
if "! Emergency stop." in line:
emergency_stop = True
Expand Down Expand Up @@ -365,7 +365,8 @@ def handle_warning(l):
debug("Done processing, some files left on the stack")
debug(";".join(files))
files=[]
break
# break
# We cannot stop here because pdftex may yet have errors to report.

# Special error reporting for e.g. \footnote{text NO MATCHING PARENS & co
if "! File ended while scanning use of" in line:
Expand All @@ -380,7 +381,9 @@ def handle_warning(l):
continue

# Here, make sure there was no uncaught error, in which case we do more special processing
if "! ==> Fatal error occurred, no output" in line:
# This will match both tex and pdftex Fatal Error messages
if "==> Fatal error occurred," in line:
debug("Fatal error detected")
if errors == []:
warnings.append("TeX STOPPED: fatal errors occurred but LaTeXTools did not see them")
warnings.append("Check the TeX log file, and please let me know via GitHub. Thanks!")
Expand Down Expand Up @@ -590,7 +593,16 @@ def handle_warning(l):
debug("Found loaded) but top file name doesn't have xy")

if len(line)>0 and line[0]=='!': # Now it's surely an error
debug(line)
debug("Error found: " + line)
# If it's a pdftex error, it's on the current line, so report it
if "pdfTeX error" in line:
err_msg = line[1:].strip() # remove '!' and possibly spaces
# This may or may not have a file location associated with it.
# Be conservative and do not try to report one.
errors.append(err_msg)
errors.append("(You may want to check the log file for more information)")
continue
# Now it's a regular TeX error
err_msg = line[2:] # skip "! "
# next time around, err_msg will be set and we'll extract all info
state = STATE_REPORT_ERROR
Expand Down

0 comments on commit 2d84708

Please sign in to comment.