Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [T6] Issue detecting missing ";" #97

Closed
arnauruana opened this issue Apr 3, 2023 · 3 comments
Closed

[BUG] [T6] Issue detecting missing ";" #97

arnauruana opened this issue Apr 3, 2023 · 3 comments

Comments

@arnauruana
Copy link

Using the latest release there is a bug in the compiler functionality when compiling T6 scripts where some missing ';' are not detected by it. Therefore it allows you to compile syntactically incorrect scripts causing the game to throw and execution error later.

Example working expectedly:

// file path: "src/t6/test.gsc"

init()
{
    println("foo1");
    println("foo2")
}
./bin/gsc-tool.exe comp t6 src/t6/test.gsc
[ERROR]:compiler:src/t6/test.gsc:5:1: syntax error, unexpected } at src/t6/test.gsc

Example working unexpectedly:

// file path: "src/t6/test.gsc"

init()
{
    println("foo1")
    println("foo2");
}
./bin/gsc-tool.exe comp t6 src/t6/test.gsc
compiled t6/test.gsc

Game error:
game-error

Console error:
console-error

@xensik
Copy link
Owner

xensik commented Apr 3, 2023

im already aware of this. the syntax in second example is correct. the call gets treated as a object call ''obj func(args);" where obj is another function call. so println("foo1") println("foo2"); is a method call. im thinking about enforcing the object to be in the same line of function to prevent this.

@xensik
Copy link
Owner

xensik commented May 15, 2023

fixed on #123. error throws now if the object is on a different line than function, example:

obj
func();

@xensik xensik closed this as completed May 15, 2023
@arnauruana
Copy link
Author

It works fine now. Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants