You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling the require function on a file with an syntax error in it, MoonSharp print the point where the required is called, and not the place were the syntax error occurred.
In MoonSharp the following is given:
> require "test1"
libfunc_require:(12,1-44): unexpected symbol near '/'
I traced the issue to the FillDebugData call on line 249 in the Processor_InstructionLoop.cs file. This method overwrite the Decorative message of the SyntaxErrorException that already contain the correct Decorative message. If I add an if statement to not write the decorative message for SyntaxErrorExceptions in FillDebugData method, then the result is as follows:
> require 'test1'
test1.lua:(5,1-2): unexpected symbol near '/'
This makes it easier to understand where the error comes from.
In Lua 5.3 the error message is much more consistent:
> require "test1"
error loading module 'test1' from file 'W:\workspace\lua\test1.lua':
W:\workspace\lua\test1.lua:5: unexpected symbol near '/'
stack traceback:
[C]: in ?
[C]: in function 'require'
stdin:1: in main chunk
[C]: in ?
The text was updated successfully, but these errors were encountered:
I'm running into the same issue and it makes it nearly impossible to write/debug multi-module Lua code. I'm using the DLL in Unity, so I don't have a full .NET environment set up. Any chance of a quick fix? Otherwise I'll try installing Visual Studio and creating a pull request.
Calling the require function on a file with an syntax error in it, MoonSharp print the point where the required is called, and not the place were the syntax error occurred.
In MoonSharp the following is given:
I traced the issue to the FillDebugData call on line 249 in the Processor_InstructionLoop.cs file. This method overwrite the Decorative message of the SyntaxErrorException that already contain the correct Decorative message. If I add an if statement to not write the decorative message for SyntaxErrorExceptions in FillDebugData method, then the result is as follows:
This makes it easier to understand where the error comes from.
In Lua 5.3 the error message is much more consistent:
The text was updated successfully, but these errors were encountered: