objective-lol 0.0.1__cp310-cp310-macosx_11_0_arm64.whl → 0.0.2__cp310-cp310-macosx_11_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
objective_lol/api.py CHANGED
@@ -741,8 +741,137 @@ TimeoutErrorType = "timeout"
741
741
 
742
742
  # ---- Structs ---
743
743
 
744
- # Python type for struct api.ClassVariable
745
- class ClassVariable(go.GoClass):
744
+ # Python type for struct api.VMError
745
+ class VMError(go.GoClass):
746
+ """VMError represents errors that can occur in the VM API\n"""
747
+ def __init__(self, *args, **kwargs):
748
+ """
749
+ handle=A Go-side object is always initialized with an explicit handle=arg
750
+ otherwise parameters can be unnamed in order of field names or named fields
751
+ in which case a new Go object is constructed first
752
+ """
753
+ if len(kwargs) == 1 and 'handle' in kwargs:
754
+ self.handle = kwargs['handle']
755
+ _api.IncRef(self.handle)
756
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
757
+ self.handle = args[0].handle
758
+ _api.IncRef(self.handle)
759
+ else:
760
+ self.handle = _api.api_VMError_CTor()
761
+ _api.IncRef(self.handle)
762
+ if 0 < len(args):
763
+ self.Type = args[0]
764
+ if "Type" in kwargs:
765
+ self.Type = kwargs["Type"]
766
+ if 1 < len(args):
767
+ self.Message = args[1]
768
+ if "Message" in kwargs:
769
+ self.Message = kwargs["Message"]
770
+ if 2 < len(args):
771
+ self.Source = args[2]
772
+ if "Source" in kwargs:
773
+ self.Source = kwargs["Source"]
774
+ if 4 < len(args):
775
+ self.Duration = args[4]
776
+ if "Duration" in kwargs:
777
+ self.Duration = kwargs["Duration"]
778
+ def __del__(self):
779
+ _api.DecRef(self.handle)
780
+ def __str__(self):
781
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
782
+ sv = 'api.VMError{'
783
+ first = True
784
+ for v in pr:
785
+ if callable(v[1]):
786
+ continue
787
+ if first:
788
+ first = False
789
+ else:
790
+ sv += ', '
791
+ sv += v[0] + '=' + str(v[1])
792
+ return sv + '}'
793
+ def __repr__(self):
794
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
795
+ sv = 'api.VMError ( '
796
+ for v in pr:
797
+ if not callable(v[1]):
798
+ sv += v[0] + '=' + str(v[1]) + ', '
799
+ return sv + ')'
800
+ @property
801
+ def Type(self):
802
+ return _api.api_VMError_Type_Get(self.handle)
803
+ @Type.setter
804
+ def Type(self, value):
805
+ if isinstance(value, go.GoClass):
806
+ _api.api_VMError_Type_Set(self.handle, value.handle)
807
+ else:
808
+ _api.api_VMError_Type_Set(self.handle, value)
809
+ @property
810
+ def Message(self):
811
+ return _api.api_VMError_Message_Get(self.handle)
812
+ @Message.setter
813
+ def Message(self, value):
814
+ if isinstance(value, go.GoClass):
815
+ _api.api_VMError_Message_Set(self.handle, value.handle)
816
+ else:
817
+ _api.api_VMError_Message_Set(self.handle, value)
818
+ @property
819
+ def Source(self):
820
+ return SourceLocation(handle=_api.api_VMError_Source_Get(self.handle))
821
+ @Source.setter
822
+ def Source(self, value):
823
+ if isinstance(value, go.GoClass):
824
+ _api.api_VMError_Source_Set(self.handle, value.handle)
825
+ else:
826
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
827
+ @property
828
+ def Duration(self):
829
+ return _api.api_VMError_Duration_Get(self.handle)
830
+ @Duration.setter
831
+ def Duration(self, value):
832
+ if isinstance(value, go.GoClass):
833
+ _api.api_VMError_Duration_Set(self.handle, value.handle)
834
+ else:
835
+ _api.api_VMError_Duration_Set(self.handle, value)
836
+ def Error(self):
837
+ """Error() str"""
838
+ return _api.api_VMError_Error(self.handle)
839
+ def Unwrap(self):
840
+ """Unwrap() str"""
841
+ return _api.api_VMError_Unwrap(self.handle)
842
+ def IsCompileError(self):
843
+ """IsCompileError() bool
844
+
845
+ IsCompileError returns true if the error is a compilation error
846
+ """
847
+ return _api.api_VMError_IsCompileError(self.handle)
848
+ def IsRuntimeError(self):
849
+ """IsRuntimeError() bool
850
+
851
+ IsRuntimeError returns true if the error is a runtime error
852
+ """
853
+ return _api.api_VMError_IsRuntimeError(self.handle)
854
+ def IsTimeoutError(self):
855
+ """IsTimeoutError() bool
856
+
857
+ IsTimeoutError returns true if the error is a timeout error
858
+ """
859
+ return _api.api_VMError_IsTimeoutError(self.handle)
860
+ def IsConversionError(self):
861
+ """IsConversionError() bool
862
+
863
+ IsConversionError returns true if the error is a type conversion error
864
+ """
865
+ return _api.api_VMError_IsConversionError(self.handle)
866
+ def IsConfigError(self):
867
+ """IsConfigError() bool
868
+
869
+ IsConfigError returns true if the error is a configuration error
870
+ """
871
+ return _api.api_VMError_IsConfigError(self.handle)
872
+
873
+ # Python type for struct api.ClassMethod
874
+ class ClassMethod(go.GoClass):
746
875
  """"""
747
876
  def __init__(self, *args, **kwargs):
