Feature Request: OSSL, Error when have variable between 2 states, should not
Opened this issue · 2 comments
zaher commented
if we put variable between two states we will have error
C:\temp\bug.lsl::ERROR:: ( 4, 16): `new' is undeclared.
C:\temp\bug.lsl::ERROR:: ( 8, 1): syntax error, unexpected INTEGER, expecting end of file
default{
touch(integer num_detected)
{
state new;
}
}
integer test;
state new{
touch(integer num_detected)
{
state default;
}
}
Sei-Lisa commented
That's how LSL works. It's built into the LSL grammar. It MUST give a syntax error. The overall syntax of a script is:
- globals and functions
- default state
- other states
You can't add globals or functions between states.
If it doesn't give an error in OSSL, that just confirms my argument that there are important differences between both, and trying to adjust the grammar to work with both could be very difficult and hard to maintain.
OSSL would need a new tool, osslint. I don't know the language (or languages, since there are several engines) in enough depth so don't count me in for that. Meanwhile this is lslint and it's for LSL only.
zaher commented
Thank you, because I did not work for SecondLife
It is not a bug, but I will leave it as feature request for some one can add it by add dialect name --ossl or using header of file
There is some language have dialect like FreePascal that I used right now to create my editor that use lslint.