sillsdev / ptx2pdf

XeTeX based macro package for typesetting USFM formatted (Paratext output) scripture files
23 stars 8 forks source link

SFM parsing for diglots fails with milestones. #880

Open davidg-sil opened 1 year ago

davidg-sil commented 1 year ago

An input of

\cl CHAPTER 1
\p
\qt-s \*
\v 1 \text
\p

Or indeed any other milestone followed by \v, with or without an argument Is giving me an error like this:

Traceback (most recent call last):
  File "/home/david/src/ptx2pdf/examples/diglot/../../python/scripts/usfmerge", line 55, in <module>
    usfmerge2(args.infile, keyarr, args.outfile, stylesheets=stylesheets, stylesheetsa=sheetsa,stylesheetsb=sheetsb, scorearr=scorearr,
  File "/home/david/src/ptx2pdf/python/lib/ptxprint/usfmerge.py", line 1132, in usfmerge2
    doc = list(usfm.parser(inf, stylesheet=sheets[colkey], debug=False,
  File "/home/david/src/ptx2pdf/python/lib/ptxprint/sfm/__init__.py", line 729, in _default_
    e.extend(sub_parser(e))
  File "/home/david/src/ptx2pdf/python/lib/ptxprint/sfm/__init__.py", line 729, in _default_
    e.extend(sub_parser(e))
  File "/home/david/src/ptx2pdf/python/lib/ptxprint/sfm/__init__.py", line 729, in _default_
    e.extend(sub_parser(e))
  [Previous line repeated 1 more time]
  File "/home/david/src/ptx2pdf/python/lib/ptxprint/sfm/__init__.py", line 748, in _default_
    force_need = self._force_close(parent, tok, tag)
  File "/home/david/src/ptx2pdf/python/lib/ptxprint/sfm/usfm.py", line 373, in _force_close
    super()._force_close(parent, tok, tag)
  File "/home/david/src/ptx2pdf/python/lib/ptxprint/sfm/__init__.py", line 790, in _force_close
    self._error(
  File "/home/david/src/ptx2pdf/python/lib/ptxprint/sfm/__init__.py", line 607, in _error
    raise SyntaxError(msg)
SyntaxError: 54-GALengwyc2018.usfm: line 11,1 [id c p qt-s]: invalid end marker \v: \qt-s (line 10,1) can only be closed with \*
davidg-sil commented 1 year ago

Note that this might only be a feature with the command-line merge program. I've not tested it via the GUI. In any case it's confusing.