748
877
  """
@@ -757,25 +886,21 @@ class ClassVariable(go.GoClass):
757
886
  self.handle = args[0].handle
758
887
  _api.IncRef(self.handle)
759
888
  else:
760
- self.handle = _api.api_ClassVariable_CTor()
889
+ self.handle = _api.api_ClassMethod_CTor()
761
890
  _api.IncRef(self.handle)
762
891
  if 0 < len(args):
763
892
  self.Name = args[0]
764
893
  if "Name" in kwargs:
765
894
  self.Name = kwargs["Name"]
766
895
  if 1 < len(args):
767
- self.Value = args[1]
768
- if "Value" in kwargs:
769
- self.Value = kwargs["Value"]
770
- if 2 < len(args):
771
- self.Locked = args[2]
772
- if "Locked" in kwargs:
773
- self.Locked = kwargs["Locked"]
896
+ self.Argc = args[1]
897
+ if "Argc" in kwargs:
898
+ self.Argc = kwargs["Argc"]
774
899
  def __del__(self):
775
900
  _api.DecRef(self.handle)
776
901
  def __str__(self):
777
902
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
778
- sv = 'api.ClassVariable{'
903
+ sv = 'api.ClassMethod{'
779
904
  first = True
780
905
  for v in pr:
781
906
  if callable(v[1]):
@@ -788,41 +913,32 @@ class ClassVariable(go.GoClass):
788
913
  return sv + '}'
789
914
  def __repr__(self):
790
915
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
791
- sv = 'api.ClassVariable ( '
916
+ sv = 'api.ClassMethod ( '
792
917
  for v in pr:
793
918
  if not callable(v[1]):
794
919
  sv += v[0] + '=' + str(v[1]) + ', '
795
920
  return sv + ')'
796
921
  @property
797
922
  def Name(self):
798
- return _api.api_ClassVariable_Name_Get(self.handle)
923
+ return _api.api_ClassMethod_Name_Get(self.handle)
799
924
  @Name.setter
800
925
  def Name(self, value):
801
926
  if isinstance(value, go.GoClass):
802
- _api.api_ClassVariable_Name_Set(self.handle, value.handle)
803
- else:
804
- _api.api_ClassVariable_Name_Set(self.handle, value)
805
- @property
806
- def Value(self):
807
- return GoValue(handle=_api.api_ClassVariable_Value_Get(self.handle))
808
- @Value.setter
809
- def Value(self, value):
810
- if isinstance(value, go.GoClass):
811
- _api.api_ClassVariable_Value_Set(self.handle, value.handle)
927
+ _api.api_ClassMethod_Name_Set(self.handle, value.handle)
812
928
  else:
813
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
929
+ _api.api_ClassMethod_Name_Set(self.handle, value)
814
930
  @property
815
- def Locked(self):
816
- return _api.api_ClassVariable_Locked_Get(self.handle)
817
- @Locked.setter
818
- def Locked(self, value):
931
+ def Argc(self):
932
+ return _api.api_ClassMethod_Argc_Get(self.handle)
933
+ @Argc.setter
934
+ def Argc(self, value):
819
935
  if isinstance(value, go.GoClass):
820
- _api.api_ClassVariable_Locked_Set(self.handle, value.handle)
936
+ _api.api_ClassMethod_Argc_Set(self.handle, value.handle)
821
937
  else:
822
- _api.api_ClassVariable_Locked_Set(self.handle, value)
938
+ _api.api_ClassMethod_Argc_Set(self.handle, value)
823
939
 
824
- # Python type for struct api.GoValue
825
- class GoValue(go.GoClass):
940
+ # Python type for struct api.UnknownFunctionHandler
941
+ class UnknownFunctionHandler(go.GoClass):
826
942
  """"""
827
943
  def __init__(self, *args, **kwargs):
828
944
  """
@@ -837,13 +953,13 @@ class GoValue(go.GoClass):
837
953
  self.handle = args[0].handle
838
954
  _api.IncRef(self.handle)
839
955
  else:
840
- self.handle = _api.api_GoValue_CTor()
956
+ self.handle = _api.api_UnknownFunctionHandler_CTor()
841
957
  _api.IncRef(self.handle)
842
958
  def __del__(self):
843
959
  _api.DecRef(self.handle)
844
960
  def __str__(self):
845
961
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
846
- sv = 'api.GoValue{'
962
+ sv = 'api.UnknownFunctionHandler{'
847
963
  first = True
848
964
  for v in pr:
849
965
  if callable(v[1]):
@@ -856,45 +972,15 @@ class GoValue(go.GoClass):
856
972
  return sv + '}'
857
973
  def __repr__(self):
858
974
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
859
- sv = 'api.GoValue ( '
975
+ sv = 'api.UnknownFunctionHandler ( '
860
976
  for v in pr:
861
977
  if not callable(v[1]):
862
978
  sv += v[0] + '=' + str(v[1]) + ', '
863
979
  return sv + ')'
864
- def ID(self):
865
- """ID() str"""
866
- return _api.api_GoValue_ID(self.handle)
867
- def MarshalJSON(self):
868
- """MarshalJSON() []int, str"""
869
- return go.Slice_byte(handle=_api.api_GoValue_MarshalJSON(self.handle))
870
- def Type(self):
871
- """Type() str"""
872
- return _api.api_GoValue_Type(self.handle)
873
- def Int(self):
874
- """Int() long, str"""
875
- return _api.api_GoValue_Int(self.handle)
876
- def Float(self):
877
- """Float() float, str"""
878
- return _api.api_GoValue_Float(self.handle)
879
- def String(self):
880
- """String() str, str"""
881
- return _api.api_GoValue_String(self.handle)
882
- def Bool(self):
883
- """Bool() bool, str"""
884
- return _api.api_GoValue_Bool(self.handle)
885
- def Slice(self):
886
- """Slice() []object, str"""
887
- return Slice_api_GoValue(handle=_api.api_GoValue_Slice(self.handle))
888
- def Map(self):
889
- """Map() object, str"""
890
- return Map_string_api_GoValue(handle=_api.api_GoValue_Map(self.handle))
891
- def Object(self):
892
- """Object() object, str"""
893
- return go.Ptr_environment_ObjectInstance(handle=_api.api_GoValue_Object(self.handle))
894
980
 
895
- # Python type for struct api.SourceLocation
896
- class SourceLocation(go.GoClass):
897
- """SourceLocation represents a location in source code\n"""
981
+ # Python type for struct api.VM
982
+ class VM(go.GoClass):
983
+ """VM represents an Objective-LOL virtual machine instance\n"""
898
984
  def __init__(self, *args, **kwargs):
899
985
  """
900
986
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -908,25 +994,13 @@ class SourceLocation(go.GoClass):
908
994
  self.handle = args[0].handle
909
995
  _api.IncRef(self.handle)
910
996
  else:
911
- self.handle = _api.api_SourceLocation_CTor()
997
+ self.handle = _api.api_VM_CTor()
912
998
  _api.IncRef(self.handle)
913
- if 0 < len(args):
914
- self.Filename = args[0]
915
- if "Filename" in kwargs:
916
- self.Filename = kwargs["Filename"]
917
- if 1 < len(args):
918
- self.Line = args[1]
919
- if "Line" in kwargs:
920
- self.Line = kwargs["Line"]
921
- if 2 < len(args):
922
- self.Column = args[2]
923
- if "Column" in kwargs:
924
- self.Column = kwargs["Column"]
925
999
  def __del__(self):
926
1000
  _api.DecRef(self.handle)
927
1001
  def __str__(self):
928
1002
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
929
- sv = 'api.SourceLocation{'
1003
+ sv = 'api.VM{'
930
1004
  first = True
931
1005
  for v in pr:
932
1006
  if callable(v[1]):
@@ -939,38 +1013,65 @@ class SourceLocation(go.GoClass):
939
1013
  return sv + '}'
940
1014
  def __repr__(self):
941
1015
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
942
- sv = 'api.SourceLocation ( '
1016
+ sv = 'api.VM ( '
943
1017
  for v in pr:
944
1018
  if not callable(v[1]):
945
1019
  sv += v[0] + '=' + str(v[1]) + ', '
946
1020
  return sv + ')'
947
- @property
948
- def Filename(self):
949
- return _api.api_SourceLocation_Filename_Get(self.handle)
950
- @Filename.setter
951
- def Filename(self, value):
952
- if isinstance(value, go.GoClass):
953
- _api.api_SourceLocation_Filename_Set(self.handle, value.handle)
954
- else:
955
- _api.api_SourceLocation_Filename_Set(self.handle, value)
956
- @property
957
- def Line(self):
958
- return _api.api_SourceLocation_Line_Get(self.handle)
959
- @Line.setter
960
- def Line(self, value):
961
- if isinstance(value, go.GoClass):
962
- _api.api_SourceLocation_Line_Set(self.handle, value.handle)
963
- else:
964
- _api.api_SourceLocation_Line_Set(self.handle, value)
965
- @property
966
- def Column(self):
967
- return _api.api_SourceLocation_Column_Get(self.handle)
968
- @Column.setter
969
- def Column(self, value):
970
- if isinstance(value, go.GoClass):
971
- _api.api_SourceLocation_Column_Set(self.handle, value.handle)
972
- else:
973
- _api.api_SourceLocation_Column_Set(self.handle, value)
1021
+ def GetCompatibilityShim(self):
1022
+ """GetCompatibilityShim() object
1023
+
1024
+ GetCompatibilityShim returns a compatibility shim for the VM
1025
+ """
1026
+ return VMCompatibilityShim(handle=_api.api_VM_GetCompatibilityShim(self.handle))
1027
+ def Execute(self, code):
1028
+ """Execute(str code) object, str
1029
+
1030
+ Execute executes Objective-LOL code from a string
1031
+ """
1032
+ return ExecutionResult(handle=_api.api_VM_Execute(self.handle, code))
1033
+ def ExecuteWithContext(self, ctx, code):
1034
+ """ExecuteWithContext(object ctx, str code) object, str
1035
+
1036
+ ExecuteWithContext executes code with a context for cancellation/timeout
1037
+ """
1038
+ return ExecutionResult(handle=_api.api_VM_ExecuteWithContext(self.handle, ctx.handle, code))
1039
+ def NewObjectInstance(self, className):
1040
+ """NewObjectInstance(str className) object, str"""
1041
+ return GoValue(handle=_api.api_VM_NewObjectInstance(self.handle, className))
1042
+ def Call(self, functionName, args):
1043
+ """Call(str functionName, []object args) object, str
1044
+
1045
+ Call calls an Objective-LOL function with the given arguments
1046
+ """
1047
+ return GoValue(handle=_api.api_VM_Call(self.handle, functionName, args.handle))
1048
+ def CallMethod(self, object, methodName, args):
1049
+ """CallMethod(object object, str methodName, []object args) object, str
1050
+
1051
+ CallMethod calls a method on an Objective-LOL object
1052
+ """
1053
+ return GoValue(handle=_api.api_VM_CallMethod(self.handle, object.handle, methodName, args.handle))
1054
+ def DefineVariable(self, name, value, constant):
1055
+ """DefineVariable(str name, object value, bool constant) str
1056
+
1057
+ DefineVariable defines a global variable in the VM
1058
+ """
1059
+ return _api.api_VM_DefineVariable(self.handle, name, value.handle, constant)
1060
+ def SetVariable(self, variableName, value):
1061
+ """SetVariable(str variableName, object value) str
1062
+
1063
+ SetVariable sets a variable in the global environment
1064
+ """
1065
+ return _api.api_VM_SetVariable(self.handle, variableName, value.handle)
1066
+ def GetVariable(self, variableName):
1067
+ """GetVariable(str variableName) object, str
1068
+
1069
+ Get gets a variable from the global environment
1070
+ """
1071
+ return GoValue(handle=_api.api_VM_GetVariable(self.handle, variableName))
1072
+ def DefineClass(self, classDef):
1073
+ """DefineClass(object classDef) str"""
1074
+ return _api.api_VM_DefineClass(self.handle, classDef.handle)
974
1075
 
975
1076
  # Python type for struct api.VMCompatibilityShim
976
1077
  class VMCompatibilityShim(go.GoClass):
@@ -1053,6 +1154,86 @@ class VMCompatibilityShim(go.GoClass):
1053
1154
  """AddVariableToObject(str id, object variable) str"""
1054
1155
  return _api.api_VMCompatibilityShim_AddVariableToObject(self.handle, id, variable.handle)
1055
1156
 
1157
+ # Python type for struct api.SourceLocation
1158
+ class SourceLocation(go.GoClass):
1159
+ """SourceLocation represents a location in source code\n"""
1160
+ def __init__(self, *args, **kwargs):
1161
+ """
1162
+ handle=A Go-side object is always initialized with an explicit handle=arg
1163
+ otherwise parameters can be unnamed in order of field names or named fields
1164
+ in which case a new Go object is constructed first
1165
+ """
1166
+ if len(kwargs) == 1 and 'handle' in kwargs:
1167
+ self.handle = kwargs['handle']
1168
+ _api.IncRef(self.handle)
1169
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
1170
+ self.handle = args[0].handle
1171
+ _api.IncRef(self.handle)
1172
+ else:
1173
+ self.handle = _api.api_SourceLocation_CTor()
1174
+ _api.IncRef(self.handle)
1175
+ if 0 < len(args):
1176
+ self.Filename = args[0]
1177
+ if "Filename" in kwargs:
1178
+ self.Filename = kwargs["Filename"]
1179
+ if 1 < len(args):
1180
+ self.Line = args[1]
1181
+ if "Line" in kwargs:
1182
+ self.Line = kwargs["Line"]
1183
+ if 2 < len(args):
1184
+ self.Column = args[2]
1185
+ if "Column" in kwargs:
1186
+ self.Column = kwargs["Column"]
1187
+ def __del__(self):
1188
+ _api.DecRef(self.handle)
1189
+ def __str__(self):
1190
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1191
+ sv = 'api.SourceLocation{'
1192
+ first = True
1193
+ for v in pr:
1194
+ if callable(v[1]):
1195
+ continue
1196
+ if first:
1197
+ first = False
1198
+ else:
1199
+ sv += ', '
1200
+ sv += v[0] + '=' + str(v[1])
1201
+ return sv + '}'
1202
+ def __repr__(self):
1203
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1204
+ sv = 'api.SourceLocation ( '
1205
+ for v in pr:
1206
+ if not callable(v[1]):
1207
+ sv += v[0] + '=' + str(v[1]) + ', '
1208
+ return sv + ')'
1209
+ @property
1210
+ def Filename(self):
1211
+ return _api.api_SourceLocation_Filename_Get(self.handle)
1212
+ @Filename.setter
1213
+ def Filename(self, value):
1214
+ if isinstance(value, go.GoClass):
1215
+ _api.api_SourceLocation_Filename_Set(self.handle, value.handle)
1216
+ else:
1217
+ _api.api_SourceLocation_Filename_Set(self.handle, value)
1218
+ @property
1219
+ def Line(self):
1220
+ return _api.api_SourceLocation_Line_Get(self.handle)
1221
+ @Line.setter
1222
+ def Line(self, value):
1223
+ if isinstance(value, go.GoClass):
1224
+ _api.api_SourceLocation_Line_Set(self.handle, value.handle)
1225
+ else:
1226
+ _api.api_SourceLocation_Line_Set(self.handle, value)
1227
+ @property
1228
+ def Column(self):
1229
+ return _api.api_SourceLocation_Column_Get(self.handle)
1230
+ @Column.setter
1231
+ def Column(self, value):
1232
+ if isinstance(value, go.GoClass):
1233
+ _api.api_SourceLocation_Column_Set(self.handle, value.handle)
1234
+ else:
1235
+ _api.api_SourceLocation_Column_Set(self.handle, value)
1236
+
1056
1237
  # Python type for struct api.VMConfig
1057
1238
  class VMConfig(go.GoClass):
1058
1239
  """VMConfig holds configuration options for the VM\n"""
@@ -1156,135 +1337,6 @@ class VMConfig(go.GoClass):
1156
1337
  """
1157
1338
  return _api.api_VMConfig_Validate(self.handle)
1158
1339
 
1159
- # Python type for struct api.VMError
1160
- class VMError(go.GoClass):
1161
- """VMError represents errors that can occur in the VM API\n"""
1162
- def __init__(self, *args, **kwargs):
1163
- """
1164
- handle=A Go-side object is always initialized with an explicit handle=arg
1165
- otherwise parameters can be unnamed in order of field names or named fields
1166
- in which case a new Go object is constructed first
1167
- """
1168
- if len(kwargs) == 1 and 'handle' in kwargs:
1169
- self.handle = kwargs['handle']
1170
- _api.IncRef(self.handle)
1171
- elif len(args) == 1 and isinstance(args[0], go.GoClass):
1172
- self.handle = args[0].handle
1173
- _api.IncRef(self.handle)
1174
- else:
1175
- self.handle = _api.api_VMError_CTor()
1176
- _api.IncRef(self.handle)
1177
- if 0 < len(args):
1178
- self.Type = args[0]
1179
- if "Type" in kwargs:
1180
- self.Type = kwargs["Type"]
1181
- if 1 < len(args):
1182
- self.Message = args[1]
1183
- if "Message" in kwargs:
1184
- self.Message = kwargs["Message"]
1185
- if 2 < len(args):
1186
- self.Source = args[2]
1187
- if "Source" in kwargs:
1188
- self.Source = kwargs["Source"]
1189
- if 4 < len(args):
1190
- self.Duration = args[4]
1191
- if "Duration" in kwargs:
1192
- self.Duration = kwargs["Duration"]
1193
- def __del__(self):
1194
- _api.DecRef(self.handle)
1195
- def __str__(self):
1196
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1197
- sv = 'api.VMError{'
1198
- first = True
1199
- for v in pr:
1200
- if callable(v[1]):
1201
- continue
1202
- if first:
1203
- first = False
1204
- else:
1205
- sv += ', '
1206
- sv += v[0] + '=' + str(v[1])
1207
- return sv + '}'
1208
- def __repr__(self):
1209
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1210
- sv = 'api.VMError ( '
1211
- for v in pr:
1212
- if not callable(v[1]):
1213
- sv += v[0] + '=' + str(v[1]) + ', '
1214
- return sv + ')'
1215
- @property
1216
- def Type(self):
1217
- return _api.api_VMError_Type_Get(self.handle)
1218
- @Type.setter
1219
- def Type(self, value):
1220
- if isinstance(value, go.GoClass):
1221
- _api.api_VMError_Type_Set(self.handle, value.handle)
1222
- else:
1223
- _api.api_VMError_Type_Set(self.handle, value)
1224
- @property
1225
- def Message(self):
1226
- return _api.api_VMError_Message_Get(self.handle)
1227
- @Message.setter
1228
- def Message(self, value):
1229
- if isinstance(value, go.GoClass):
1230
- _api.api_VMError_Message_Set(self.handle, value.handle)
1231
- else:
1232
- _api.api_VMError_Message_Set(self.handle, value)
1233
- @property
1234
- def Source(self):
1235
- return SourceLocation(handle=_api.api_VMError_Source_Get(self.handle))
1236
- @Source.setter
1237
- def Source(self, value):
1238
- if isinstance(value, go.GoClass):
1239
- _api.api_VMError_Source_Set(self.handle, value.handle)
1240
- else:
1241
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1242
- @property
1243
- def Duration(self):
1244
- return _api.api_VMError_Duration_Get(self.handle)
1245
- @Duration.setter
1246
- def Duration(self, value):
1247
- if isinstance(value, go.GoClass):
1248
- _api.api_VMError_Duration_Set(self.handle, value.handle)
1249
- else:
1250
- _api.api_VMError_Duration_Set(self.handle, value)
1251
- def Error(self):
1252
- """Error() str"""
1253
- return _api.api_VMError_Error(self.handle)
1254
- def Unwrap(self):
1255
- """Unwrap() str"""
1256
- return _api.api_VMError_Unwrap(self.handle)
1257
- def IsCompileError(self):
1258
- """IsCompileError() bool
1259
-
1260
- IsCompileError returns true if the error is a compilation error
1261
- """
1262
- return _api.api_VMError_IsCompileError(self.handle)
1263
- def IsRuntimeError(self):
1264
- """IsRuntimeError() bool
1265
-
1266
- IsRuntimeError returns true if the error is a runtime error
1267
- """
1268
- return _api.api_VMError_IsRuntimeError(self.handle)
1269
- def IsTimeoutError(self):
1270
- """IsTimeoutError() bool
1271
-
1272
- IsTimeoutError returns true if the error is a timeout error
1273
- """
1274
- return _api.api_VMError_IsTimeoutError(self.handle)
1275
- def IsConversionError(self):
1276
- """IsConversionError() bool
1277
-
1278
- IsConversionError returns true if the error is a type conversion error
1279
- """
1280
- return _api.api_VMError_IsConversionError(self.handle)
1281
- def IsConfigError(self):
1282
- """IsConfigError() bool
1283
-
1284
- IsConfigError returns true if the error is a configuration error
1285
- """
1286
- return _api.api_VMError_IsConfigError(self.handle)
1287
-
1288
1340
  # Python type for struct api.ClassDefinition
