objective-lol 0.0.1__cp310-cp310-win_amd64.whl → 0.0.2__cp310-cp310-win_amd64.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,6 +741,138 @@ TimeoutErrorType = "timeout"
741
741
 
742
742
  # ---- Structs ---
743
743
 
744
+ # Python type for struct api.ClassDefinition
745
+ class ClassDefinition(go.GoClass):
746
+ """"""
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_ClassDefinition_CTor()
761
+ _api.IncRef(self.handle)
762
+ if 0 < len(args):
763
+ self.Name = args[0]
764
+ if "Name" in kwargs:
765
+ self.Name = kwargs["Name"]
766
+ if 1 < len(args):
767
+ self.PublicVariables = args[1]
768
+ if "PublicVariables" in kwargs:
769
+ self.PublicVariables = kwargs["PublicVariables"]
770
+ if 2 < len(args):
771
+ self.PrivateVariables = args[2]
772
+ if "PrivateVariables" in kwargs:
773
+ self.PrivateVariables = kwargs["PrivateVariables"]
774
+ if 3 < len(args):
775
+ self.SharedVariables = args[3]
776
+ if "SharedVariables" in kwargs:
777
+ self.SharedVariables = kwargs["SharedVariables"]
778
+ if 4 < len(args):
779
+ self.PublicMethods = args[4]
780
+ if "PublicMethods" in kwargs:
781
+ self.PublicMethods = kwargs["PublicMethods"]
782
+ if 5 < len(args):
783
+ self.PrivateMethods = args[5]
784
+ if "PrivateMethods" in kwargs:
785
+ self.PrivateMethods = kwargs["PrivateMethods"]
786
+ if 6 < len(args):
787
+ self.UnknownFunctionHandler = args[6]
788
+ if "UnknownFunctionHandler" in kwargs:
789
+ self.UnknownFunctionHandler = kwargs["UnknownFunctionHandler"]
790
+ def __del__(self):
791
+ _api.DecRef(self.handle)
792
+ def __str__(self):
793
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
794
+ sv = 'api.ClassDefinition{'
795
+ first = True
796
+ for v in pr:
797
+ if callable(v[1]):
798
+ continue
799
+ if first:
800
+ first = False
801
+ else:
802
+ sv += ', '
803
+ sv += v[0] + '=' + str(v[1])
804
+ return sv + '}'
805
+ def __repr__(self):
806
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
807
+ sv = 'api.ClassDefinition ( '
808
+ for v in pr:
809
+ if not callable(v[1]):
810
+ sv += v[0] + '=' + str(v[1]) + ', '
811
+ return sv + ')'
812
+ @property
813
+ def Name(self):
814
+ return _api.api_ClassDefinition_Name_Get(self.handle)
815
+ @Name.setter
816
+ def Name(self, value):
817
+ if isinstance(value, go.GoClass):
818
+ _api.api_ClassDefinition_Name_Set(self.handle, value.handle)
819
+ else:
820
+ _api.api_ClassDefinition_Name_Set(self.handle, value)
821
+ @property
822
+ def PublicVariables(self):
823
+ return Map_string_Ptr_api_ClassVariable(handle=_api.api_ClassDefinition_PublicVariables_Get(self.handle))
824
+ @PublicVariables.setter
825
+ def PublicVariables(self, value):
826
+ if isinstance(value, go.GoClass):
827
+ _api.api_ClassDefinition_PublicVariables_Set(self.handle, value.handle)
828
+ else:
829
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
830
+ @property
831
+ def PrivateVariables(self):
832
+ return Map_string_Ptr_api_ClassVariable(handle=_api.api_ClassDefinition_PrivateVariables_Get(self.handle))
833
+ @PrivateVariables.setter
834
+ def PrivateVariables(self, value):
835
+ if isinstance(value, go.GoClass):
836
+ _api.api_ClassDefinition_PrivateVariables_Set(self.handle, value.handle)
837
+ else:
838
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
839
+ @property
840
+ def SharedVariables(self):
841
+ return Map_string_Ptr_api_ClassVariable(handle=_api.api_ClassDefinition_SharedVariables_Get(self.handle))
842
+ @SharedVariables.setter
843
+ def SharedVariables(self, value):
844
+ if isinstance(value, go.GoClass):
845
+ _api.api_ClassDefinition_SharedVariables_Set(self.handle, value.handle)
846
+ else:
847
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
848
+ @property
849
+ def PublicMethods(self):
850
+ return Map_string_Ptr_api_ClassMethod(handle=_api.api_ClassDefinition_PublicMethods_Get(self.handle))
851
+ @PublicMethods.setter
852
+ def PublicMethods(self, value):
853
+ if isinstance(value, go.GoClass):
854
+ _api.api_ClassDefinition_PublicMethods_Set(self.handle, value.handle)
855
+ else:
856
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
857
+ @property
858
+ def PrivateMethods(self):
859
+ return Map_string_Ptr_api_ClassMethod(handle=_api.api_ClassDefinition_PrivateMethods_Get(self.handle))
860
+ @PrivateMethods.setter
861
+ def PrivateMethods(self, value):
862
+ if isinstance(value, go.GoClass):
863
+ _api.api_ClassDefinition_PrivateMethods_Set(self.handle, value.handle)
864
+ else:
865
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
866
+ @property
867
+ def UnknownFunctionHandler(self):
868
+ return UnknownFunctionHandler(handle=_api.api_ClassDefinition_UnknownFunctionHandler_Get(self.handle))
869
+ @UnknownFunctionHandler.setter
870
+ def UnknownFunctionHandler(self, value):
871
+ if isinstance(value, go.GoClass):
872
+ _api.api_ClassDefinition_UnknownFunctionHandler_Set(self.handle, value.handle)
873
+ else:
874
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
875
+
744
876
  # Python type for struct api.ClassMethod
745
877
  class ClassMethod(go.GoClass):
746
878
  """"""
@@ -888,9 +1020,9 @@ class ClassVariable(go.GoClass):
888
1020
  else:
889
1021
  _api.api_ClassVariable_Locked_Set(self.handle, value)
890
1022
 
891
- # Python type for struct api.SourceLocation
892
- class SourceLocation(go.GoClass):
893
- """SourceLocation represents a location in source code\n"""
1023
+ # Python type for struct api.ExecutionResult
1024
+ class ExecutionResult(go.GoClass):
1025
+ """ExecutionResult represents the result of executing Objective-LOL code\n"""
894
1026
  def __init__(self, *args, **kwargs):
895
1027
  """
896
1028
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -904,25 +1036,25 @@ class SourceLocation(go.GoClass):
904
1036
  self.handle = args[0].handle
905
1037
  _api.IncRef(self.handle)
906
1038
  else:
907
- self.handle = _api.api_SourceLocation_CTor()
1039
+ self.handle = _api.api_ExecutionResult_CTor()
908
1040
  _api.IncRef(self.handle)
909
1041
  if 0 < len(args):
910
- self.Filename = args[0]
911
- if "Filename" in kwargs:
912
- self.Filename = kwargs["Filename"]
1042
+ self.Value = args[0]
1043
+ if "Value" in kwargs:
1044
+ self.Value = kwargs["Value"]
913
1045
  if 1 < len(args):
914
- self.Line = args[1]
915
- if "Line" in kwargs:
916
- self.Line = kwargs["Line"]
1046
+ self.RawValue = args[1]
1047
+ if "RawValue" in kwargs:
1048
+ self.RawValue = kwargs["RawValue"]
917
1049
  if 2 < len(args):
918
- self.Column = args[2]
919
- if "Column" in kwargs:
920
- self.Column = kwargs["Column"]
1050
+ self.Output = args[2]
1051
+ if "Output" in kwargs:
1052
+ self.Output = kwargs["Output"]
921
1053
  def __del__(self):
922
1054
  _api.DecRef(self.handle)
923
1055
  def __str__(self):
924
1056
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
925
- sv = 'api.SourceLocation{'
1057
+ sv = 'api.ExecutionResult{'
926
1058
  first = True
927
1059
  for v in pr:
928
1060
  if callable(v[1]):
@@ -935,42 +1067,48 @@ class SourceLocation(go.GoClass):
935
1067
  return sv + '}'
936
1068
  def __repr__(self):
937
1069
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
938
- sv = 'api.SourceLocation ( '
1070
+ sv = 'api.ExecutionResult ( '
939
1071
  for v in pr:
940
1072
  if not callable(v[1]):
941
1073
  sv += v[0] + '=' + str(v[1]) + ', '
942
1074
  return sv + ')'
943
1075
  @property
944
- def Filename(self):
945
- return _api.api_SourceLocation_Filename_Get(self.handle)
946
- @Filename.setter
947
- def Filename(self, value):
1076
+ def Value(self):
1077
+ """Return value from the execution (e.g., from MAIN function)
1078
+ """
1079
+ return GoValue(handle=_api.api_ExecutionResult_Value_Get(self.handle))
1080
+ @Value.setter
1081
+ def Value(self, value):
948
1082
  if isinstance(value, go.GoClass):
949
- _api.api_SourceLocation_Filename_Set(self.handle, value.handle)
1083
+ _api.api_ExecutionResult_Value_Set(self.handle, value.handle)
950
1084
  else:
951
- _api.api_SourceLocation_Filename_Set(self.handle, value)
1085
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
952
1086
  @property
953
- def Line(self):
954
- return _api.api_SourceLocation_Line_Get(self.handle)
955
- @Line.setter
956
- def Line(self, value):
1087
+ def RawValue(self):
1088
+ """Raw Objective-LOL value (for advanced use)
1089
+ """
1090
+ return go.environment_Value(handle=_api.api_ExecutionResult_RawValue_Get(self.handle))
1091
+ @RawValue.setter
1092
+ def RawValue(self, value):
957
1093
  if isinstance(value, go.GoClass):
958
- _api.api_SourceLocation_Line_Set(self.handle, value.handle)
1094
+ _api.api_ExecutionResult_RawValue_Set(self.handle, value.handle)
959
1095
  else:
960
- _api.api_SourceLocation_Line_Set(self.handle, value)
1096
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
961
1097
  @property
962
- def Column(self):
963
- return _api.api_SourceLocation_Column_Get(self.handle)
964
- @Column.setter
965
- def Column(self, value):
1098
+ def Output(self):
1099
+ """Output captured during execution (if configured)
1100
+ """
1101
+ return _api.api_ExecutionResult_Output_Get(self.handle)
1102
+ @Output.setter
1103
+ def Output(self, value):
966
1104
  if isinstance(value, go.GoClass):
967
- _api.api_SourceLocation_Column_Set(self.handle, value.handle)
1105
+ _api.api_ExecutionResult_Output_Set(self.handle, value.handle)
968
1106
  else:
969
- _api.api_SourceLocation_Column_Set(self.handle, value)
1107
+ _api.api_ExecutionResult_Output_Set(self.handle, value)
970
1108
 
971
- # Python type for struct api.UnknownFunctionHandler
972
- class UnknownFunctionHandler(go.GoClass):
973
- """"""
1109
+ # Python type for struct api.VM
1110
+ class VM(go.GoClass):
1111
+ """VM represents an Objective-LOL virtual machine instance\n"""
974
1112
  def __init__(self, *args, **kwargs):
975
1113
  """
976
1114
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -984,13 +1122,13 @@ class UnknownFunctionHandler(go.GoClass):
984
1122
  self.handle = args[0].handle
985
1123
  _api.IncRef(self.handle)
986
1124
  else:
987
- self.handle = _api.api_UnknownFunctionHandler_CTor()
1125
+ self.handle = _api.api_VM_CTor()
988
1126
  _api.IncRef(self.handle)
989
1127
  def __del__(self):
990
1128
  _api.DecRef(self.handle)
991
1129
  def __str__(self):
992
1130
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
993
- sv = 'api.UnknownFunctionHandler{'
1131
+ sv = 'api.VM{'
994
1132
  first = True
995
1133
  for v in pr:
996
1134
  if callable(v[1]):
@@ -1003,96 +1141,140 @@ class UnknownFunctionHandler(go.GoClass):
1003
1141
  return sv + '}'
1004
1142
  def __repr__(self):
1005
1143
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1006
- sv = 'api.UnknownFunctionHandler ( '
1144
+ sv = 'api.VM ( '
1007
1145
  for v in pr:
1008
1146
  if not callable(v[1]):
1009
1147
  sv += v[0] + '=' + str(v[1]) + ', '
1010
1148
  return sv + ')'
1011
-
1012
- # Python type for struct api.VMCompatibilityShim
1013
- class VMCompatibilityShim(go.GoClass):
1014
- """VMCompatibilityShim is a shim to provide compatibility for external\nlanguages that cannot interact with the standard VM interface through\nGo types. Message passing is done through JSON strings.\n"""
1015
- def __init__(self, *args, **kwargs):
1149
+ def GetCompatibilityShim(self):
1150
+ """GetCompatibilityShim() object
1151
+
1152
+ GetCompatibilityShim returns a compatibility shim for the VM
1016
1153
  """
1017
- handle=A Go-side object is always initialized with an explicit handle=arg
1018
- otherwise parameters can be unnamed in order of field names or named fields
1019
- in which case a new Go object is constructed first
1154
+ return VMCompatibilityShim(handle=_api.api_VM_GetCompatibilityShim(self.handle))
1155
+ def Execute(self, code):
1156
+ """Execute(str code) object, str
1157
+
1158
+ Execute executes Objective-LOL code from a string
1020
1159
  """
1021
- if len(kwargs) == 1 and 'handle' in kwargs:
1022
- self.handle = kwargs['handle']
1023
- _api.IncRef(self.handle)
1024
- elif len(args) == 1 and isinstance(args[0], go.GoClass):
1025
- self.handle = args[0].handle
1026
- _api.IncRef(self.handle)
1027
- else:
1028
- self.handle = _api.api_VMCompatibilityShim_CTor()
1029
- _api.IncRef(self.handle)
1030
- def __del__(self):
1031
- _api.DecRef(self.handle)
1032
- def __str__(self):
1033
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1034
- sv = 'api.VMCompatibilityShim{'
1035
- first = True
1036
- for v in pr:
1037
- if callable(v[1]):
1038
- continue
1039
- if first:
1040
- first = False
1041
- else:
1042
- sv += ', '
1043
- sv += v[0] + '=' + str(v[1])
1160
+ return ExecutionResult(handle=_api.api_VM_Execute(self.handle, code))
1161
+ def ExecuteWithContext(self, ctx, code):
1162
+ """ExecuteWithContext(object ctx, str code) object, str
1163
+
1164
+ ExecuteWithContext executes code with a context for cancellation/timeout
1165
+ """
1166
+ return ExecutionResult(handle=_api.api_VM_ExecuteWithContext(self.handle, ctx.handle, code))
1167
+ def NewObjectInstance(self, className):
1168
+ """NewObjectInstance(str className) object, str"""
1169
+ return GoValue(handle=_api.api_VM_NewObjectInstance(self.handle, className))
1170
+ def Call(self, functionName, args):
1171
+ """Call(str functionName, []object args) object, str
1172
+
1173
+ Call calls an Objective-LOL function with the given arguments
1174
+ """
1175
+ return GoValue(handle=_api.api_VM_Call(self.handle, functionName, args.handle))
1176
+ def CallMethod(self, object, methodName, args):
1177
+ """CallMethod(object object, str methodName, []object args) object, str
1178
+
1179
+ CallMethod calls a method on an Objective-LOL object
1180
+ """
1181
+ return GoValue(handle=_api.api_VM_CallMethod(self.handle, object.handle, methodName, args.handle))
1182
+ def DefineVariable(self, name, value, constant):
1183
+ """DefineVariable(str name, object value, bool constant) str
1184
+
1185
+ DefineVariable defines a global variable in the VM
1186
+ """
1187
+ return _api.api_VM_DefineVariable(self.handle, name, value.handle, constant)
1188
+ def SetVariable(self, variableName, value):
1189
+ """SetVariable(str variableName, object value) str
1190
+
1191
+ SetVariable sets a variable in the global environment
1192
+ """
1193
+ return _api.api_VM_SetVariable(self.handle, variableName, value.handle)
1194
+ def GetVariable(self, variableName):
1195
+ """GetVariable(str variableName) object, str
1196
+
1197
+ Get gets a variable from the global environment
1198
+ """
1199
+ return GoValue(handle=_api.api_VM_GetVariable(self.handle, variableName))
1200
+ def DefineClass(self, classDef):
1201
+ """DefineClass(object classDef) str"""
1202
+ return _api.api_VM_DefineClass(self.handle, classDef.handle)
1203
+
1204
+ # Python type for struct api.GoValue
1205
+ class GoValue(go.GoClass):
1206
+ """"""
1207
+ def __init__(self, *args, **kwargs):
1208
+ """
1209
+ handle=A Go-side object is always initialized with an explicit handle=arg
1210
+ otherwise parameters can be unnamed in order of field names or named fields
1211
+ in which case a new Go object is constructed first
1212
+ """
1213
+ if len(kwargs) == 1 and 'handle' in kwargs:
1214
+ self.handle = kwargs['handle']
1215
+ _api.IncRef(self.handle)
1216
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
1217
+ self.handle = args[0].handle
1218
+ _api.IncRef(self.handle)
1219
+ else:
1220
+ self.handle = _api.api_GoValue_CTor()
1221
+ _api.IncRef(self.handle)
1222
+ def __del__(self):
1223
+ _api.DecRef(self.handle)
1224
+ def __str__(self):
1225
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1226
+ sv = 'api.GoValue{'
1227
+ first = True
1228
+ for v in pr:
1229
+ if callable(v[1]):
1230
+ continue
1231
+ if first:
1232
+ first = False
1233
+ else:
1234
+ sv += ', '
1235
+ sv += v[0] + '=' + str(v[1])
1044
1236
  return sv + '}'
1045
1237
  def __repr__(self):
1046
1238
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1047
- sv = 'api.VMCompatibilityShim ( '
1239
+ sv = 'api.GoValue ( '
1048
1240
  for v in pr:
1049
1241
  if not callable(v[1]):
1050
1242
  sv += v[0] + '=' + str(v[1]) + ', '
1051
1243
  return sv + ')'
1052
- def DefineFunction(self, id, name, argc, function):
1053
- """DefineFunction(str id, str name, int argc, callable function) str
1054
-
1055
- DefineFunction defines a global function with maximum compatibility,
1056
- wrapping arguments and return values as JSON strings.
1057
- An optional id cookie is passed back to the function to identify it.
1058
- jsonArgs is a JSON array string of the arguments.
1059
- The function should return a JSON object string with "result" and "error" fields.
1060
- """
1061
- return _api.api_VMCompatibilityShim_DefineFunction(self.handle, id, name, argc, function)
1062
- def BuildNewClassVariableWithGetter(self, variable, getterID, getter):
1063
- """BuildNewClassVariableWithGetter(object variable, str getterID, callable getter) object"""
1064
- return ClassVariable(handle=_api.api_VMCompatibilityShim_BuildNewClassVariableWithGetter(self.handle, variable.handle, getterID, getter))
1065
- def BuildNewClassVariableWithSetter(self, variable, setterID, setter):
1066
- """BuildNewClassVariableWithSetter(object variable, str setterID, callable setter) object"""
1067
- return ClassVariable(handle=_api.api_VMCompatibilityShim_BuildNewClassVariableWithSetter(self.handle, variable.handle, setterID, setter))
1068
- def BuildNewClassMethod(self, method, id, function):
1069
- """BuildNewClassMethod(object method, str id, callable function) object"""
1070
- return ClassMethod(handle=_api.api_VMCompatibilityShim_BuildNewClassMethod(self.handle, method.handle, id, function))
1071
- def BuildNewUnknownFunctionHandler(self, id, function):
1072
- """BuildNewUnknownFunctionHandler(str id, callable function) object"""
1073
- return UnknownFunctionHandler(handle=_api.api_VMCompatibilityShim_BuildNewUnknownFunctionHandler(self.handle, id, function))
1074
- def IsClassDefined(self, name):
1075
- """IsClassDefined(str name) bool"""
1076
- return _api.api_VMCompatibilityShim_IsClassDefined(self.handle, name)
1077
- def LookupObject(self, id):
1078
- """LookupObject(str id) object, str"""
1079
- return GoValue(handle=_api.api_VMCompatibilityShim_LookupObject(self.handle, id))
1080
- def GetObjectMRO(self, id):
1081
- """GetObjectMRO(str id) []str, str"""
1082
- return go.Slice_string(handle=_api.api_VMCompatibilityShim_GetObjectMRO(self.handle, id))
1083
- def GetObjectImmediateFunctions(self, id):
1084
- """GetObjectImmediateFunctions(str id) []str, str"""
1085
- return go.Slice_string(handle=_api.api_VMCompatibilityShim_GetObjectImmediateFunctions(self.handle, id))
1086
- def GetObjectImmediateVariables(self, id):
1087
- """GetObjectImmediateVariables(str id) []str, str"""
1088
- return go.Slice_string(handle=_api.api_VMCompatibilityShim_GetObjectImmediateVariables(self.handle, id))
1089
- def AddVariableToObject(self, id, variable):
1090
- """AddVariableToObject(str id, object variable) str"""
1091
- return _api.api_VMCompatibilityShim_AddVariableToObject(self.handle, id, variable.handle)
1244
+ def ID(self):
1245
+ """ID() str"""
1246
+ return _api.api_GoValue_ID(self.handle)
1247
+ def MarshalJSON(self):
1248
+ """MarshalJSON() []int, str"""
1249
+ return go.Slice_byte(handle=_api.api_GoValue_MarshalJSON(self.handle))
1250
+ def Type(self):
1251
+ """Type() str"""
1252
+ return _api.api_GoValue_Type(self.handle)
1253
+ def Int(self):
1254
+ """Int() long, str"""
1255
+ return _api.api_GoValue_Int(self.handle)
1256
+ def Float(self):
1257
+ """Float() float, str"""
1258
+ return _api.api_GoValue_Float(self.handle)
1259
+ def String(self):
1260
+ """String() str, str"""
1261
+ return _api.api_GoValue_String(self.handle)
1262
+ def Bool(self):
1263
+ """Bool() bool, str"""
1264
+ return _api.api_GoValue_Bool(self.handle)
1265
+ def Slice(self):
1266
+ """Slice() []object, str"""
1267
+ return Slice_api_GoValue(handle=_api.api_GoValue_Slice(self.handle))
1268
+ def Map(self):
1269
+ """Map() object, str"""
1270
+ return Map_string_api_GoValue(handle=_api.api_GoValue_Map(self.handle))
1271
+ def Object(self):
1272
+ """Object() object, str"""
1273
+ return go.Ptr_environment_ObjectInstance(handle=_api.api_GoValue_Object(self.handle))
1092
1274
 
1093
- # Python type for struct api.VMConfig
1094
- class VMConfig(go.GoClass):
1095
- """VMConfig holds configuration options for the VM\n"""
1275
+ # Python type for struct api.SourceLocation
1276
+ class SourceLocation(go.GoClass):
1277
+ """SourceLocation represents a location in source code\n"""
1096
1278
  def __init__(self, *args, **kwargs):
1097
1279
  """
1098
1280
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -1106,29 +1288,25 @@ class VMConfig(go.GoClass):
1106
1288
  self.handle = args[0].handle
1107
1289
  _api.IncRef(self.handle)
1108
1290
  else:
1109
- self.handle = _api.api_VMConfig_CTor()
1291
+ self.handle = _api.api_SourceLocation_CTor()
1110
1292
  _api.IncRef(self.handle)
1111
1293
  if 0 < len(args):
1112
- self.Stdout = args[0]
1113
- if "Stdout" in kwargs:
1114
- self.Stdout = kwargs["Stdout"]
1294
+ self.Filename = args[0]
1295
+ if "Filename" in kwargs:
1296
+ self.Filename = kwargs["Filename"]
1115
1297
  if 1 < len(args):
1116
- self.Stdin = args[1]
1117
- if "Stdin" in kwargs:
1118
- self.Stdin = kwargs["Stdin"]
1298
+ self.Line = args[1]
1299
+ if "Line" in kwargs:
1300
+ self.Line = kwargs["Line"]
1119
1301
  if 2 < len(args):
1120
- self.Timeout = args[2]
1121
- if "Timeout" in kwargs:
1122
- self.Timeout = kwargs["Timeout"]
1123
- if 3 < len(args):
1124
- self.WorkingDirectory = args[3]
1125
- if "WorkingDirectory" in kwargs:
1126
- self.WorkingDirectory = kwargs["WorkingDirectory"]
1302
+ self.Column = args[2]
1303
+ if "Column" in kwargs:
1304
+ self.Column = kwargs["Column"]
1127
1305
  def __del__(self):
1128
1306
  _api.DecRef(self.handle)
1129
1307
  def __str__(self):
1130
1308
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1131
- sv = 'api.VMConfig{'
1309
+ sv = 'api.SourceLocation{'
1132
1310
  first = True
1133
1311
  for v in pr:
1134
1312
  if callable(v[1]):
@@ -1141,60 +1319,41 @@ class VMConfig(go.GoClass):
1141
1319
  return sv + '}'
1142
1320
  def __repr__(self):
1143
1321
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1144
- sv = 'api.VMConfig ( '
1322
+ sv = 'api.SourceLocation ( '
1145
1323
  for v in pr:
1146
1324
  if not callable(v[1]):
1147
1325
  sv += v[0] + '=' + str(v[1]) + ', '
1148
1326
  return sv + ')'
1149
1327
  @property
1150
- def Stdout(self):
1151
- """I/O configuration
1152
- """
1153
- return go.io_Writer(handle=_api.api_VMConfig_Stdout_Get(self.handle))
1154
- @Stdout.setter
1155
- def Stdout(self, value):
1156
- if isinstance(value, go.GoClass):
1157
- _api.api_VMConfig_Stdout_Set(self.handle, value.handle)
1158
- else:
1159
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1160
- @property
1161
- def Stdin(self):
1162
- return go.io_Reader(handle=_api.api_VMConfig_Stdin_Get(self.handle))
1163
- @Stdin.setter
1164
- def Stdin(self, value):
1328
+ def Filename(self):
1329
+ return _api.api_SourceLocation_Filename_Get(self.handle)
1330
+ @Filename.setter
1331
+ def Filename(self, value):
1165
1332
  if isinstance(value, go.GoClass):
1166
- _api.api_VMConfig_Stdin_Set(self.handle, value.handle)
1333
+ _api.api_SourceLocation_Filename_Set(self.handle, value.handle)
1167
1334
  else:
1168
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1335
+ _api.api_SourceLocation_Filename_Set(self.handle, value)
1169
1336
  @property
1170
- def Timeout(self):
1171
- """Execution configuration
1172
- """
1173
- return _api.api_VMConfig_Timeout_Get(self.handle)
1174
- @Timeout.setter
1175
- def Timeout(self, value):
1337
+ def Line(self):
1338
+ return _api.api_SourceLocation_Line_Get(self.handle)
1339
+ @Line.setter
1340
+ def Line(self, value):
1176
1341
  if isinstance(value, go.GoClass):
1177
- _api.api_VMConfig_Timeout_Set(self.handle, value.handle)
1342
+ _api.api_SourceLocation_Line_Set(self.handle, value.handle)
1178
1343
  else:
1179
- _api.api_VMConfig_Timeout_Set(self.handle, value)
1344
+ _api.api_SourceLocation_Line_Set(self.handle, value)
1180
1345
  @property
1181
- def WorkingDirectory(self):
1182
- return _api.api_VMConfig_WorkingDirectory_Get(self.handle)
1183
- @WorkingDirectory.setter
1184
- def WorkingDirectory(self, value):
1346
+ def Column(self):
1347
+ return _api.api_SourceLocation_Column_Get(self.handle)
1348
+ @Column.setter
1349
+ def Column(self, value):
1185
1350
  if isinstance(value, go.GoClass):
1186
- _api.api_VMConfig_WorkingDirectory_Set(self.handle, value.handle)
1351
+ _api.api_SourceLocation_Column_Set(self.handle, value.handle)
1187
1352
  else:
1188
- _api.api_VMConfig_WorkingDirectory_Set(self.handle, value)
1189
- def Validate(self):
1190
- """Validate() str
1191
-
1192
- Validate checks if the configuration is valid
1193
- """
1194
- return _api.api_VMConfig_Validate(self.handle)
1353
+ _api.api_SourceLocation_Column_Set(self.handle, value)
1195
1354
 
1196
- # Python type for struct api.ClassDefinition
1197
- class ClassDefinition(go.GoClass):
1355
+ # Python type for struct api.UnknownFunctionHandler
1356
+ class UnknownFunctionHandler(go.GoClass):
1198
1357
  """"""
1199
1358
  def __init__(self, *args, **kwargs):
1200
1359
  """
@@ -1209,41 +1368,13 @@ class ClassDefinition(go.GoClass):
1209
1368
  self.handle = args[0].handle
1210
1369
  _api.IncRef(self.handle)
1211
1370
  else:
1212
- self.handle = _api.api_ClassDefinition_CTor()
1371
+ self.handle = _api.api_UnknownFunctionHandler_CTor()
1213
1372
  _api.IncRef(self.handle)
1214
- if 0 < len(args):
1215
- self.Name = args[0]
1216
- if "Name" in kwargs:
1217
- self.Name = kwargs["Name"]
1218
- if 1 < len(args):
1219
- self.PublicVariables = args[1]
1220
- if "PublicVariables" in kwargs:
1221
- self.PublicVariables = kwargs["PublicVariables"]
1222
- if 2 < len(args):
1223
- self.PrivateVariables = args[2]
1224
- if "PrivateVariables" in kwargs:
1225
- self.PrivateVariables = kwargs["PrivateVariables"]
1226
- if 3 < len(args):
1227
- self.SharedVariables = args[3]
1228
- if "SharedVariables" in kwargs:
1229
- self.SharedVariables = kwargs["SharedVariables"]
1230
- if 4 < len(args):
1231
- self.PublicMethods = args[4]
1232
- if "PublicMethods" in kwargs:
1233
- self.PublicMethods = kwargs["PublicMethods"]
1234
- if 5 < len(args):
1235
- self.PrivateMethods = args[5]
1236
- if "PrivateMethods" in kwargs:
1237
- self.PrivateMethods = kwargs["PrivateMethods"]
1238
- if 6 < len(args):
1239
- self.UnknownFunctionHandler = args[6]
1240
- if "UnknownFunctionHandler" in kwargs:
1241
- self.UnknownFunctionHandler = kwargs["UnknownFunctionHandler"]
1242
1373
  def __del__(self):
1243
1374
  _api.DecRef(self.handle)
1244
1375
  def __str__(self):
1245
1376
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1246
- sv = 'api.ClassDefinition{'
1377
+ sv = 'api.UnknownFunctionHandler{'
1247
1378
  first = True
1248
1379
  for v in pr:
1249
1380
  if callable(v[1]):
@@ -1256,78 +1387,15 @@ class ClassDefinition(go.GoClass):
1256
1387
  return sv + '}'
1257
1388
  def __repr__(self):
1258
1389
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1259
- sv = 'api.ClassDefinition ( '
1390
+ sv = 'api.UnknownFunctionHandler ( '
1260
1391
  for v in pr:
1261
1392
  if not callable(v[1]):
1262
1393
  sv += v[0] + '=' + str(v[1]) + ', '
1263
1394
  return sv + ')'
1264
- @property
1265
- def Name(self):
1266
- return _api.api_ClassDefinition_Name_Get(self.handle)
1267
- @Name.setter
1268
- def Name(self, value):
1269
- if isinstance(value, go.GoClass):
1270
- _api.api_ClassDefinition_Name_Set(self.handle, value.handle)
1271
- else:
1272
- _api.api_ClassDefinition_Name_Set(self.handle, value)
1273
- @property
1274
- def PublicVariables(self):
1275
- return Map_string_Ptr_api_ClassVariable(handle=_api.api_ClassDefinition_PublicVariables_Get(self.handle))
1276
- @PublicVariables.setter
1277
- def PublicVariables(self, value):
1278
- if isinstance(value, go.GoClass):
1279
- _api.api_ClassDefinition_PublicVariables_Set(self.handle, value.handle)
1280
- else:
1281
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1282
- @property
1283
- def PrivateVariables(self):
1284
- return Map_string_Ptr_api_ClassVariable(handle=_api.api_ClassDefinition_PrivateVariables_Get(self.handle))
1285
- @PrivateVariables.setter
1286
- def PrivateVariables(self, value):
1287
- if isinstance(value, go.GoClass):
1288
- _api.api_ClassDefinition_PrivateVariables_Set(self.handle, value.handle)
1289
- else:
1290
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1291
- @property
1292
- def SharedVariables(self):
1293
- return Map_string_Ptr_api_ClassVariable(handle=_api.api_ClassDefinition_SharedVariables_Get(self.handle))
1294
- @SharedVariables.setter
1295
- def SharedVariables(self, value):
1296
- if isinstance(value, go.GoClass):
1297
- _api.api_ClassDefinition_SharedVariables_Set(self.handle, value.handle)
1298
- else:
1299
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1300
- @property
1301
- def PublicMethods(self):
1302
- return Map_string_Ptr_api_ClassMethod(handle=_api.api_ClassDefinition_PublicMethods_Get(self.handle))
1303
- @PublicMethods.setter
1304
- def PublicMethods(self, value):
1305
- if isinstance(value, go.GoClass):
1306
- _api.api_ClassDefinition_PublicMethods_Set(self.handle, value.handle)
1307
- else:
1308
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1309
- @property
1310
- def PrivateMethods(self):
1311
- return Map_string_Ptr_api_ClassMethod(handle=_api.api_ClassDefinition_PrivateMethods_Get(self.handle))
1312
- @PrivateMethods.setter
1313
- def PrivateMethods(self, value):
1314
- if isinstance(value, go.GoClass):
1315
- _api.api_ClassDefinition_PrivateMethods_Set(self.handle, value.handle)
1316
- else:
1317
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1318
- @property
1319
- def UnknownFunctionHandler(self):
1320
- return UnknownFunctionHandler(handle=_api.api_ClassDefinition_UnknownFunctionHandler_Get(self.handle))
1321
- @UnknownFunctionHandler.setter
1322
- def UnknownFunctionHandler(self, value):
1323
- if isinstance(value, go.GoClass):
1324
- _api.api_ClassDefinition_UnknownFunctionHandler_Set(self.handle, value.handle)
1325
- else:
1326
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1327
1395
 
1328
- # Python type for struct api.GoValue
1329
- class GoValue(go.GoClass):
1330
- """"""
1396
+ # Python type for struct api.VMCompatibilityShim
1397
+ class VMCompatibilityShim(go.GoClass):
1398
+ """VMCompatibilityShim is a shim to provide compatibility for external\nlanguages that cannot interact with the standard VM interface through\nGo types. Message passing is done through JSON strings.\n"""
1331
1399
  def __init__(self, *args, **kwargs):
1332
1400
  """
1333
1401
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -1341,13 +1409,13 @@ class GoValue(go.GoClass):
1341
1409
  self.handle = args[0].handle
1342
1410
  _api.IncRef(self.handle)
1343
1411
  else:
1344
- self.handle = _api.api_GoValue_CTor()
1412
+ self.handle = _api.api_VMCompatibilityShim_CTor()
1345
1413
  _api.IncRef(self.handle)
1346
1414
  def __del__(self):
1347
1415
  _api.DecRef(self.handle)
1348
1416
  def __str__(self):
1349
1417
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1350
- sv = 'api.GoValue{'
1418
+ sv = 'api.VMCompatibilityShim{'
1351
1419
  first = True
1352
1420
  for v in pr:
1353
1421
  if callable(v[1]):
@@ -1360,45 +1428,55 @@ class GoValue(go.GoClass):
1360
1428
  return sv + '}'
1361
1429
  def __repr__(self):
1362
1430
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1363
- sv = 'api.GoValue ( '
1431
+ sv = 'api.VMCompatibilityShim ( '
1364
1432
  for v in pr:
1365
1433
  if not callable(v[1]):
1366
1434
  sv += v[0] + '=' + str(v[1]) + ', '
1367
1435
  return sv + ')'
1368
- def ID(self):
1369
- """ID() str"""
1370
- return _api.api_GoValue_ID(self.handle)
1371
- def MarshalJSON(self):
1372
- """MarshalJSON() []int, str"""
1373
- return go.Slice_byte(handle=_api.api_GoValue_MarshalJSON(self.handle))
1374
- def Type(self):
1375
- """Type() str"""
1376
- return _api.api_GoValue_Type(self.handle)
1377
- def Int(self):
1378
- """Int() long, str"""
1379
- return _api.api_GoValue_Int(self.handle)
1380
- def Float(self):
1381
- """Float() float, str"""
1382
- return _api.api_GoValue_Float(self.handle)
1383
- def String(self):
1384
- """String() str, str"""
1385
- return _api.api_GoValue_String(self.handle)
1386
- def Bool(self):
1387
- """Bool() bool, str"""
1388
- return _api.api_GoValue_Bool(self.handle)
1389
- def Slice(self):
1390
- """Slice() []object, str"""
1391
- return Slice_api_GoValue(handle=_api.api_GoValue_Slice(self.handle))
1392
- def Map(self):
1393
- """Map() object, str"""
1394
- return Map_string_api_GoValue(handle=_api.api_GoValue_Map(self.handle))
1395
- def Object(self):
1396
- """Object() object, str"""
1397
- return go.Ptr_environment_ObjectInstance(handle=_api.api_GoValue_Object(self.handle))
1436
+ def DefineFunction(self, id, name, argc, function):
1437
+ """DefineFunction(str id, str name, int argc, callable function) str
1438
+
1439
+ DefineFunction defines a global function with maximum compatibility,
1440
+ wrapping arguments and return values as JSON strings.
1441
+ An optional id cookie is passed back to the function to identify it.
1442
+ jsonArgs is a JSON array string of the arguments.
1443
+ The function should return a JSON object string with "result" and "error" fields.
1444
+ """
1445
+ return _api.api_VMCompatibilityShim_DefineFunction(self.handle, id, name, argc, function)
1446
+ def BuildNewClassVariableWithGetter(self, variable, getterID, getter):
1447
+ """BuildNewClassVariableWithGetter(object variable, str getterID, callable getter) object"""
1448
+ return ClassVariable(handle=_api.api_VMCompatibilityShim_BuildNewClassVariableWithGetter(self.handle, variable.handle, getterID, getter))
1449
+ def BuildNewClassVariableWithSetter(self, variable, setterID, setter):
1450
+ """BuildNewClassVariableWithSetter(object variable, str setterID, callable setter) object"""
1451
+ return ClassVariable(handle=_api.api_VMCompatibilityShim_BuildNewClassVariableWithSetter(self.handle, variable.handle, setterID, setter))
1452
+ def BuildNewClassMethod(self, method, id, function):
1453
+ """BuildNewClassMethod(object method, str id, callable function) object"""
1454
+ return ClassMethod(handle=_api.api_VMCompatibilityShim_BuildNewClassMethod(self.handle, method.handle, id, function))
1455
+ def BuildNewUnknownFunctionHandler(self, id, function):
1456
+ """BuildNewUnknownFunctionHandler(str id, callable function) object"""
1457
+ return UnknownFunctionHandler(handle=_api.api_VMCompatibilityShim_BuildNewUnknownFunctionHandler(self.handle, id, function))
1458
+ def IsClassDefined(self, name):
1459
+ """IsClassDefined(str name) bool"""
1460
+ return _api.api_VMCompatibilityShim_IsClassDefined(self.handle, name)
1461
+ def LookupObject(self, id):
1462
+ """LookupObject(str id) object, str"""
1463
+ return GoValue(handle=_api.api_VMCompatibilityShim_LookupObject(self.handle, id))
1464
+ def GetObjectMRO(self, id):
1465
+ """GetObjectMRO(str id) []str, str"""
1466
+ return go.Slice_string(handle=_api.api_VMCompatibilityShim_GetObjectMRO(self.handle, id))
1467
+ def GetObjectImmediateFunctions(self, id):
1468
+ """GetObjectImmediateFunctions(str id) []str, str"""
1469
+ return go.Slice_string(handle=_api.api_VMCompatibilityShim_GetObjectImmediateFunctions(self.handle, id))
1470
+ def GetObjectImmediateVariables(self, id):
1471
+ """GetObjectImmediateVariables(str id) []str, str"""
1472
+ return go.Slice_string(handle=_api.api_VMCompatibilityShim_GetObjectImmediateVariables(self.handle, id))
1473
+ def AddVariableToObject(self, id, variable):
1474
+ """AddVariableToObject(str id, object variable) str"""
1475
+ return _api.api_VMCompatibilityShim_AddVariableToObject(self.handle, id, variable.handle)
1398
1476
 
1399
- # Python type for struct api.VM
1400
- class VM(go.GoClass):
1401
- """VM represents an Objective-LOL virtual machine instance\n"""
1477
+ # Python type for struct api.VMConfig
1478
+ class VMConfig(go.GoClass):
1479
+ """VMConfig holds configuration options for the VM\n"""
1402
1480
  def __init__(self, *args, **kwargs):
1403
1481
  """
1404
1482
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -1412,13 +1490,29 @@ class VM(go.GoClass):
1412
1490
  self.handle = args[0].handle
1413
1491
  _api.IncRef(self.handle)
1414
1492
  else:
1415
- self.handle = _api.api_VM_CTor()
1493
+ self.handle = _api.api_VMConfig_CTor()
1416
1494
  _api.IncRef(self.handle)
1495
+ if 0 < len(args):
1496
+ self.Stdout = args[0]
1497
+ if "Stdout" in kwargs:
1498
+ self.Stdout = kwargs["Stdout"]
1499
+ if 1 < len(args):
1500
+ self.Stdin = args[1]
1501
+ if "Stdin" in kwargs:
1502
+ self.Stdin = kwargs["Stdin"]
1503
+ if 2 < len(args):
1504
+ self.Timeout = args[2]
1505
+ if "Timeout" in kwargs:
1506
+ self.Timeout = kwargs["Timeout"]
1507
+ if 3 < len(args):
1508
+ self.WorkingDirectory = args[3]
1509
+ if "WorkingDirectory" in kwargs:
1510
+ self.WorkingDirectory = kwargs["WorkingDirectory"]
1417
1511
  def __del__(self):
1418
1512
  _api.DecRef(self.handle)
1419
1513
  def __str__(self):
1420
1514
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1421
- sv = 'api.VM{'
1515
+ sv = 'api.VMConfig{'
1422
1516
  first = True
1423
1517
  for v in pr:
1424
1518
  if callable(v[1]):
@@ -1431,65 +1525,57 @@ class VM(go.GoClass):
1431
1525
  return sv + '}'
1432
1526
  def __repr__(self):
1433
1527
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1434
- sv = 'api.VM ( '
1528
+ sv = 'api.VMConfig ( '
1435
1529
  for v in pr:
1436
1530
  if not callable(v[1]):
1437
1531
  sv += v[0] + '=' + str(v[1]) + ', '
1438
1532
  return sv + ')'
1439
- def GetCompatibilityShim(self):
1440
- """GetCompatibilityShim() object
1441
-
1442
- GetCompatibilityShim returns a compatibility shim for the VM
1443
- """
1444
- return VMCompatibilityShim(handle=_api.api_VM_GetCompatibilityShim(self.handle))
1445
- def Execute(self, code):
1446
- """Execute(str code) object, str
1447
-
1448
- Execute executes Objective-LOL code from a string
1449
- """
1450
- return ExecutionResult(handle=_api.api_VM_Execute(self.handle, code))
1451
- def ExecuteWithContext(self, ctx, code):
1452
- """ExecuteWithContext(object ctx, str code) object, str
1453
-
1454
- ExecuteWithContext executes code with a context for cancellation/timeout
1455
- """
1456
- return ExecutionResult(handle=_api.api_VM_ExecuteWithContext(self.handle, ctx.handle, code))
1457
- def NewObjectInstance(self, className):
1458
- """NewObjectInstance(str className) object, str"""
1459
- return GoValue(handle=_api.api_VM_NewObjectInstance(self.handle, className))
1460
- def Call(self, functionName, args):
1461
- """Call(str functionName, []object args) object, str
1462
-
1463
- Call calls an Objective-LOL function with the given arguments
1464
- """
1465
- return GoValue(handle=_api.api_VM_Call(self.handle, functionName, args.handle))
1466
- def CallMethod(self, object, methodName, args):
1467
- """CallMethod(object object, str methodName, []object args) object, str
1468
-
1469
- CallMethod calls a method on an Objective-LOL object
1470
- """
1471
- return GoValue(handle=_api.api_VM_CallMethod(self.handle, object.handle, methodName, args.handle))
1472
- def DefineVariable(self, name, value, constant):
1473
- """DefineVariable(str name, object value, bool constant) str
1474
-
1475
- DefineVariable defines a global variable in the VM
1533
+ @property
1534
+ def Stdout(self):
1535
+ """I/O configuration
1476
1536
  """
1477
- return _api.api_VM_DefineVariable(self.handle, name, value.handle, constant)
1478
- def SetVariable(self, variableName, value):
1479
- """SetVariable(str variableName, object value) str
1480
-
1481
- SetVariable sets a variable in the global environment
1537
+ return go.io_Writer(handle=_api.api_VMConfig_Stdout_Get(self.handle))
1538
+ @Stdout.setter
1539
+ def Stdout(self, value):
1540
+ if isinstance(value, go.GoClass):
1541
+ _api.api_VMConfig_Stdout_Set(self.handle, value.handle)
1542
+ else:
1543
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1544
+ @property
1545
+ def Stdin(self):
1546
+ return go.io_Reader(handle=_api.api_VMConfig_Stdin_Get(self.handle))
1547
+ @Stdin.setter
1548
+ def Stdin(self, value):
1549
+ if isinstance(value, go.GoClass):
1550
+ _api.api_VMConfig_Stdin_Set(self.handle, value.handle)
1551
+ else:
1552
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1553
+ @property
1554
+ def Timeout(self):
1555
+ """Execution configuration
1482
1556
  """
1483
- return _api.api_VM_SetVariable(self.handle, variableName, value.handle)
1484
- def GetVariable(self, variableName):
1485
- """GetVariable(str variableName) object, str
1557
+ return _api.api_VMConfig_Timeout_Get(self.handle)
1558
+ @Timeout.setter
1559
+ def Timeout(self, value):
1560
+ if isinstance(value, go.GoClass):
1561
+ _api.api_VMConfig_Timeout_Set(self.handle, value.handle)
1562
+ else:
1563
+ _api.api_VMConfig_Timeout_Set(self.handle, value)
1564
+ @property
1565
+ def WorkingDirectory(self):
1566
+ return _api.api_VMConfig_WorkingDirectory_Get(self.handle)
1567
+ @WorkingDirectory.setter
1568
+ def WorkingDirectory(self, value):
1569
+ if isinstance(value, go.GoClass):
1570
+ _api.api_VMConfig_WorkingDirectory_Set(self.handle, value.handle)
1571
+ else:
1572
+ _api.api_VMConfig_WorkingDirectory_Set(self.handle, value)
1573
+ def Validate(self):
1574
+ """Validate() str
1486
1575
 
1487
- Get gets a variable from the global environment
1576
+ Validate checks if the configuration is valid
1488
1577
  """
1489
- return GoValue(handle=_api.api_VM_GetVariable(self.handle, variableName))
1490
- def DefineClass(self, classDef):
1491
- """DefineClass(object classDef) str"""
1492
- return _api.api_VM_DefineClass(self.handle, classDef.handle)
1578
+ return _api.api_VMConfig_Validate(self.handle)
1493
1579
 
1494
1580
  # Python type for struct api.VMError
1495
1581
  class VMError(go.GoClass):
@@ -1620,92 +1706,6 @@ class VMError(go.GoClass):
1620
1706
  """
1621
1707
  return _api.api_VMError_IsConfigError(self.handle)
1622
1708
 
1623
- # Python type for struct api.ExecutionResult
1624
- class ExecutionResult(go.GoClass):
1625
- """ExecutionResult represents the result of executing Objective-LOL code\n"""
1626
- def __init__(self, *args, **kwargs):
1627
- """
1628
- handle=A Go-side object is always initialized with an explicit handle=arg
1629
- otherwise parameters can be unnamed in order of field names or named fields
1630
- in which case a new Go object is constructed first
1631
- """
1632
- if len(kwargs) == 1 and 'handle' in kwargs:
1633
- self.handle = kwargs['handle']
1634
- _api.IncRef(self.handle)
1635
- elif len(args) == 1 and isinstance(args[0], go.GoClass):
1636
- self.handle = args[0].handle
1637
- _api.IncRef(self.handle)
1638
- else:
1639
- self.handle = _api.api_ExecutionResult_CTor()
1640
- _api.IncRef(self.handle)
1641
- if 0 < len(args):
1642
- self.Value = args[0]
1643
- if "Value" in kwargs:
1644
- self.Value = kwargs["Value"]
1645
- if 1 < len(args):
1646
- self.RawValue = args[1]
1647
- if "RawValue" in kwargs:
1648
- self.RawValue = kwargs["RawValue"]
1649
- if 2 < len(args):
1650
- self.Output = args[2]
1651
- if "Output" in kwargs:
1652
- self.Output = kwargs["Output"]
1653
- def __del__(self):
1654
- _api.DecRef(self.handle)
1655
- def __str__(self):
1656
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1657
- sv = 'api.ExecutionResult{'
1658
- first = True
1659
- for v in pr:
1660
- if callable(v[1]):
1661
- continue
1662
- if first:
1663
- first = False
1664
- else:
1665
- sv += ', '
1666
- sv += v[0] + '=' + str(v[1])
1667
- return sv + '}'
1668
- def __repr__(self):
1669
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1670
- sv = 'api.ExecutionResult ( '
1671
- for v in pr:
1672
- if not callable(v[1]):
1673
- sv += v[0] + '=' + str(v[1]) + ', '
1674
- return sv + ')'
1675
- @property
1676
- def Value(self):
1677
- """Return value from the execution (e.g., from MAIN function)
1678
- """
1679
- return GoValue(handle=_api.api_ExecutionResult_Value_Get(self.handle))
1680
- @Value.setter
1681
- def Value(self, value):
1682
- if isinstance(value, go.GoClass):
1683
- _api.api_ExecutionResult_Value_Set(self.handle, value.handle)
1684
- else:
1685
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1686
- @property
1687
- def RawValue(self):
1688
- """Raw Objective-LOL value (for advanced use)
1689
- """
1690
- return go.environment_Value(handle=_api.api_ExecutionResult_RawValue_Get(self.handle))
1691
- @RawValue.setter
1692
- def RawValue(self, value):
1693
- if isinstance(value, go.GoClass):
1694
- _api.api_ExecutionResult_RawValue_Set(self.handle, value.handle)
1695
- else:
1696
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1697
- @property
1698
- def Output(self):
1699
- """Output captured during execution (if configured)
1700
- """
1701
- return _api.api_ExecutionResult_Output_Get(self.handle)
1702
- @Output.setter
1703
- def Output(self, value):
1704
- if isinstance(value, go.GoClass):
1705
- _api.api_ExecutionResult_Output_Set(self.handle, value.handle)
1706
- else:
1707
- _api.api_ExecutionResult_Output_Set(self.handle, value)
1708
-
1709
1709
 
