OpenSimMirror/OpenSim/Region/ScriptEngine/Shared
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
..
Api Change assembly versions to 0.8.1 2014-06-17 18:37:15 +01:00
CodeTools Improved line map heuristics. 2014-06-19 23:52:51 +01:00
Instance Change assembly versions to 0.8.1 2014-06-17 18:37:15 +01:00
Properties Bump version and assembly version numbers from 0.7.5 to 0.7.6 2013-02-05 00:23:17 +00:00
Tests Actually add the llRequestAgentData() test class for commit 530c86 2014-04-11 00:36:50 +01:00
AssemblyResolver.cs Add a regression test to compile and start a script. Remove Path.GetDirectoryName when getting assembly loading path in Compiler.CompileFromDotNetText(). 2012-02-07 17:44:37 +00:00
Helpers.cs Implement co-operative script termination if termination comes during a script wait event (llSleep(), etc.) 2013-01-16 02:07:43 +00:00
LSL_Types.cs Eliminated many warnings 2014-04-23 16:37:36 +03:00
ScriptException.cs Also add the additional ScriptException constructor necessary to get [Serializable] to work. 2012-10-31 00:56:41 +00:00