aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YPCompiler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YPCompiler.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YPCompiler.cs63
1 files changed, 38 insertions, 25 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YPCompiler.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YPCompiler.cs
index c2040c9..d6115ce 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YPCompiler.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YPCompiler.cs
@@ -209,14 +209,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
209 object[] functorArgs = YP.getFunctorArgs(Term); 209 object[] functorArgs = YP.getFunctorArgs(Term);
210 210
211 Variable pred = new Variable(); 211 Variable pred = new Variable();
212 // disable warning on l1, don't see how we can
213 // code this differently
214 #pragma warning disable 0168
212 foreach (bool l1 in ((CompilerState)State)._pred.match 215 foreach (bool l1 in ((CompilerState)State)._pred.match
213 (new object[] { functorName, functorArgs.Length, pred, Atom.a("det") })) 216 (new object[] { functorName, functorArgs.Length, pred, Atom.a("det") }))
214 { 217 {
215 if (CompilerState.isNoneOut(YP.getFunctorArgs(pred.getValue()))) 218 if (CompilerState.isNoneOut(YP.getFunctorArgs(pred.getValue())))
216 { 219 {
217 return true; 220 return true;
218 } 221 }
219 } 222 }
223 #pragma warning restore 0168
220 224
221 return false; 225 return false;
222 } 226 }
@@ -228,14 +232,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
228 object[] functorArgs = YP.getFunctorArgs(Term); 232 object[] functorArgs = YP.getFunctorArgs(Term);
229 233
230 Variable pred = new Variable(); 234 Variable pred = new Variable();
235 // disable warning on l1, don't see how we can
236 // code this differently
237 #pragma warning disable 0168
231 foreach (bool l1 in ((CompilerState)State)._pred.match 238 foreach (bool l1 in ((CompilerState)State)._pred.match
232 (new object[] { functorName, functorArgs.Length, pred, Atom.a("semidet") })) 239 (new object[] { functorName, functorArgs.Length, pred, Atom.a("semidet") }))
233 { 240 {
234 if (CompilerState.isNoneOut(YP.getFunctorArgs(pred.getValue()))) 241 if (CompilerState.isNoneOut(YP.getFunctorArgs(pred.getValue())))
235 { 242 {
236 return true; 243 return true;
237 } 244 }
238 } 245 }
246 #pragma warning restore 0168
239 247
240 return false; 248 return false;
241 } 249 }
@@ -275,6 +283,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
275 } 283 }
276 } 284 }
277 285
286 // disable warning unused variables, the following code is
287 // infested with it.
288 #pragma warning disable 0168, 0219
289
278 /// <summary> 290 /// <summary>
279 /// Use makeFunctionPseudoCode, convertFunctionCSharp and compileAnonymousFunction 291 /// Use makeFunctionPseudoCode, convertFunctionCSharp and compileAnonymousFunction
280 /// to return an anonymous YP.IClause for the Head and Body of a rule clause. 292 /// to return an anonymous YP.IClause for the Head and Body of a rule clause.
@@ -3939,12 +3951,12 @@ namespace Temporary {
3939 YP.nl(); 3951 YP.nl();
3940 convertStatementListCSharp(RestStatements, Level); 3952 convertStatementListCSharp(RestStatements, Level);
3941 return; 3953 return;
3942 goto cutIf1; 3954 // goto cutIf1;
3943 } 3955 }
3944 convertStatementListCSharp(RestStatements, Level); 3956 convertStatementListCSharp(RestStatements, Level);
3945 return; 3957 return;
3946 cutIf1: 3958 // cutIf1:
3947 { } 3959 // { }
3948 } 3960 }
3949 } 3961 }
3950 { 3962 {
@@ -4111,12 +4123,12 @@ namespace Temporary {
4111 YP.write(Atom.a(@", ")); 4123 YP.write(Atom.a(@", "));
4112 convertArgListCSharp(Tail); 4124 convertArgListCSharp(Tail);
4113 return; 4125 return;
4114 goto cutIf1; 4126 // goto cutIf1;
4115 } 4127 }
4116 convertArgListCSharp(Tail); 4128 convertArgListCSharp(Tail);
4117 return; 4129 return;
4118 cutIf1: 4130 // cutIf1:
4119 { } 4131 // { }
4120 } 4132 }
4121 } 4133 }
4122 } 4134 }
@@ -4266,13 +4278,13 @@ namespace Temporary {
4266 YP.put_code(Code); 4278 YP.put_code(Code);
4267 convertStringCodesCSharp(RestCodes); 4279 convertStringCodesCSharp(RestCodes);
4268 return; 4280 return;
4269 goto cutIf1; 4281 // goto cutIf1;
4270 } 4282 }
4271 YP.put_code(Code); 4283 YP.put_code(Code);
4272 convertStringCodesCSharp(RestCodes); 4284 convertStringCodesCSharp(RestCodes);
4273 return; 4285 return;
4274 cutIf1: 4286 // cutIf1:
4275 { } 4287 // { }
4276 } 4288 }
4277 } 4289 }
4278 } 4290 }
@@ -4623,12 +4635,12 @@ namespace Temporary {
4623 YP.write(Atom.a(@", ")); 4635 YP.write(Atom.a(@", "));
4624 convertArgListJavascript(Tail); 4636 convertArgListJavascript(Tail);
4625 return; 4637 return;
4626 goto cutIf1; 4638 // goto cutIf1;
4627 } 4639 }
4628 convertArgListJavascript(Tail); 4640 convertArgListJavascript(Tail);
4629 return; 4641 return;
4630 cutIf1: 4642 // cutIf1:
4631 { } 4643 // { }
4632 } 4644 }
4633 } 4645 }
4634 } 4646 }
@@ -4777,7 +4789,7 @@ namespace Temporary {
4777 YP.put_code(Code); 4789 YP.put_code(Code);
4778 convertStringCodesJavascript(RestCodes); 4790 convertStringCodesJavascript(RestCodes);
4779 return; 4791 return;
4780 goto cutIf1; 4792 // goto cutIf1;
4781 } 4793 }
4782 if (YP.termEqual(Code, 92)) 4794 if (YP.termEqual(Code, 92))
4783 { 4795 {
@@ -4785,13 +4797,13 @@ namespace Temporary {
4785 YP.put_code(Code); 4797 YP.put_code(Code);
4786 convertStringCodesJavascript(RestCodes); 4798 convertStringCodesJavascript(RestCodes);
4787 return; 4799 return;
4788 goto cutIf1; 4800 // goto cutIf1;
4789 } 4801 }
4790 YP.put_code(Code); 4802 YP.put_code(Code);
4791 convertStringCodesJavascript(RestCodes); 4803 convertStringCodesJavascript(RestCodes);
4792 return; 4804 return;
4793 cutIf1: 4805 // cutIf1:
4794 { } 4806 // { }
4795 } 4807 }
4796 } 4808 }
4797 } 4809 }
@@ -5420,12 +5432,12 @@ namespace Temporary {
5420 YP.write(Atom.a(@", ")); 5432 YP.write(Atom.a(@", "));
5421 convertArgListPython(Tail); 5433 convertArgListPython(Tail);
5422 return; 5434 return;
5423 goto cutIf1; 5435 // goto cutIf1;
5424 } 5436 }
5425 convertArgListPython(Tail); 5437 convertArgListPython(Tail);
5426 return; 5438 return;
5427 cutIf1: 5439 // cutIf1:
5428 { } 5440 // { }
5429 } 5441 }
5430 } 5442 }
5431 } 5443 }
@@ -5573,7 +5585,7 @@ namespace Temporary {
5573 YP.put_code(Code); 5585 YP.put_code(Code);
5574 convertStringCodesPython(RestCodes); 5586 convertStringCodesPython(RestCodes);
5575 return; 5587 return;
5576 goto cutIf1; 5588 // goto cutIf1;
5577 } 5589 }
5578 if (YP.termEqual(Code, 92)) 5590 if (YP.termEqual(Code, 92))
5579 { 5591 {
@@ -5581,13 +5593,13 @@ namespace Temporary {
5581 YP.put_code(Code); 5593 YP.put_code(Code);
5582 convertStringCodesPython(RestCodes); 5594 convertStringCodesPython(RestCodes);
5583 return; 5595 return;
5584 goto cutIf1; 5596 // goto cutIf1;
5585 } 5597 }
5586 YP.put_code(Code); 5598 YP.put_code(Code);
5587 convertStringCodesPython(RestCodes); 5599 convertStringCodesPython(RestCodes);
5588 return; 5600 return;
5589 cutIf1: 5601 // cutIf1:
5590 { } 5602 // { }
5591 } 5603 }
5592 } 5604 }
5593 } 5605 }
@@ -5646,6 +5658,7 @@ namespace Temporary {
5646 } 5658 }
5647 } 5659 }
5648 } 5660 }
5661 #pragma warning restore 0168
5649 5662
5650 } 5663 }
5651} 5664}