mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 10:15:33 +08:00
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.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1359,6 +1359,41 @@ default
|
||||
Assert.AreEqual(expected, output);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestVectorMemberPlusEquals()
|
||||
{
|
||||
string input = @"// let's test unary expressions some more
|
||||
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
vector v = llGetPos();
|
||||
v.z += 4;
|
||||
v.z -= 4;
|
||||
v.z *= 4;
|
||||
v.z /= 4;
|
||||
v.z %= 4;
|
||||
}
|
||||
}
|
||||
";
|
||||
string expected = @"
|
||||
public void default_event_state_entry()
|
||||
{
|
||||
LSL_Types.Vector3 v = llGetPos();
|
||||
v.z += 4;
|
||||
v.z -= 4;
|
||||
v.z *= 4;
|
||||
v.z /= 4;
|
||||
v.z %= 4;
|
||||
}
|
||||
";
|
||||
|
||||
CSCodeGenerator cg = new CSCodeGenerator();
|
||||
string output = cg.Convert(input);
|
||||
Assert.AreEqual(expected, output);
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException("Tools.CSToolsException")]
|
||||
public void TestSyntaxError()
|
||||
|
||||
Reference in New Issue
Block a user