0xcafed00d / tac08

tac08 is an an emulation of the runtime part of the Pico-8 fantasy console. It takes a .p8 (text format) pico-8 cart file and runs it as closely posible
MIT License
197 stars 21 forks source link

Token Optimized Call to Split() Not Supported #8

Open jloiterman opened 2 years ago

jloiterman commented 2 years ago

Pico8 supports some unusual lua syntax that allows users to save on tokens. In particular, you can call split() on a string without using the parenthesis.

I have a program that throws this error when run in tac08

col=split"2,13,6,7,14,8,14,7,6,13" [time()*5\1%10+1]: ']' expected near '\'

But the same line will run correctly in Pico8. There are a few token-optimization tricks in this line, so I'm not quite sure if it's split"...." or something else, but this definitely runs correctly on Pico-8 0.2.4.

merwok commented 2 years ago

It’s a standard lua thing: you can call any function and omit the parentheses if there’s only one argument of type string or table.