Commit Graph

172 Commits (f7104a66a596224dbf4daf6385f9e637d53550ca)

Author SHA1 Message Date
UbitUmarov f1076607dc mantis 8457: ok ok shutup the warning 2019-01-28 07:47:00 +00:00
UbitUmarov aee981e5e2 http reusecontext is obsolete 2018-07-14 21:48:59 +01:00
UbitUmarov 467b591f3a COmment out relocation of tmp cs source file during compilation. This seems to cause issues on same win servers, and is only usefull on deep scripts debug (Xengine compiler) 2018-02-18 13:55:19 +00:00
UbitUmarov 8f1a68633e update lsl2c tools and parsing files. This may fix some issues with precendence of unary operators in same case, hope not break on others :( 2018-01-16 01:44:16 +00:00
UbitUmarov 289d4ca128 minor cleanup 2017-05-27 05:41:40 +01:00
Melanie Thielker b16abc8166 Massive tab and trailing space cleanup 2017-01-05 19:07:37 +00:00
UbitUmarov c37877ed34 tests making sure evering thing is coerently wrong.. 2016-09-03 07:29:42 +01:00
UbitUmarov 16cec3041f <0,0,0,0> is not a rotation 2016-09-03 07:09:05 +01:00
UbitUmarov 2a0df34087 Xengine: and fix line count again 2016-08-31 14:36:07 +01:00
UbitUmarov 2cbacbfb82 Xengine: put back a newline on scripts preamble, and the ugly filename prefix, for now 2016-08-31 12:47:56 +01:00
UbitUmarov a2a84dea49 Xengine: coment out tests too dependent on precise characters and lines generated on code convertion, viewer error position is what matters 2016-08-31 11:17:30 +01:00
UbitUmarov 0f993a1278 Xengine: also missed a few newlines account 2016-08-31 10:39:01 +01:00
UbitUmarov eca0ebab9d Xengine: forgot to do the indent on map too 2016-08-31 10:25:19 +01:00
UbitUmarov 3db81d87d6 Xengine: fix intermediate csharpe source identation. Not sure why i care, compiler sure doesn't and only we bother to create this files on code gen debug 2016-08-31 09:42:03 +01:00
UbitUmarov 5afc5fe343 Xengine: try to reduce memory pressure of scripts compile. Still ugly code, possible mistakes, but i need to share it before i loose it :) ) 2016-08-31 09:15:08 +01:00
Diva Canto ab12a14279 Pushed AssemblyVersion up to VersionInfo, so that we don't need to do global replace anymore. 2016-02-21 11:14:02 -08:00
Diva Canto 59b63b6406 On to 0.8.3!
Conflicts:
	OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/Properties/AssemblyInfo.cs
