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.0.6.0-stable
parent
d0fb5e8c90
commit
476e08286e
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()
|
||||
|
|
Loading…
Reference in New Issue