OpenSimMirror/OpenSim/Region/ScriptEngine/Shared/CodeTools
Aleric Inglewood c90b986d8b Improved line map heuristics.
If the C# column can't be found in the positionMap (but the line can),
use the map immediately after it while correcting for the offset,
unless that results in an LSL position before the previous LSL position
in the positionMap.

The idea behind this heuristic is that in most, if not all cases C#
consumes more characters than LSL (for example LSL_Types.LSLInteger
instead of just 'integer').

Thus if the distance between the columns of two markers differ in
the C# and LSL file, the distance in the C# file will be larger.
Moreover, we can assume that every time this happens we will have
a marker at the beginning of the longer 'keyword', because those
keywords were generated by us in the first place.

For example:

C#:     LSL_Types.LSLInteger f2(LSL_Types.LSLString s)
        ^                       ^
        1                       2

will always have markers at the beginning of the long keywords
'LSL_Types.LSLInteger' and 'LSL_Types.LSLString'.
If an error is generated in between (for example at the beginning
of the function name 'f2') then the correct position is found
by using an offset relative to 2 rather than 1.

Note that a case where this isn't working correctly is
when the user adds extra spaces. For example:

LSL:   integer f2(    string s)

would still use the start of 'string' as reference and
then go backwards 3 characters only because the corresponding
C# still looks like

C#:     LSL_Types.LSLInteger f2(LSL_Types.LSLString s)
                             ^  ^
			     only 3 chars difference

and the reported error at 'f2' would be here:

LSL:   integer f2(    string s)
                   ^

This can only be fixed by generating a mapping for 'f2' itself, or
generating a mapping whenever the amount of spaces is changed.
2014-06-19 23:52:51 +01:00
..
Properties Change assembly versions to 0.8.1 2014-06-17 18:37:15 +01:00
Tests refactor: Simplify compilation result tests by factoring out common code. 2014-06-18 23:04:31 +01:00
CSCodeGenerator.cs Fix issue with LSL jumps screwing up the C# compiler error -> LSL code position map and leading to invalid error line numbers/columns 2014-06-18 22:24:36 +01:00
CSReservedWords.cs Minor: Change OpenSim to OpenSimulator in older copyright headers and LICENSE.txt. 2009-06-01 06:37:14 +00:00
Compiler.cs Improved line map heuristics. 2014-06-19 23:52:51 +01:00
ICodeConverter.cs Minor: Change OpenSim to OpenSimulator in older copyright headers and LICENSE.txt. 2009-06-01 06:37:14 +00:00
LSL2CSCodeTransformer.cs If the LSL state_entry() event definition contains any parameters, then generate syntax error as seen on the LL grid 2013-11-02 00:39:12 +00:00
lsl.lexer.cs Allow empty assignment in for-loop 2009-06-07 10:22:41 +00:00
lsl.parser.cs Add lsl arg syntax checking for control event 2013-12-21 01:00:50 +00:00