keith-packard / snek

Snek programming language for tiny systems
GNU General Public License v3.0
292 stars 30 forks source link

Programs for snek for Posix requires an extra newline in order to be loaded #39

Closed mobluse closed 2 years ago

mobluse commented 2 years ago

Programs for Snek 1.7 for Posix requires an extra newline after the last line with code in order to be loaded.
snek --interactive hello.py
If I don't have an extra newline I get:
hello.py:4 Syntax error at "".
python3 -i hello.py handles this.

I compiled Snek using this repository and run on Raspberry Pi 4 B with Raspberry Pi OS Buster. I installed lola from your repo here. I did this because there were no precompiled version for my system.

keith-packard commented 2 years ago

Can you paste the example that fails so I can test? I found several 'hello.py' on the net and they look like this:

print('hello world')

This example works fine.

mobluse commented 2 years ago

Here is a file with hello1.py that doesn't work with snek hello1.py on my system: hello1.zip It works with python3 hello1.py. hello1.py lacks a newline (\x0A) at the end. I wrote the file in Mousepad 0.4.1.