1710
1710
  # ---- Slices ---
1711
1711
 
@@ -1714,51 +1714,45 @@ class ExecutionResult(go.GoClass):
1714
1714
 
1715
1715
 
1716
1716
  # ---- Constructors ---
1717
- def DefaultConfig():
1718
- """DefaultConfig() object
1719
-
1720
- DefaultConfig returns a default configuration
1721
- """
1722
- return VMConfig(handle=_api.api_DefaultConfig())
1723
1717
  def NewClassDefinition():
1724
1718
  """NewClassDefinition() object"""
1725
1719
  return ClassDefinition(handle=_api.api_NewClassDefinition())
1720
+ def NewVM(config):
1721
+ """NewVM(object config) object, str
1722
+
1723
+ NewVM creates a new VM instance with the given config
1724
+ """
1725
+ return VM(handle=_api.api_NewVM(config.handle))
1726
+ def WrapInt(value):
1727
+ """WrapInt(long value) object"""
1728
+ return GoValue(handle=_api.api_WrapInt(value))
1726
1729
  def WrapObject(value):
1727
1730
  """WrapObject(object value) object"""
1728
1731
  return GoValue(handle=_api.api_WrapObject(value.handle))
1732
+ def WrapAny(value):
1733
+ """WrapAny(str value) object"""
1734
+ return GoValue(handle=_api.api_WrapAny(value))
1735
+ def WrapBool(value):
1736
+ """WrapBool(bool value) object"""
1737
+ return GoValue(handle=_api.api_WrapBool(value))
1729
1738
  def ToGoValue(val):
1730
1739
  """ToGoValue(object val) object, str
1731
1740
 
1732
1741
  ToGoValue converts an Objective-LOL value to a Go value
1733
1742
  """
1734
1743
  return GoValue(handle=_api.api_ToGoValue(val.handle))
1735
- def WrapBool(value):
1736
- """WrapBool(bool value) object"""
1737
- return GoValue(handle=_api.api_WrapBool(value))
1738
1744
  def WrapFloat(value):
1739
1745
  """WrapFloat(float value) object"""
1740
1746
  return GoValue(handle=_api.api_WrapFloat(value))
1741
1747
  def WrapString(value):
1742
1748
  """WrapString(str value) object"""
1743
1749
  return GoValue(handle=_api.api_WrapString(value))
1744
- def WrapInt(value):
1745
- """WrapInt(long value) object"""
1746
- return GoValue(handle=_api.api_WrapInt(value))
1747
- def WrapAny(value):
1748
- """WrapAny(str value) object"""
1749
- return GoValue(handle=_api.api_WrapAny(value))
1750
- def NewVM(config):
1751
- """NewVM(object config) object, str
1752
-
1753
- NewVM creates a new VM instance with the given config
1754
- """
1755
- return VM(handle=_api.api_NewVM(config.handle))
1756
- def NewConversionError(message, wrapped):
1757
- """NewConversionError(str message, str wrapped) object
1750
+ def DefaultConfig():
1751
+ """DefaultConfig() object
1758
1752
 
1759
- NewConversionError creates a new type conversion error
1753
+ DefaultConfig returns a default configuration
1760
1754
  """
1761
- return VMError(handle=_api.api_NewConversionError(message, wrapped))
1755
+ return VMConfig(handle=_api.api_DefaultConfig())
1762
1756
  def NewCompileError(message, source):
1763
1757
  """NewCompileError(str message, object source) object
1764
1758
 
@@ -1771,35 +1765,41 @@ def NewConfigError(message, wrapped):
1771
1765
  NewConfigError creates a new configuration error
1772
1766
  """
1773
1767
  return VMError(handle=_api.api_NewConfigError(message, wrapped))
1774
- def NewRuntimeError(message, source):
1775
- """NewRuntimeError(str message, object source) object
1776
-
1777
- NewRuntimeError creates a new runtime error
1778
- """
1779
- return VMError(handle=_api.api_NewRuntimeError(message, source.handle))
1780
1768
  def NewTimeoutError(duration):
1781
1769
  """NewTimeoutError(long duration) object
1782
1770
 
1783
1771
  NewTimeoutError creates a new timeout error
1784
1772
  """
1785
1773
  return VMError(handle=_api.api_NewTimeoutError(duration))
1774
+ def NewConversionError(message, wrapped):
1775
+ """NewConversionError(str message, str wrapped) object
1776
+
1777
+ NewConversionError creates a new type conversion error
1778
+ """
1779
+ return VMError(handle=_api.api_NewConversionError(message, wrapped))
1780
+ def NewRuntimeError(message, source):
1781
+ """NewRuntimeError(str message, object source) object
1782
+
1783
+ NewRuntimeError creates a new runtime error
1784
+ """
1785
+ return VMError(handle=_api.api_NewRuntimeError(message, source.handle))
1786
1786
 
1787
1787
 
1788
1788
  # ---- Functions ---
1789
- def FromGoValue(val):
1790
- """FromGoValue(object val) object, str
1789
+ def ConvertArguments(args):
1790
+ """ConvertArguments([]object args) []object, str
1791
1791
 
1792
- FromGoValue converts a Go value to an Objective-LOL value
1792
+ ConvertArguments converts a slice of Go values to Objective-LOL values
1793
1793
  """
1794
- return go.environment_Value(handle=_api.api_FromGoValue(val.handle))
1794
+ return Slice_environment_Value(handle=_api.api_ConvertArguments(args.handle))
1795
1795
  def LookupObject(id):
1796
1796
  """LookupObject(str id) object, str"""
1797
1797
  return go.Ptr_environment_ObjectInstance(handle=_api.api_LookupObject(id))
1798
- def ConvertArguments(args):
1799
- """ConvertArguments([]object args) []object, str
1798
+ def FromGoValue(val):
1799
+ """FromGoValue(object val) object, str
1800
1800
 
1801
- ConvertArguments converts a slice of Go values to Objective-LOL values
1801
+ FromGoValue converts a Go value to an Objective-LOL value
1802
1802
  """
1803
- return Slice_environment_Value(handle=_api.api_ConvertArguments(args.handle))
1803
+ return go.environment_Value(handle=_api.api_FromGoValue(val.handle))
1804
1804
 
1805
1805