1289
1341
  class ClassDefinition(go.GoClass):
1290
1342
  """"""
@@ -1400,93 +1452,26 @@ class ClassDefinition(go.GoClass):
1400
1452
  raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1401
1453
  @property
1402
1454
  def PrivateMethods(self):
1403
- return Map_string_Ptr_api_ClassMethod(handle=_api.api_ClassDefinition_PrivateMethods_Get(self.handle))
1404
- @PrivateMethods.setter
1405
- def PrivateMethods(self, value):
1406
- if isinstance(value, go.GoClass):
1407
- _api.api_ClassDefinition_PrivateMethods_Set(self.handle, value.handle)
1408
- else:
1409
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1410
- @property
1411
- def UnknownFunctionHandler(self):
1412
- return UnknownFunctionHandler(handle=_api.api_ClassDefinition_UnknownFunctionHandler_Get(self.handle))
1413
- @UnknownFunctionHandler.setter
1414
- def UnknownFunctionHandler(self, value):
1415
- if isinstance(value, go.GoClass):
1416
- _api.api_ClassDefinition_UnknownFunctionHandler_Set(self.handle, value.handle)
1417
- else:
1418
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1419
-
1420
- # Python type for struct api.ClassMethod
1421
- class ClassMethod(go.GoClass):
1422
- """"""
1423
- def __init__(self, *args, **kwargs):
1424
- """
1425
- handle=A Go-side object is always initialized with an explicit handle=arg
1426
- otherwise parameters can be unnamed in order of field names or named fields
1427
- in which case a new Go object is constructed first
1428
- """
1429
- if len(kwargs) == 1 and 'handle' in kwargs:
1430
- self.handle = kwargs['handle']
1431
- _api.IncRef(self.handle)
1432
- elif len(args) == 1 and isinstance(args[0], go.GoClass):
1433
- self.handle = args[0].handle
1434
- _api.IncRef(self.handle)
1435
- else:
1436
- self.handle = _api.api_ClassMethod_CTor()
1437
- _api.IncRef(self.handle)
1438
- if 0 < len(args):
1439
- self.Name = args[0]
1440
- if "Name" in kwargs:
1441
- self.Name = kwargs["Name"]
1442
- if 1 < len(args):
1443
- self.Argc = args[1]
1444
- if "Argc" in kwargs:
1445
- self.Argc = kwargs["Argc"]
1446
- def __del__(self):
1447
- _api.DecRef(self.handle)
1448
- def __str__(self):
1449
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1450
- sv = 'api.ClassMethod{'
1451
- first = True
1452
- for v in pr:
1453
- if callable(v[1]):
1454
- continue
1455
- if first:
1456
- first = False
1457
- else:
1458
- sv += ', '
1459
- sv += v[0] + '=' + str(v[1])
1460
- return sv + '}'
1461
- def __repr__(self):
1462
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1463
- sv = 'api.ClassMethod ( '
1464
- for v in pr:
1465
- if not callable(v[1]):
1466
- sv += v[0] + '=' + str(v[1]) + ', '
1467
- return sv + ')'
1468
- @property
1469
- def Name(self):
1470
- return _api.api_ClassMethod_Name_Get(self.handle)
1471
- @Name.setter
1472
- def Name(self, value):
1455
+ return Map_string_Ptr_api_ClassMethod(handle=_api.api_ClassDefinition_PrivateMethods_Get(self.handle))
1456
+ @PrivateMethods.setter
1457
+ def PrivateMethods(self, value):
1473
1458
  if isinstance(value, go.GoClass):
