#31 KFB Breaks Without Trailing Newline

release 1.0.4
closed-fixed
pyke (39)
5
2009-12-18
2009-12-12
Cerin
No

1. Create a KFB without a trailing newline.
2. Attempt to load KFB in Pyke.
3. Receive error similar to:
>>> engine = knowledge_engine.engine('puzzle')

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files\Python26\lib\site-packages\pyke
\knowledge_engine.py", line 81, in __init__
target_package.compile(self)
File "C:\Program Files\Python26\lib\site-packages\pyke
\target_pkg.py", line 197, in compile
source_filename))
File "C:\Program Files\Python26\lib\site-packages\pyke
\target_pkg.py", line 177, in do_by_ext
return getattr(self, "%s_%s" % (prefix, ext))(filename, *args)
File "C:\Program Files\Python26\lib\site-packages\pyke
\target_pkg.py", line 214, in compile_kfb
self.pickle_it(krb_compiler.compile_kfb(source_filename),
fbc_path)
File "C:\Program Files\Python26\lib\site-packages\pyke\krb_compiler
\__init__.py", line 167, in compile_kfb
return kfbparser.parse(kfbparser, filename)
File "C:\Program Files\Python26\lib\site-packages\pyke\krb_compiler
\kfbparser.py", line 161, in parse
parser.parse(f.read(), lexer=scanner.lexer, tracking=True,
debug=debug)
File "C:\Program Files\Python26\lib\site-packages\pyke\krb_compiler
\ply\yacc.py", line 263, in parse
return self.parseopt(input,lexer,debug,tracking,tokenfunc)
File "C:\Program Files\Python26\lib\site-packages\pyke\krb_compiler
\ply\yacc.py", line 792, in parseopt
tok = self.errorfunc(errtoken)
File "C:\Program Files\Python26\lib\site-packages\pyke\krb_compiler
\kfbparser.py", line 106, in p_error
scanner.syntaxerror_params(t.lexpos, t.lineno))
AttributeError: 'NoneType' object has no attribute 'lexpos'

Discussion

  • Fixed in changeset 37a32b9ef8fc

    Will be included in release 1.0.5.

     
    • milestone: --> release 1.0.4
    • status: open --> closed-fixed