kpeeters / cadabra2

A field-theory motivated approach to computer algebra.
https://cadabra.science/
GNU General Public License v3.0
228 stars 37 forks source link

cadabra hangs if expression contains \ #240

Open slazav opened 2 years ago

slazav commented 2 years ago

Minimal code:

#!/usr/bin/cadabra2

ex := A = 1\ 
            + 1;

I'm using cadabra 2.3.8.

strace says:

...
openat(AT_FDCWD, "./test_h", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=41, ...}, AT_EMPTY_PATH) = 0
ioctl(3, TCGETS, 0x7ffc67a87fb0)        = -1 ENOTTY (Inappropriate ioctl for device)
lseek(3, 0, SEEK_CUR)                   = 0
ioctl(3, TCGETS, 0x7ffc67a87db0)        = -1 ENOTTY (Inappropriate ioctl for device)
read(3, "#!/usr/bin/cadabra2\n\nex := A = 1"..., 8192) = 41
read(3, "", 8192)                       = 0

ps. I just start learning this tool, it looks really useful for me. But I have a few issues where I'm not sure is it my misunderstanding or real bugs. Here I was obviously wrong with syntax, but hanging instead of an error message still looks strange.

kpeeters commented 2 years ago

This is probably a duplicate of #155.