2015-10-18 21:51:49 -07:00
Diva Canto da32512ea4 Updated all occurrences of AssemblyVersion("0.8.1.*") to AssemblyVersion("0.8.2.*") 2015-04-29 18:47:17 -07:00
Justin Clark-Casey (justincc) 1bed3aff0b On a multi-region simulator when AppDomain = true, make sure the DLL from the appropriate script engines subdir is loaded rather than always that of the first engine to load the DLL.
This resolves a DLL load failure on my Linux box when an attachment script was present on another region before the avatar arrived.
2015-01-26 23:31:46 +00:00
Justin Clark-Casey (justincc) 840e440541 When deleting an assembly before re-compile, make sure its attributes allow deletion.
This is to see if this helps with the problem in http://opensimulator.org/mantis/view.php?id=7278 where some DLLs are not allowing this.
Since OpenSim created the file it should always be allowed to delete it.
2015-01-23 00:45:51 +00:00
Justin Clark-Casey (justincc) 72d1d96c5c Always close script linemap file after reading and always dispose of other streams in the script engine even if exceptions are thrown. 2014-12-03 20:31:09 +00:00
Justin Clark-Casey (justincc) cbd428cff3 Add LSL transaction_result event.
This is cinderblocks' transaction_result.diff from http://opensimulator.org/mantis/view.php?id=7329 but I have used lsl.parser.cs and lsl.lexer.cs files generated directly from opensim-libs rather than those supplied in the patch.
I also added scriptEvents.transaction_reuslt.
The required parser/lexer generation file changes were made in commit d564f28 in the opensim-libs repo.
Thanks!
2014-10-04 00:16:47 +01:00
Oren Hurvitz 9fa8d84598 Eliminated some warnings 2014-07-21 08:30:10 +01:00
Justin Clark-Casey (justincc) 15b38f0036 minor: further cleanup of old vb and yield prolog script engine references that were removed some time ago 2014-07-11 00:15:47 +01:00
Justin Clark-Casey (justincc) d7b9260496 If [XEngine] ScriptStopStrategy is changed between abort and co-op, for the existing session use the previous strategy for that script rather than not starting the script at all.
We have to do this since we can't unload existing DLLs if they're all in the same AppDomain.
But we can still update the underlying DLL which will be used in the next simulator session.
2014-07-11 00:03:02 +01:00
Justin Clark-Casey (justincc) 6d3b409af2 refactor: use existing Compiler.CreateScriptsDirectory() (renamed to CheckOrCreateScriptsDirectory()) when checking that scripts directory exists on compile.
Code was identical apart from error logging, but if there are failures creating these directories then you'll be
seeing lots of errors anyway, and these will be more informative
2014-07-10 19:40:44 +01:00
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
Aleric Inglewood 3fe9c7c49d Fix looking up line number and colum when there is no exact match.
When a compile error reports a colum/error that is not an exact
match in the positionMap dictionary, the last position in the
map with a line number and position before the reported error
should be returned.

The old code had the following problems:
1) It returns l,c - which are line and column of the C# file, not LSL.
2) It doesn't set l to 'line' when the map has an entry with 'line'.
3) It sorts the map without taking columns into account, which may
   result in a random order of the columns. With my mono implementation
   the columns were reversed in order.

For example, if the map contains the following lines:

99,5,49,10
100,30,50,10
100,40,1,0
101,5,51,10

and a translation of 100,35 was requested,
then the old code would compare '100' with the keys in
the first column - setting l to that key while it is
smaller. Hence, l is set to 99.
Then it finds the key 100 and doesn't update l.
Because of the reversed sort order, it first compares
the column 35 with 40, finding that it is smaller
and therefore it stops; returning 99,1 instead of finding
the correct 100,30 entry and returning 50,10.

This patch causes 50,10 to be returned.

The remaining problems after this patch are:
1) The sorting might not be necessary at all.
2) The is code duplication (I fixed both instances,
   but really there should be no code duplication
   imho).
