diff options
author | Charles Krinke | 2008-07-14 01:07:21 +0000 |
---|---|---|
committer | Charles Krinke | 2008-07-14 01:07:21 +0000 |
commit | 476e08286e349c9797bc1ac567d478a1f257f43d (patch) | |
tree | 54f21db5d9028be482906b0efbddf3d1acff7ea4 /OpenSim/Tests | |
parent | Mantis#1638. Thank you kindly, Salahzar for a patch that: (diff) | |
download | opensim-SC-476e08286e349c9797bc1ac567d478a1f257f43d.zip opensim-SC-476e08286e349c9797bc1ac567d478a1f257f43d.tar.gz opensim-SC-476e08286e349c9797bc1ac567d478a1f257f43d.tar.bz2 opensim-SC-476e08286e349c9797bc1ac567d478a1f257f43d.tar.xz |
Mantis#1728. Thank you kindly, Mikem for a patch that solves:
The compiler was missing grammar rules for += etc. operators on
vector.member variables, which the attached patch implements.
Diffstat (limited to 'OpenSim/Tests')
-rw-r--r-- | OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSLCompilerTest.cs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSLCompilerTest.cs b/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSLCompilerTest.cs index 890a634..70472cb 100644 --- a/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSLCompilerTest.cs +++ b/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSLCompilerTest.cs | |||
@@ -1360,6 +1360,41 @@ default | |||
1360 | } | 1360 | } |
1361 | 1361 | ||
1362 | [Test] | 1362 | [Test] |
1363 | public void TestVectorMemberPlusEquals() | ||
1364 | { | ||
1365 | string input = @"// let's test unary expressions some more | ||
1366 | |||
1367 | default | ||
1368 | { | ||
1369 | state_entry() | ||
1370 | { | ||
1371 | vector v = llGetPos(); | ||
1372 | v.z += 4; | ||
1373 | v.z -= 4; | ||
1374 | v.z *= 4; | ||
1375 | v.z /= 4; | ||
1376 | v.z %= 4; | ||
1377 | } | ||
1378 | } | ||
1379 | "; | ||
1380 | string expected = @" | ||
1381 | public void default_event_state_entry() | ||
1382 | { | ||
1383 | LSL_Types.Vector3 v = llGetPos(); | ||
1384 | v.z += 4; | ||
1385 | v.z -= 4; | ||
1386 | v.z *= 4; | ||
1387 | v.z /= 4; | ||
1388 | v.z %= 4; | ||
1389 | } | ||
1390 | "; | ||
1391 | |||
1392 | CSCodeGenerator cg = new CSCodeGenerator(); | ||
1393 | string output = cg.Convert(input); | ||
1394 | Assert.AreEqual(expected, output); | ||
1395 | } | ||
1396 | |||
1397 | [Test] | ||
1363 | [ExpectedException("Tools.CSToolsException")] | 1398 | [ExpectedException("Tools.CSToolsException")] |
1364 | public void TestSyntaxError() | 1399 | public void TestSyntaxError() |
1365 | { | 1400 | { |