oracc / pyoracc

Python tools for working with ORACC
GNU General Public License v3.0
12 stars 10 forks source link

Errors returned from pyoracc when doing syntax highlight #48

Closed raquelalegre closed 8 years ago

raquelalegre commented 8 years ago

When opening some files in Nammu, pyoracc returns a parsing error. I've seen these two different error messages:

/Users/raquel/workspace/ORACC/whole_corpus/whole_corpus/cmawro/00atf/cmawro-09-03.atf

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 7, in validate_corpus
  File "python/nammu/controller/AtfAreaController.py", line 34, in setAtfAreaText
    self.view.syntax_highlight()
  File "python/nammu/view/AtfAreaView.py", line 153, in syntax_highlight
    for tok in lexer:
  File "/Users/raquelalegre/.virtualenvs/ORACC_Jython/Lib/site-packages/ply/lex.py", line 419, in next
    t = self.token()
  File "/Users/raquelalegre/.virtualenvs/ORACC_Jython/Lib/site-packages/ply/lex.py", line 320, in token
    m = lexre.match(lexdata, lexpos)
RuntimeError: maximum recursion limit exceeded
/Users/raquel/workspace/ORACC/whole_corpus/whole_corpus/dcclt/00atf/2-ed-nmpr-q-l.atf
/Users/raquel/workspace/ORACC/whole_corpus/whole_corpus/dcclt/00atf/3-ob-diri-q-l.atf
/Users/raquel/workspace/ORACC/whole_corpus/whole_corpus/dcclt/00atf/3-ob-eaaa-l.atf

/Users/raquelalegre/.virtualenvs/ORACC_Jython/Lib/site-packages/pyoracc/atf/atflex.py:223: UserWarning: Illegal @STRING 'div'
  warnings.warn(formatstring, UserWarning)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 7, in validate_corpus
  File "python/nammu/controller/AtfAreaController.py", line 34, in setAtfAreaText
    self.view.syntax_highlight()
  File "python/nammu/view/AtfAreaView.py", line 153, in syntax_highlight
    for tok in lexer:
  File "/Users/raquelalegre/.virtualenvs/ORACC_Jython/Lib/site-packages/ply/lex.py", line 419, in next
    t = self.token()
  File "/Users/raquelalegre/.virtualenvs/ORACC_Jython/Lib/site-packages/ply/lex.py", line 350, in token
    newtok = func(tok)
  File "/Users/raquelalegre/.virtualenvs/ORACC_Jython/Lib/site-packages/pyoracc/atf/atflex.py", line 206, in t_INITIAL_parallel_labeled_ATID
    t.lexer.pop_state()
  File "/Users/raquelalegre/.virtualenvs/ORACC_Jython/Lib/site-packages/ply/lex.py", line 284, in pop_state
    self.begin(self.lexstatestack.pop())
IndexError: pop from empty list
jenshnielsen commented 8 years ago

I cannot reproduce the first error

jenshnielsen commented 8 years ago

Nevermind I can now

jenshnielsen commented 8 years ago

But only when loading it via nammu not when running it directly in pyorrac

jenshnielsen commented 8 years ago

It looks like I can from Jython but not from CPython because the stack limit is smaller in Jython

raquelalegre commented 8 years ago

Fixed