diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs index 65d3b9b..28c031f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | |||
@@ -32,6 +32,8 @@ using System.Reflection; | |||
32 | using log4net; | 32 | using log4net; |
33 | using Tools; | 33 | using Tools; |
34 | 34 | ||
35 | using OpenSim.Region.Framework.Interfaces; | ||
36 | |||
35 | namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | 37 | namespace OpenSim.Region.ScriptEngine.Shared.CodeTools |
36 | { | 38 | { |
37 | public class CSCodeGenerator : ICodeConverter | 39 | public class CSCodeGenerator : ICodeConverter |
@@ -45,12 +47,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
45 | private int m_CSharpLine; // the current line of generated C# code | 47 | private int m_CSharpLine; // the current line of generated C# code |
46 | private int m_CSharpCol; // the current column of generated C# code | 48 | private int m_CSharpCol; // the current column of generated C# code |
47 | private List<string> m_warnings = new List<string>(); | 49 | private List<string> m_warnings = new List<string>(); |
50 | private IScriptModuleComms m_comms = null; | ||
48 | 51 | ||
49 | /// <summary> | 52 | /// <summary> |
50 | /// Creates an 'empty' CSCodeGenerator instance. | 53 | /// Creates an 'empty' CSCodeGenerator instance. |
51 | /// </summary> | 54 | /// </summary> |
52 | public CSCodeGenerator() | 55 | public CSCodeGenerator() |
53 | { | 56 | { |
57 | m_comms = null; | ||
58 | ResetCounters(); | ||
59 | } | ||
60 | |||
61 | public CSCodeGenerator(IScriptModuleComms comms) | ||
62 | { | ||
63 | m_comms = comms; | ||
54 | ResetCounters(); | 64 | ResetCounters(); |
55 | } | 65 | } |
56 | 66 | ||
@@ -866,8 +876,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
866 | { | 876 | { |
867 | string retstr = String.Empty; | 877 | string retstr = String.Empty; |
868 | 878 | ||
869 | retstr += Generate(String.Format("{0}(", CheckName(fc.Id)), fc); | 879 | string modinvoke = m_comms.LookupModInvocation(fc.Id); |
870 | 880 | if (modinvoke != null) | |
881 | { | ||
882 | if (fc.kids[0] is ArgumentList) | ||
883 | { | ||
884 | if ((fc.kids[0] as ArgumentList).kids.Count == 0) | ||
885 | retstr += Generate(String.Format("{0}(\"{1}\"",modinvoke,fc.Id), fc); | ||
886 | else | ||
887 | retstr += Generate(String.Format("{0}(\"{1}\",",modinvoke,fc.Id), fc); | ||
888 | } | ||
889 | } | ||
890 | else | ||
891 | { | ||
892 | retstr += Generate(String.Format("{0}(", CheckName(fc.Id)), fc); | ||
893 | } | ||
894 | |||
871 | foreach (SYMBOL kid in fc.kids) | 895 | foreach (SYMBOL kid in fc.kids) |
872 | retstr += GenerateNode(kid); | 896 | retstr += GenerateNode(kid); |
873 | 897 | ||