From 2b069a3b1ea6750d35e318989c8b982e82adba43 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 2 Nov 2013 00:39:12 +0000 Subject: If the LSL state_entry() event definition contains any parameters, then generate syntax error as seen on the LL grid This is done through the parser and so generates the same syntax error message if any parameters are wrongly specified for this event. We were already enforcing event names in the parser. This is only for state_entry so far as an initial test of the approach - appears to work correctly. --- .../ScriptEngine/Shared/CodeTools/LSL2CSCodeTransformer.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSCodeTransformer.cs') diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSCodeTransformer.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSCodeTransformer.cs index e77b3d2..0fb3574 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSCodeTransformer.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSCodeTransformer.cs @@ -27,12 +27,16 @@ using System; using System.Collections.Generic; +using System.Reflection; +using log4net; using Tools; namespace OpenSim.Region.ScriptEngine.Shared.CodeTools { public class LSL2CSCodeTransformer { +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private SYMBOL m_astRoot = null; private static Dictionary m_datatypeLSL2OpenSim = null; @@ -78,6 +82,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools /// The current node to transform. private void TransformNode(SYMBOL s) { +// m_log.DebugFormat("[LSL2CSCODETRANSFORMER]: Tranforming node {0}", s); + // make sure to put type lower in the inheritance hierarchy first // ie: since IdentConstant and StringConstant inherit from Constant, // put IdentConstant and StringConstant before Constant @@ -103,10 +109,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools // We need to check for that here. if (null != s.kids[i]) { +// m_log.Debug("[LSL2CSCODETRANSFORMER]: Moving down level"); + if (!(s is Assignment || s is ArgumentDeclarationList) && s.kids[i] is Declaration) AddImplicitInitialization(s, i); TransformNode((SYMBOL) s.kids[i]); + +// m_log.Debug("[LSL2CSCODETRANSFORMER]: Moving up level"); } } } -- cgit v1.1