Closed bcho closed 11 years ago
@bcho this actually turned out to be an interesting bug. Thanks for reporting it. What was happening was:
Running kal
with -o
calls kal.compile
, where running kal
without -o
calls kal.eval
. Both interfaces read the file and passed in a Buffer
object, but kal.eval
converted the buffer to a string first. It turns out the lexer chokes on buffer objects, probably due to Unicode characters still being in byte form.
I'll try to put out a release in the next day or two with this fix included.
I pushed this to npm, so give 0.5.1 a try and let me know if you have issues.
It works now, thanks for your quick fix :)
Here is a sample project structure:
In
foo.kal
:When I run
kal -o js/src src/js/foo.kal
in the top-level (i.e., ink/
), the parser will return this error message:If I compile under
src/js
, it won't generate any errors.And if I change the Chinese character to English, it won't generate any errors either.