1474
- _api.api_ClassMethod_Name_Set(self.handle, value.handle)
1459
+ _api.api_ClassDefinition_PrivateMethods_Set(self.handle, value.handle)
1475
1460
  else:
1476
- _api.api_ClassMethod_Name_Set(self.handle, value)
1461
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1477
1462
  @property
1478
- def Argc(self):
1479
- return _api.api_ClassMethod_Argc_Get(self.handle)
1480
- @Argc.setter
1481
- def Argc(self, value):
1463
+ def UnknownFunctionHandler(self):
1464
+ return UnknownFunctionHandler(handle=_api.api_ClassDefinition_UnknownFunctionHandler_Get(self.handle))
1465
+ @UnknownFunctionHandler.setter
1466
+ def UnknownFunctionHandler(self, value):
1482
1467
  if isinstance(value, go.GoClass):
1483
- _api.api_ClassMethod_Argc_Set(self.handle, value.handle)
1468
+ _api.api_ClassDefinition_UnknownFunctionHandler_Set(self.handle, value.handle)
1484
1469
  else:
1485
- _api.api_ClassMethod_Argc_Set(self.handle, value)
1470
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1486
1471
 
1487
- # Python type for struct api.VM
1488
- class VM(go.GoClass):
1489
- """VM represents an Objective-LOL virtual machine instance\n"""
1472
+ # Python type for struct api.ClassVariable
1473
+ class ClassVariable(go.GoClass):
1474
+ """"""
1490
1475
  def __init__(self, *args, **kwargs):
1491
1476
  """
1492
1477
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -1500,13 +1485,25 @@ class VM(go.GoClass):
1500
1485
  self.handle = args[0].handle
1501
1486
  _api.IncRef(self.handle)
1502
1487
  else:
1503
- self.handle = _api.api_VM_CTor()
1488
+ self.handle = _api.api_ClassVariable_CTor()
1504
1489
  _api.IncRef(self.handle)
1490
+ if 0 < len(args):
1491
+ self.Name = args[0]
1492
+ if "Name" in kwargs:
1493
+ self.Name = kwargs["Name"]
1494
+ if 1 < len(args):
1495
+ self.Value = args[1]
1496
+ if "Value" in kwargs:
1497
+ self.Value = kwargs["Value"]
1498
+ if 2 < len(args):
1499
+ self.Locked = args[2]
1500
+ if "Locked" in kwargs:
1501
+ self.Locked = kwargs["Locked"]
1505
1502
  def __del__(self):
1506
1503
  _api.DecRef(self.handle)
1507
1504
  def __str__(self):
1508
1505
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1509
- sv = 'api.VM{'
1506
+ sv = 'api.ClassVariable{'
1510
1507
  first = True
1511
1508
  for v in pr:
1512
1509
  if callable(v[1]):
@@ -1519,65 +1516,38 @@ class VM(go.GoClass):
1519
1516
  return sv + '}'
1520
1517
  def __repr__(self):
1521
1518
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1522
- sv = 'api.VM ( '
1519
+ sv = 'api.ClassVariable ( '
1523
1520
  for v in pr:
1524
1521
  if not callable(v[1]):
1525
1522
  sv += v[0] + '=' + str(v[1]) + ', '
1526
1523
  return sv + ')'
1527
- def GetCompatibilityShim(self):
1528
- """GetCompatibilityShim() object
1529
-
1530
- GetCompatibilityShim returns a compatibility shim for the VM
1531
- """
1532
- return VMCompatibilityShim(handle=_api.api_VM_GetCompatibilityShim(self.handle))
1533
- def Execute(self, code):
1534
- """Execute(str code) object, str
1535
-
1536
- Execute executes Objective-LOL code from a string
1537
- """
1538
- return ExecutionResult(handle=_api.api_VM_Execute(self.handle, code))
1539
- def ExecuteWithContext(self, ctx, code):
1540
- """ExecuteWithContext(object ctx, str code) object, str
1541
-
1542
- ExecuteWithContext executes code with a context for cancellation/timeout
1543
- """
1544
- return ExecutionResult(handle=_api.api_VM_ExecuteWithContext(self.handle, ctx.handle, code))
1545
- def NewObjectInstance(self, className):
1546
- """NewObjectInstance(str className) object, str"""
1547
- return GoValue(handle=_api.api_VM_NewObjectInstance(self.handle, className))
1548
- def Call(self, functionName, args):
1549
- """Call(str functionName, []object args) object, str
1550
-
1551
- Call calls an Objective-LOL function with the given arguments
1552
- """
1553
- return GoValue(handle=_api.api_VM_Call(self.handle, functionName, args.handle))
1554
- def CallMethod(self, object, methodName, args):
1555
- """CallMethod(object object, str methodName, []object args) object, str
1556
-
1557
- CallMethod calls a method on an Objective-LOL object
1558
- """
1559
- return GoValue(handle=_api.api_VM_CallMethod(self.handle, object.handle, methodName, args.handle))
1560
- def DefineVariable(self, name, value, constant):
1561
- """DefineVariable(str name, object value, bool constant) str
1562
-
1563
- DefineVariable defines a global variable in the VM
1564
- """
1565
- return _api.api_VM_DefineVariable(self.handle, name, value.handle, constant)
1566
- def SetVariable(self, variableName, value):
1567
- """SetVariable(str variableName, object value) str
1568
-
1569
- SetVariable sets a variable in the global environment
1570
- """
1571
- return _api.api_VM_SetVariable(self.handle, variableName, value.handle)
1572
- def GetVariable(self, variableName):
1573
- """GetVariable(str variableName) object, str
1574
-
1575
- Get gets a variable from the global environment
1576
- """
1577
- return GoValue(handle=_api.api_VM_GetVariable(self.handle, variableName))
1578
- def DefineClass(self, classDef):
1579
- """DefineClass(object classDef) str"""
1580
- return _api.api_VM_DefineClass(self.handle, classDef.handle)
1524
+ @property
1525
+ def Name(self):
1526
+ return _api.api_ClassVariable_Name_Get(self.handle)
1527
+ @Name.setter
1528
+ def Name(self, value):
1529
+ if isinstance(value, go.GoClass):
1530
+ _api.api_ClassVariable_Name_Set(self.handle, value.handle)
1531
+ else:
1532
+ _api.api_ClassVariable_Name_Set(self.handle, value)
1533
+ @property
1534
+ def Value(self):
1535
+ return GoValue(handle=_api.api_ClassVariable_Value_Get(self.handle))
1536
+ @Value.setter
1537
+ def Value(self, value):
1538
+ if isinstance(value, go.GoClass):
1539
+ _api.api_ClassVariable_Value_Set(self.handle, value.handle)
1540
+ else:
1541
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1542
+ @property
1543
+ def Locked(self):
1544
+ return _api.api_ClassVariable_Locked_Get(self.handle)
1545
+ @Locked.setter
1546
+ def Locked(self, value):
1547
+ if isinstance(value, go.GoClass):
1548
+ _api.api_ClassVariable_Locked_Set(self.handle, value.handle)
1549
+ else:
1550
+ _api.api_ClassVariable_Locked_Set(self.handle, value)
1581
1551
 
1582
1552
  # Python type for struct api.ExecutionResult
1583
1553
  class ExecutionResult(go.GoClass):
@@ -1665,8 +1635,8 @@ class ExecutionResult(go.GoClass):
1665
1635
  else:
1666
1636
  _api.api_ExecutionResult_Output_Set(self.handle, value)
1667
1637
 
1668
- # Python type for struct api.UnknownFunctionHandler
1669
- class UnknownFunctionHandler(go.GoClass):
1638
+ # Python type for struct api.GoValue
1639
+ class GoValue(go.GoClass):
1670
1640
  """"""
1671
1641
  def __init__(self, *args, **kwargs):
1672
1642
  """
