diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs index 74704aa..f0e8147 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs | |||
@@ -572,6 +572,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
572 | 572 | ||
573 | Variable Name = new Variable(); | 573 | Variable Name = new Variable(); |
574 | Variable ArgList = new Variable(); | 574 | Variable ArgList = new Variable(); |
575 | // disable warning on l1, don't see how we can | ||
576 | // code this differently | ||
577 | #pragma warning disable 0168 | ||
575 | foreach (bool l1 in new ListPair(Name, ArgList).unify(List)) | 578 | foreach (bool l1 in new ListPair(Name, ArgList).unify(List)) |
576 | { | 579 | { |
577 | object[] args = ListPair.toArray(ArgList); | 580 | object[] args = ListPair.toArray(ArgList); |
@@ -585,6 +588,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
585 | 588 | ||
586 | return YP.unify(Term, Functor.make((Atom)YP.getValue(Name), args)); | 589 | return YP.unify(Term, Functor.make((Atom)YP.getValue(Name), args)); |
587 | } | 590 | } |
591 | #pragma warning restore 0168 | ||
588 | 592 | ||
589 | return YP.fail(); | 593 | return YP.fail(); |
590 | } | 594 | } |
@@ -597,11 +601,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
597 | 601 | ||
598 | if (!(Term is Variable)) | 602 | if (!(Term is Variable)) |
599 | { | 603 | { |
604 | // disable warning on l1, don't see how we can | ||
605 | // code this differently | ||
606 | #pragma warning disable 0168 | ||
600 | foreach (bool l1 in YP.unify(FunctorName, getFunctorName(Term))) | 607 | foreach (bool l1 in YP.unify(FunctorName, getFunctorName(Term))) |
601 | { | 608 | { |
602 | foreach (bool l2 in YP.unify(Arity, getFunctorArgs(Term).Length)) | 609 | foreach (bool l2 in YP.unify(Arity, getFunctorArgs(Term).Length)) |
603 | yield return false; | 610 | yield return false; |
604 | } | 611 | } |
612 | #pragma warning restore 0168 | ||
605 | } | 613 | } |
606 | else | 614 | else |
607 | throw new NotImplementedException("Debug: must finish functor/3"); | 615 | throw new NotImplementedException("Debug: must finish functor/3"); |
@@ -621,8 +629,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
621 | if (argNumberInt >= 1 && argNumberInt <= termArgs.Length) | 629 | if (argNumberInt >= 1 && argNumberInt <= termArgs.Length) |
622 | { | 630 | { |
623 | // The first ArgNumber is at 1, not 0. | 631 | // The first ArgNumber is at 1, not 0. |
632 | // disable warning on l1, don't see how we can | ||
633 | // code this differently | ||
634 | #pragma warning disable 0168 | ||
624 | foreach (bool l1 in YP.unify(Value, termArgs[argNumberInt - 1])) | 635 | foreach (bool l1 in YP.unify(Value, termArgs[argNumberInt - 1])) |
625 | yield return false; | 636 | yield return false; |
637 | #pragma warning restore 0168 | ||
626 | } | 638 | } |
627 | } | 639 | } |
628 | } | 640 | } |
@@ -814,8 +826,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
814 | object[] args = new object[] { Priority, Specifier, Operator }; | 826 | object[] args = new object[] { Priority, Specifier, Operator }; |
815 | foreach (object[] answer in _operatorTable) | 827 | foreach (object[] answer in _operatorTable) |
816 | { | 828 | { |
829 | // disable warning on l1, don't see how we can | ||
830 | // code this differently | ||
831 | #pragma warning disable 0168 | ||
817 | foreach (bool l1 in YP.unifyArrays(args, answer)) | 832 | foreach (bool l1 in YP.unifyArrays(args, answer)) |
818 | yield return false; | 833 | yield return false; |
834 | #pragma warning restore 0168 | ||
819 | } | 835 | } |
820 | } | 836 | } |
821 | 837 | ||
@@ -847,12 +863,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
847 | int afterInt = atomAtom._name.Length - (beforeInt + lengthInt); | 863 | int afterInt = atomAtom._name.Length - (beforeInt + lengthInt); |
848 | if (afterInt >= 0) | 864 | if (afterInt >= 0) |
849 | { | 865 | { |
866 | // disable warning on l1, don't see how we can | ||
867 | // code this differently | ||
868 | #pragma warning disable 0168 | ||
850 | foreach (bool l1 in YP.unify(After, afterInt)) | 869 | foreach (bool l1 in YP.unify(After, afterInt)) |
851 | { | 870 | { |
852 | foreach (bool l2 in YP.unify | 871 | foreach (bool l2 in YP.unify |
853 | (Sub_atom, Atom.a(atomAtom._name.Substring(beforeInt, lengthInt)))) | 872 | (Sub_atom, Atom.a(atomAtom._name.Substring(beforeInt, lengthInt)))) |
854 | yield return false; | 873 | yield return false; |
855 | } | 874 | } |
875 | #pragma warning restore 0168 | ||
856 | } | 876 | } |
857 | } | 877 | } |
858 | 878 | ||
@@ -1201,9 +1221,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1201 | if (arity == 2 && (name == Atom.a(",") || name == Atom.a(";") || name == Atom.DOT)) | 1221 | if (arity == 2 && (name == Atom.a(",") || name == Atom.a(";") || name == Atom.DOT)) |
1202 | return false; | 1222 | return false; |
1203 | // Use the same mapping to static predicates in YP as the compiler. | 1223 | // Use the same mapping to static predicates in YP as the compiler. |
1224 | // disable warning on l1, don't see how we can | ||
1225 | // code this differently | ||
1226 | #pragma warning disable 0168 | ||
1204 | foreach (bool l1 in YPCompiler.functorCallYPFunctionName(name, arity, new Variable())) | 1227 | foreach (bool l1 in YPCompiler.functorCallYPFunctionName(name, arity, new Variable())) |
1205 | return false; | 1228 | return false; |
1206 | // Debug: Do we need to check if name._module is null? | 1229 | // Debug: Do we need to check if name._module is null? |
1230 | #pragma warning restore 0168 | ||
1207 | return true; | 1231 | return true; |
1208 | } | 1232 | } |
1209 | 1233 | ||
@@ -1342,9 +1366,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1342 | 1366 | ||
1343 | foreach (NameArity key in _predicatesStore.Keys) | 1367 | foreach (NameArity key in _predicatesStore.Keys) |
1344 | { | 1368 | { |
1369 | // disable warning on l1, don't see how we can | ||
1370 | // code this differently | ||
1371 | #pragma warning disable 0168 | ||
1345 | foreach (bool l1 in YP.unify | 1372 | foreach (bool l1 in YP.unify |
1346 | (new Functor2(Atom.SLASH, key._name, key._arity), NameSlashArity)) | 1373 | (new Functor2(Atom.SLASH, key._name, key._arity), NameSlashArity)) |
1347 | yield return false; | 1374 | yield return false; |
1375 | #pragma warning restore 0168 | ||
1348 | } | 1376 | } |
1349 | } | 1377 | } |
1350 | 1378 | ||
@@ -1414,7 +1442,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1414 | /// <returns></returns> | 1442 | /// <returns></returns> |
1415 | public static void script_event(object script_event, object script_params) | 1443 | public static void script_event(object script_event, object script_params) |
1416 | { | 1444 | { |
1417 | string function = ((Atom)YP.getValue(script_event))._name; | 1445 | // string function = ((Atom)YP.getValue(script_event))._name; |
1418 | object[] array = ListPair.toArray(script_params); | 1446 | object[] array = ListPair.toArray(script_params); |
1419 | if (array == null) | 1447 | if (array == null) |
1420 | return; // YP.fail(); | 1448 | return; // YP.fail(); |
@@ -1600,11 +1628,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1600 | if (_exception != null) | 1628 | if (_exception != null) |
1601 | { | 1629 | { |
1602 | bool didUnify = false; | 1630 | bool didUnify = false; |
1631 | // disable warning on l1, don't see how we can | ||
1632 | // code this differently | ||
1633 | #pragma warning disable 0168 | ||
1603 | foreach (bool l1 in YP.unify(_exception._term, Catcher)) | 1634 | foreach (bool l1 in YP.unify(_exception._term, Catcher)) |
1604 | { | 1635 | { |
1605 | didUnify = true; | 1636 | didUnify = true; |
1606 | yield return false; | 1637 | yield return false; |
1607 | } | 1638 | } |
1639 | #pragma warning restore 0168 | ||
1640 | |||
1608 | if (!didUnify) | 1641 | if (!didUnify) |
1609 | throw _exception; | 1642 | throw _exception; |
1610 | } | 1643 | } |