2014-06-19 23:52:51 +01:00
Justin Clark-Casey (justincc) 3cbdf3bfe0 refactor: Simplify compilation result tests by factoring out common code. 2014-06-18 23:04:31 +01:00
Justin Clark-Casey (justincc) 7b2f125fb6 In compiler regression tests, setup and teardown structures for each test to avoid any possibility of inter-test inter-ference 2014-06-18 22:46:54 +01:00
Justin Clark-Casey (justincc) a0d6705fe6 Fix issue with LSL jumps screwing up the C# compiler error -> LSL code position map and leading to invalid error line numbers/columns
This is because jump statement generation was mistakenly inserting its own line without updating the csharp positions in CSCodeGenerator.
This is Aleric Inglewood's patch in http://opensimulator.org/mantis/view.php?id=7195 but applied to opensim itself rather than the defunct code generation in opensim-libs.  Thanks!
This patch also adds a regression test for this case from myself.
2014-06-18 22:24:36 +01:00
Justin Clark-Casey (justincc) 5450b1b024 Change assembly versions to 0.8.1 2014-06-17 18:37:15 +01:00
Justin Clark-Casey (justincc) 5622cf68aa In compiler tests, remove the ResolveEventHandlers after test exit 2014-05-27 18:47:42 +01:00
Justin Clark-Casey (justincc) 394ec508f6 Make CompilerTest add same AssemblyResolver as XEngine to see if this solves the issue with different AppDomain BaseDirectory in local and Jenkins test runs 2014-05-27 18:37:16 +01:00
Justin Clark-Casey (justincc) bcaacb4e41 Temporarily print regression TestCastAndConcatString() script compile errors out to console to get a handle on what's going wrong.
Does not fail for me locally and I failed to notice this test was failing on Jenkins.
2014-05-27 18:19:08 +01:00
Justin Clark-Casey (justincc) 9bae636ff0 Fix issues where reported LSL compiler error line numbers do not match the script.
This is probably due to changes in the layout of the generated script preamble (using statements etc, ) in c8afc852 (Jan 17 2013).
Re-enabled existing regression test that exercises at least one case of this.
2014-05-24 00:12:23 +01:00
Justin Clark-Casey (justincc) cf95b65c10 Get regression test TestUseUndeclaredVariable() functional again, though not yet enabled.
This reveals the position map problems and will make the fix (and subsequent continual checking) easier.
2014-05-23 22:29:47 +01:00
Justin Clark-Casey (justincc) 250ea09328 Reactivate regression test TestCastAndConcatString() in CompilerTests. 2014-05-23 22:12:49 +01:00
Justin Clark-Casey (justincc) 62a03a5cac Also take YP/commented out JS references from script engine CodeTools.
Fixes build break from d3387d591a
2014-03-26 01:20:49 +00:00
Justin Clark-Casey (justincc) 2f94165dcc Add lsl arg syntax checking for control event 2013-12-21 01:00:50 +00:00
Justin Clark-Casey (justincc) f1cd813a29 refactor: rename internal lsl parser VectorDeclaration -> VecDeclaration for consistency 2013-12-21 00:49:01 +00:00
Justin Clark-Casey (justincc) 871ac5b16c Add arg checking for at_target lsl event 2013-12-21 00:46:34 +00:00
Justin Clark-Casey (justincc) a5e4780547 Add lsl event arg checking for at_rot_target 2013-12-21 00:37:56 +00:00
Justin Clark-Casey (justincc) b757ab2586 Add lsl event argument checking for attach and on_rez 2013-12-21 00:08:36 +00:00
Justin Clark-Casey (justincc) a64377149d Add parameter checking for land_collision, land_collision_start and land_collision_end lsl events
Wrong number of parmeters now generates syntax error on compile, as seen on LL grid
2013-11-29 00:44:53 +00:00
Justin Clark-Casey (justincc) f94d07f2e2 Add regression test to check that specifying a non-existent event raise a syntax error
This was the case before any of the recent changes
2013-11-16 03:02:57 +00:00
Justin Clark-Casey (justincc) 79c1ed8cb9 Add syntax checking for no_sensor() no-arg event 2013-11-16 03:00:03 +00:00
Justin Clark-Casey (justincc) ec4d96acc9 refactor common code out of no argument LSL event regression tests 2013-11-16 02:58:06 +00:00
Justin Clark-Casey (justincc) edd7e19463 If anything other than a single integer is specified for events that only take a single integer, generate a syntax error on LSL script compile rather than an exception later on.
This applies to events changed, collision, collision_start, collision_end, on_rez, run_time_permissions, sensor, touch, touch_start, touch_end
2013-11-16 02:50:14 +00:00
Justin Clark-Casey (justincc) 62006baaef Make state_exit, moving_end, moving_start, not_at_rot_target, not_at_target and timer LSL events generate a syntax error if inappropriately given arguments.
This matches behaviour seen on the LL grid and a previous change for state_entry.
These are all the events which should take no arguments
2013-11-16 01:30:23 +00:00