@@ -1681,13 +1651,13 @@ class UnknownFunctionHandler(go.GoClass):
1681
1651
  self.handle = args[0].handle
1682
1652
  _api.IncRef(self.handle)
1683
1653
  else:
1684
- self.handle = _api.api_UnknownFunctionHandler_CTor()
1654
+ self.handle = _api.api_GoValue_CTor()
1685
1655
  _api.IncRef(self.handle)
1686
1656
  def __del__(self):
1687
1657
  _api.DecRef(self.handle)
1688
1658
  def __str__(self):
1689
1659
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1690
- sv = 'api.UnknownFunctionHandler{'
1660
+ sv = 'api.GoValue{'
1691
1661
  first = True
1692
1662
  for v in pr:
1693
1663
  if callable(v[1]):
@@ -1700,11 +1670,41 @@ class UnknownFunctionHandler(go.GoClass):
1700
1670
  return sv + '}'
1701
1671
  def __repr__(self):
1702
1672
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1703
- sv = 'api.UnknownFunctionHandler ( '
1673
+ sv = 'api.GoValue ( '
1704
1674
  for v in pr:
1705
1675
  if not callable(v[1]):
1706
1676
  sv += v[0] + '=' + str(v[1]) + ', '
1707
1677
  return sv + ')'
1678
+ def ID(self):
1679
+ """ID() str"""
1680
+ return _api.api_GoValue_ID(self.handle)
1681
+ def MarshalJSON(self):
1682
+ """MarshalJSON() []int, str"""
1683
+ return go.Slice_byte(handle=_api.api_GoValue_MarshalJSON(self.handle))
1684
+ def Type(self):
1685
+ """Type() str"""
1686
+ return _api.api_GoValue_Type(self.handle)
1687
+ def Int(self):
1688
+ """Int() long, str"""
1689
+ return _api.api_GoValue_Int(self.handle)
1690
+ def Float(self):
1691
+ """Float() float, str"""
1692
+ return _api.api_GoValue_Float(self.handle)
1693
+ def String(self):
1694
+ """String() str, str"""
1695
+ return _api.api_GoValue_String(self.handle)
1696
+ def Bool(self):
1697
+ """Bool() bool, str"""
1698
+ return _api.api_GoValue_Bool(self.handle)
1699
+ def Slice(self):
1700
+ """Slice() []object, str"""
1701
+ return Slice_api_GoValue(handle=_api.api_GoValue_Slice(self.handle))
1702
+ def Map(self):
1703
+ """Map() object, str"""
1704
+ return Map_string_api_GoValue(handle=_api.api_GoValue_Map(self.handle))
1705
+ def Object(self):
1706
+ """Object() object, str"""
1707
+ return go.Ptr_environment_ObjectInstance(handle=_api.api_GoValue_Object(self.handle))
1708
1708
 
1709
1709
 
1710
1710
  # ---- Slices ---
@@ -1714,36 +1714,18 @@ class UnknownFunctionHandler(go.GoClass):
1714
1714
 
1715
1715
 
1716
1716
  # ---- Constructors ---
1717
- def WrapString(value):
1718
- """WrapString(str value) object"""
1719
- return GoValue(handle=_api.api_WrapString(value))
1720
- def ToGoValue(val):
1721
- """ToGoValue(object val) object, str
1717
+ def NewConfigError(message, wrapped):
1718
+ """NewConfigError(str message, str wrapped) object
1722
1719
 
