cc-tweaked / CC-Tweaked

Just another ComputerCraft fork
https://tweaked.cc
934 stars 211 forks source link

Weird cc.internal error `...internal/syntax/errors.lua:577: No such token 40` with `goto` #1652

Closed fatboychummy closed 11 months ago

fatboychummy commented 11 months ago

Minecraft Version

1.16.x

Version

1.109.0 (eval.tweaked.cc and copy-cat)

Details

This is one I can only replicate on the CC:Aide Discord bot (perhaps it hasn't updated to a new version?). When running the following code,

::a::

local function x()
  ::b::
  goto exit
end

goto a

::exit::

I get the following error: image

However, when running the same code in copy-cat it shuts the computer down. Seems an error replicates up to the shell somehow because it kills the shell with a too long without yielding error (and the timing is ~6-7 seconds after starting the program), instead of doing the whole ComputerCraft may be installed incorrectly thing.

fatboychummy commented 11 months ago

I'm doing more testing with the latter part of this here, and it seems like it may be a separate issue altogether?

It seems that copy-cat is spamming too long without yielding errors at the lua code, because if I run the following:

local function x()
  while true do end
end

while true do
  print(pcall(x))
end

It spits out false, bla.lua: too long without yielding about 20 times before kicking it to the forced shutdown ComputerCraft may be installed incorrectly thing.

Those too long without yielding errors are somehow replicating their way up to the shell (or just getting sent to the shell even after the program crashes?).

SquidDev commented 11 months ago

Thanks for the report, should be fixed by af12b3a0ea94f2beeecda07a70e4c752456d5988.