CODE
integer a;
list b = [a];
default()
{
state_entry()
{
llOwnerSay(llList2CSV(b));
}
}
CODE
WARN:: ( 1, 1): variable `a' declared but never used.
TOTAL:: Errors: 0 Warnings: 1CODE
These forums are CLOSED. Please visit the new forums HERE
lslint - offline code checker for LSL |
|
Strife Onizuka
Moonchild
![]() Join date: 3 Mar 2004
Posts: 5,887
|
07-08-2006 13:49
^_^ found another bug; an invalid warning, only happens in the global scope. LSL's handling in this situation isn't perfect anyway (make "a" a key and give it a default value, then read the type from the list, it will be a string and not a key).
CODE
CODE
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey |
Ima Mechanique
Registered User
Join date: 25 Feb 2005
Posts: 23
|
07-16-2006 16:13
You don't happen to know whether there is a way in SciTE to arrange it so after compiling if you double click on one of the errors in the bottom pane it could auto-highlight the line of code? I couldn't see any way to when I played with it. The docs say "SciTE partially understands the error messages produced by Python, GCC, Visual C++, Borland C++, PHP and other tools which use the same format as one of these," so I'm guessing you can't make it understand custom error formats, but I can't say for sure. I will add a switch in 0.3 to set the error format. I think it only needs for the output line to be structured as follows: <FileSpec>:<LineNumber>:<anything else you like> Anything after the second colon is ignored, just the FileSpec and line number is used, but the second colon must exist for it to work. The highlighting is limited to putting a yellow bullet next to the line number and moving you to that line. But that's better than finding it yourself For more info on the formats used check the source code: The set of error message formats is embedded in the Scintilla and SciTE code. To add support for another compiler, you will need to add a new style to scintilla/include/Scintilla.iface after the other SCE_ERR_* values, run HFacer.py, edit RecogniseErrorListLine in scintilla/src/LexOthers.cxx to recognise the error message, and edit DecodeMessage in scite/src/SciTEBuffers.cxx to extract the file name and line number. |
Seagel Neville
Far East User
![]() Join date: 2 Jan 2005
Posts: 1,476
|
08-19-2006 11:46
I got "syntax error, unexpected IDENTIFIER, expecting ')'" at every llSetVehicleFloat Param.
![]() _____________________
![]() ![]() |
Ima Mechanique
Registered User
Join date: 25 Feb 2005
Posts: 23
|
08-19-2006 11:53
I got "syntax error, unexpected IDENTIFIER, expecting ')'" at every llSetVehicleFloat Param. ![]() Then check carefully, because I use those without errors. You're "llSetVehicleFloat Param." implies an error. Should be llSetVehicleFloatParam(), without a space. Unless that's just a typo on your part. |
Seagel Neville
Far East User
![]() Join date: 2 Jan 2005
Posts: 1,476
|
08-19-2006 12:06
Thank you. It was my bad.
![]() I tried to just copy Library forum's script into it and got such reault. I should have known that such an act causes an accident. It is sometimes added spaces between some capital letters. I'm very sorry for bothering you all. _____________________
![]() ![]() |
Rifkin Habsburg
Registered User
![]() Join date: 17 Nov 2005
Posts: 113
|
08-19-2006 15:52
Still waiting for the Mac port of the latest version...
If you don't have access to a Mac anymore, maybe you could send me the code? Or open-source it? _____________________
Procyon Games: makers of Can't Stop, En Garde, Take it Easy, Danger Zone and Frootcake.
|
Jack Moseley
Registered User
Join date: 24 Aug 2004
Posts: 39
|
I second that request...
08-20-2006 09:58
I second that request... A universal binary for the mac, or better yet, the source, would be much appreciated. Great utility!
|
Seagel Neville
Far East User
![]() Join date: 2 Jan 2005
Posts: 1,476
|
ERROR:: ( 10, 19): Parser stack depth exceeded; SL will throw a syntax error here.
10-23-2006 08:31
I got an error on lslint but didn't get it in world. What is it?
Here is the sample script. CODE list NumberList = _____________________
![]() ![]() |
Masakazu Kojima
ケロ
![]() Join date: 23 Apr 2004
Posts: 232
|
10-23-2006 09:09
I got an error on lslint but didn't get it in world. ![]() |
Seagel Neville
Far East User
![]() Join date: 2 Jan 2005
Posts: 1,476
|
10-23-2006 09:18
Thank you for replying, Masakazu. I'm using Macintosh. But hmm.... What should I take it?
![]() ![]() _____________________
![]() ![]() |
Masakazu Kojima
ケロ
![]() Join date: 23 Apr 2004
Posts: 232
|
10-23-2006 09:39
It's probably safest to fix the error, since there's no guarantee that the Mac version will continue to work that way, and Windows users won't be able to compile the script. It may also break when scripts are automatically recompiled for Mono. Unfortunately it is pretty annoying to work around.
CODE list NumberList; To just ignore the error you could run lslint with -A and add // $[E10023] to the line with the error. |
Strife Onizuka
Moonchild
![]() Join date: 3 Mar 2004
Posts: 5,887
|
10-23-2006 18:21
To just ignore the error you could run lslint with -A and add // $[E10023] to the line with the error. I've been doing exactly that for a while now ![]() _____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey |
Seagel Neville
Far East User
![]() Join date: 2 Jan 2005
Posts: 1,476
|
10-23-2006 18:32
Thanks for the tips.
![]() _____________________
![]() ![]() |
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
10-25-2006 02:06
Since ya'll are the experts, does anyone know how to change the color scheme in the SciTE's output window? I'm using this lslint which is great! However, the output displays in blue and black text.
I've created a SciTE user file to define colors more friendly to my late-night large-screen viewing needs. A black background, gray text, and muted LSL-matching colors. However, I've been through every style, 1-32, and I've even tried to set error.marker.fore=7F7F7F, but without success.. the errors and warnings text remains black - invisible on my black background. Hopefully someone has an answer, because I really like my color settings... no more sun-burnt-feeling eyeballs. |
Ralph Doctorow
Registered User
Join date: 16 Oct 2005
Posts: 560
|
Incorrect warning
11-20-2006 10:57
First, lslint is very impressive, good stuff.
However, it flags repeated jumps to the same location as a warning which isn't correct. I sometimes use it as a technique for breaking out of an if chain since if else is so limited. This returns a warning in lslint saying only the last will be used which isn't correct. // jump test string jumpTest(string testString) { if (testString == "A" ![]() jump found; } if (testString == "B" ![]() jump found; } if (testString == "C" ![]() jump found; } if (testString == "D" ![]() jump found; } return ""; @found; return "X"; } default { state_entry() { llOwnerSay("jumpTest " + jumpTest("A" ![]() } } |
Ima Mechanique
Registered User
Join date: 25 Feb 2005
Posts: 23
|
11-20-2006 13:06
First, lslint is very impressive, good stuff. However, it flags repeated jumps to the same location as a warning which isn't correct. I sometimes use it as a technique for breaking out of an if chain since if else is so limited. This returns a warning in lslint saying only the last will be used which isn't correct. True, in your example they will all be used. In general jumps are considered poor programming, to be avoided if possible. I hope this is a poor example of your needs though, because it doesn't require jumps at all! Heres three ways to have the same effect without using jump. The second will produce "Empty IF" warnings CODE
My preference would be the last, hopefully for obvious reasons. But I'd return TRUE or FALSE instead. This is a little off topic for this thread, so if you'd like to reply, please do so in world. |
Ralph Doctorow
Registered User
Join date: 16 Oct 2005
Posts: 560
|
11-20-2006 13:14
I had hoped it would be obvious that that was a test case, not a real script.
Unfortunately jumps are sometimes the best technique in LSL for the following reasons: 1. There is no break statement so if you are looping and want to exit once you've found something in a list etc. jump is the fastest way to do it. You can use a do while, but it is slower since you need to check a condition at the end. 2. There is a limit on the number of if else nesting levels, so if you are implementing what amounts to a switch statement, you need to do something else if you don't want to execute unnecessary if tests. Jump and return are the two obvious choices and with the overhead inherent in passing arguments, particularly arrays, it's often much faster to just jump out of an if chain as shown. |
Masakazu Kojima
ケロ
![]() Join date: 23 Apr 2004
Posts: 232
|
11-20-2006 13:37
This returns a warning in lslint saying only the last will be used which isn't correct. Which platform/version of SL are you running? Running your test gives me (no X): [13:31] Object: jumpTest Additionally I have this one: CODE tf() { Which gives me: [13:30] Object: missed jump in state_entry [13:30] Object: in else [13:30] Object: missed jump in tf From my About window: Second Life 1.12.3 (6) Nov 1 2006 13:39:40 OS Version: Microsoft Windows XP Service Pack 2 (Build 2600) I'm guessing you run something else? |
RobbyRacoon Olmstead
Red warrior is hungry!
![]() Join date: 20 Sep 2006
Posts: 1,821
|
11-20-2006 14:02
The LSL wiki page has this listed first thing on the known bugs page, which would indicate to me that the warning is valid:
Only the last jump to a label actually gets executed. CODE jump end; Still true in 1.10.3, 18-June-2006. --RobDemar |
Ima Mechanique
Registered User
Join date: 25 Feb 2005
Posts: 23
|
11-20-2006 14:03
I had hoped it would be obvious that that was a test case, not a real script. Yes it was obvious it's a test case, but a test case where the jumps are not required. If you're going to use a test scenario it helps if it demonstrates ALL your points, to avoid confusion. This just made you look like a bad programmer. As I said, this isn't the thread to discuss it. Which platform/version of SL are you running? SL About says: Second Life 1.12.3 (6) Nov 1 2006 13:39:40 OS Version: Microsoft Windows XP x64 Edition Service Pack 1 (Build 3790) Ralph's Original script compiles in SL for me, and lslint gives the same warning. Your's also compiles in SL for me, and lslint gives the same warning. However your logic is not the same as Ralph's. All of his jumps are available through a single path avoiding each of the others. Your two in the state_entry are on the same path. Hmm, I can see why lslint wouldn't spot that for Ralph's example. Each if is separate so they might all be followed if not for the actual conditions. However, if you replace that with chained if/else if's it still fails to notice. the separate paths. |
RobbyRacoon Olmstead
Red warrior is hungry!
![]() Join date: 20 Sep 2006
Posts: 1,821
|
11-20-2006 14:05
All of his jumps are available through a single path avoiding each of the others. Your two in the state_entry are on the same path. So, this is significant, that they are on different paths of execution even though within the same function? I am not able to test atm, but that is very interesting. |
Masakazu Kojima
ケロ
![]() Join date: 23 Apr 2004
Posts: 232
|
11-20-2006 14:11
Ralph's Original script compiles in SL for me, and lslint gives the same warning. Your's also compiles in SL for me, and lslint gives the same warning. It compiles, but what is the output? The script I posted is different on purpose, since I thought it might matter if they're on the same path or not. Neither way works properly for me. |
Ima Mechanique
Registered User
Join date: 25 Feb 2005
Posts: 23
|
11-20-2006 14:24
It compiles, but what is the output? The script I posted is different on purpose, since I thought it might matter if they're on the same path or not. Neither way works properly for me. Never used jumps in this context before so was unaware of the bug. [14:17] JumpTest: Failed with 'A' [14:18] JumpTest: Failed with 'B' [14:18] JumpTest: Failed with 'C' [14:19] JumpTest: Sucess with 'D' [14:20] JumpTest: Failed with '' this is the output for: CODE
When using each value. I think the warning could be clearer as to what the problem is, as I think I made the same assumption as Ralph. i.e. faulty logic instead of bug in LSL. |
Ima Mechanique
Registered User
Join date: 25 Feb 2005
Posts: 23
|
11-20-2006 14:30
Same output using
CODE
|
Ralph Doctorow
Registered User
Join date: 16 Oct 2005
Posts: 560
|
11-20-2006 15:05
Actually, apparently the deal with LSL is that they don't actually have a jump, it's more like a comefrom statement. Each label can only have a single jump going to it, which seems like a pretty serious bug to me.
However, the lslint warning is correct. This code does what you would expect: // jump test string jumpTest(string testString) { if (testString == "A" ![]() jump found; } if (testString == "B" ![]() jump found1; } return ""; @found1; @found; return "X"; } default { state_entry() { llOwnerSay("jumpTest " + jumpTest("A" ![]() } } |