From 64c14d247569ddc51ef9401d2f1cf2620fb28b53 Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Wed, 25 Feb 2009 05:37:57 +0000 Subject: Allow /* C-style comments */ in LSL scripts. This fixes Mantis #3199. opensim-libs SVN r87 contains the corresponding changes. --- .../Shared/CodeTools/Tests/CSCodeGeneratorTest.cs | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests') diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs index 02108c7..e00acc9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs @@ -369,6 +369,35 @@ default } [Test] + public void TestCStyleComments() + { + string input = @"/* this test tests comments + of the C variety +*/ +default +{ + touch_start(integer num_detected) /* this should be stripped */ + { + /* + * fill + * in + * code + * here... + */ + } +} +"; + string expected = + "\n public void default_event_touch_start(LSL_Types.LSLInteger num_detected)" + + "\n {" + + "\n }\n"; + + CSCodeGenerator cg = new CSCodeGenerator(); + string output = cg.Convert(input); + Assert.AreEqual(expected, output); + } + + [Test] public void TestGlobalDefinedFunctions() { string input = @"// this test tests custom defined functions -- cgit v1.1