diff options
author | Aleric Inglewood | 2014-05-28 18:51:17 +0200 |
---|---|---|
committer | Justin Clark-Casey | 2014-08-02 00:49:36 +0100 |
commit | 56a3d2f00d910b614c2fde15a4a9a7477cff65dc (patch) | |
tree | 5f24811f344f197e5aa921742367bf5ce5a4e7bd /doc | |
parent | Fix looking up line number and colum when there is no exact match. (diff) | |
download | opensim-SC_OLD-56a3d2f00d910b614c2fde15a4a9a7477cff65dc.zip opensim-SC_OLD-56a3d2f00d910b614c2fde15a4a9a7477cff65dc.tar.gz opensim-SC_OLD-56a3d2f00d910b614c2fde15a4a9a7477cff65dc.tar.bz2 opensim-SC_OLD-56a3d2f00d910b614c2fde15a4a9a7477cff65dc.tar.xz |
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.
Diffstat (limited to 'doc')
0 files changed, 0 insertions, 0 deletions