1723
- ToGoValue converts an Objective-LOL value to a Go value
1720
+ NewConfigError creates a new configuration error
1724
1721
  """
1725
- return GoValue(handle=_api.api_ToGoValue(val.handle))
1726
- def WrapAny(value):
1727
- """WrapAny(str value) object"""
1728
- return GoValue(handle=_api.api_WrapAny(value))
1729
- def WrapObject(value):
1730
- """WrapObject(object value) object"""
1731
- return GoValue(handle=_api.api_WrapObject(value.handle))
1732
- def WrapBool(value):
1733
- """WrapBool(bool value) object"""
1734
- return GoValue(handle=_api.api_WrapBool(value))
1735
- def WrapFloat(value):
1736
- """WrapFloat(float value) object"""
1737
- return GoValue(handle=_api.api_WrapFloat(value))
1738
- def WrapInt(value):
1739
- """WrapInt(long value) object"""
1740
- return GoValue(handle=_api.api_WrapInt(value))
1741
- def DefaultConfig():
1742
- """DefaultConfig() object
1722
+ return VMError(handle=_api.api_NewConfigError(message, wrapped))
1723
+ def NewTimeoutError(duration):
1724
+ """NewTimeoutError(long duration) object
1743
1725
 
1744
- DefaultConfig returns a default configuration
1726
+ NewTimeoutError creates a new timeout error
1745
1727
  """
1746
- return VMConfig(handle=_api.api_DefaultConfig())
1728
+ return VMError(handle=_api.api_NewTimeoutError(duration))
1747
1729
  def NewConversionError(message, wrapped):
1748
1730
  """NewConversionError(str message, str wrapped) object
1749
1731
 
@@ -1756,48 +1738,66 @@ def NewCompileError(message, source):
1756
1738
  NewCompileError creates a new compile error
1757
1739
  """
1758
1740
  return VMError(handle=_api.api_NewCompileError(message, source.handle))
1759
- def NewConfigError(message, wrapped):
1760
- """NewConfigError(str message, str wrapped) object
1761
-
1762
- NewConfigError creates a new configuration error
1763
- """
1764
- return VMError(handle=_api.api_NewConfigError(message, wrapped))
1765
1741
  def NewRuntimeError(message, source):
1766
1742
  """NewRuntimeError(str message, object source) object
1767
1743
 
1768
1744
  NewRuntimeError creates a new runtime error
1769
1745
  """
1770
1746
  return VMError(handle=_api.api_NewRuntimeError(message, source.handle))
1771
- def NewTimeoutError(duration):
1772
- """NewTimeoutError(long duration) object
1747
+ def NewVM(config):
1748
+ """NewVM(object config) object, str
1773
1749
 
1774
- NewTimeoutError creates a new timeout error
1750
+ NewVM creates a new VM instance with the given config
1775
1751
  """
1776
- return VMError(handle=_api.api_NewTimeoutError(duration))
1752
+ return VM(handle=_api.api_NewVM(config.handle))
1753
+ def DefaultConfig():
1754
+ """DefaultConfig() object
1755
+
1756
+ DefaultConfig returns a default configuration
1757
+ """
1758
+ return VMConfig(handle=_api.api_DefaultConfig())
1777
1759
  def NewClassDefinition():
1778
1760
  """NewClassDefinition() object"""
1779
1761
  return ClassDefinition(handle=_api.api_NewClassDefinition())
1780
- def NewVM(config):
1781
- """NewVM(object config) object, str
1762
+ def ToGoValue(val):
1763
+ """ToGoValue(object val) object, str
1782
1764
 
1783
- NewVM creates a new VM instance with the given config
1765
+ ToGoValue converts an Objective-LOL value to a Go value
1784
1766
  """
1785
- return VM(handle=_api.api_NewVM(config.handle))
1767
+ return GoValue(handle=_api.api_ToGoValue(val.handle))
1768
+ def WrapBool(value):
1769
+ """WrapBool(bool value) object"""
1770
+ return GoValue(handle=_api.api_WrapBool(value))
1771
+ def WrapInt(value):
1772
+ """WrapInt(long value) object"""
1773
+ return GoValue(handle=_api.api_WrapInt(value))
1774
+ def WrapAny(value):
1775
+ """WrapAny(str value) object"""
1776
+ return GoValue(handle=_api.api_WrapAny(value))
1777
+ def WrapObject(value):
1778
+ """WrapObject(object value) object"""
1779
+ return GoValue(handle=_api.api_WrapObject(value.handle))
1780
+ def WrapFloat(value):
1781
+ """WrapFloat(float value) object"""
1782
+ return GoValue(handle=_api.api_WrapFloat(value))
1783
+ def WrapString(value):
1784
+ """WrapString(str value) object"""
1785
+ return GoValue(handle=_api.api_WrapString(value))
1786
1786
 
1787
1787
 
1788
1788
  # ---- Functions ---
1789
- def ConvertArguments(args):
1790
- """ConvertArguments([]object args) []object, str
1791
-
1792
- ConvertArguments converts a slice of Go values to Objective-LOL values
1793
- """
1794
- return Slice_environment_Value(handle=_api.api_ConvertArguments(args.handle))
1795
1789
  def FromGoValue(val):
1796
1790
  """FromGoValue(object val) object, str
1797
1791
 
1798
1792
  FromGoValue converts a Go value to an Objective-LOL value
1799
1793
  """
1800
1794
  return go.environment_Value(handle=_api.api_FromGoValue(val.handle))
1795
+ def ConvertArguments(args):
1796
+ """ConvertArguments([]object args) []object, str
1797
+
1798
+ ConvertArguments converts a slice of Go values to Objective-LOL values
1799
+ """
1800
+ return Slice_environment_Value(handle=_api.api_ConvertArguments(args.handle))
1801
1801
  def LookupObject(id):
1802
1802
  """LookupObject(str id) object, str"""
1803
1803
  return go.Ptr_environment_ObjectInstance(handle=_api.api_LookupObject(id))