IncludeCPP 4.0.2__py3-none-any.whl → 4.0.3__py3-none-any.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.
@@ -278,6 +278,26 @@ class CSSLRuntime:
278
278
  self._setup_modules()
279
279
  self._setup_builtins()
280
280
 
281
+ def output(self, text: str, level: str = 'normal') -> None:
282
+ """Output text, using callback if available, otherwise print."""
283
+ if self._output_callback:
284
+ self._output_callback(text, level)
285
+ else:
286
+ print(text, end='')
287
+ self.output_buffer.append(text)
288
+
289
+ def debug(self, text: str) -> None:
290
+ """Debug output."""
291
+ self.output(f"[DEBUG] {text}\n", 'debug')
292
+
293
+ def error(self, text: str) -> None:
294
+ """Error output."""
295
+ self.output(f"[ERROR] {text}\n", 'error')
296
+
297
+ def warn(self, text: str) -> None:
298
+ """Warning output."""
299
+ self.output(f"[WARN] {text}\n", 'warning')
300
+
281
301
  def _setup_modules(self):
282
302
  """Setup module references for @KernelClient, @VSRAM, etc."""
283
303
  if self.service_engine:
@@ -1310,29 +1330,38 @@ class CSSLRuntime:
1310
1330
  def _exec_instance_declaration(self, node: ASTNode) -> Any:
1311
1331
  """Execute instance declaration: instance<"name"> varName;
1312
1332
 
1313
- Gets or creates a shared instance by name.
1333
+ Gets or creates a universal shared instance by name.
1334
+ Universal instances are accessible from CSSL, Python, and C++.
1335
+
1336
+ Usage:
1337
+ instance<"myContainer"> container; // Creates or gets instance
1338
+ container.member = "value"; // Set member
1339
+ container +<<== { void func() {} } // Inject methods
1314
1340
  """
1315
- from ..cssl_bridge import _live_objects, SharedObjectProxy
1341
+ from .cssl_types import UniversalInstance
1342
+
1316
1343
  decl = node.value
1317
1344
  instance_name = decl.get('instance_name')
1318
1345
  var_name = decl.get('name')
1319
1346
  value_node = decl.get('value')
1320
1347
 
1321
- # Get existing shared instance
1322
- instance = None
1323
- if instance_name in _live_objects:
1324
- instance = SharedObjectProxy(instance_name, _live_objects[instance_name])
1325
- elif self.global_scope.has(f'${instance_name}'):
1326
- instance = self.global_scope.get(f'${instance_name}')
1348
+ # Get existing or create new universal instance
1349
+ instance = UniversalInstance.get_or_create(instance_name)
1327
1350
 
1328
- # If value is provided, use that and register as shared
1351
+ # If value is provided, set it as initial content
1329
1352
  if value_node:
1330
- instance = self._evaluate(value_node)
1331
- # Register in global scope for future access
1332
- self.global_scope.set(f'${instance_name}', instance)
1353
+ initial_value = self._evaluate(value_node)
1354
+ # If it's a dict, set all keys as members
1355
+ if isinstance(initial_value, dict):
1356
+ for key, val in initial_value.items():
1357
+ instance.set_member(key, val)
1358
+ else:
1359
+ instance.set_member('value', initial_value)
1333
1360
 
1334
- # Store in scope
1361
+ # Store in scope and global scope for access
1335
1362
  self.scope.set(var_name, instance)
1363
+ self.global_scope.set(f'${instance_name}', instance)
1364
+
1336
1365
  return instance
1337
1366
 
1338
1367
  def _exec_super_func(self, node: ASTNode) -> Any:
@@ -2736,8 +2765,13 @@ class CSSLRuntime:
2736
2765
  - add: func +<<== { code } - ADDS code to function (both execute)
2737
2766
  - remove: func -<<== { code } - REMOVES matching code from function
2738
2767
 
2768
+ Also supports instance injection:
2769
+ - instance +<<== { void method() { ... } } - ADDS methods to UniversalInstance
2770
+
2739
2771
  Also supports expression form: func <<== %exit() (wraps in action_block)
2740
2772
  """
2773
+ from .cssl_types import UniversalInstance
2774
+
2741
2775
  target = node.value.get('target')
2742
2776
  code_block = node.value.get('code')
2743
2777
  source_expr = node.value.get('source') # For expression form: func <<== expr
@@ -2749,6 +2783,17 @@ class CSSLRuntime:
2749
2783
  expr_node = ASTNode('expression', value=source_expr)
2750
2784
  code_block = ASTNode('action_block', children=[expr_node])
2751
2785
 
2786
+ # Check if target is a UniversalInstance
2787
+ target_value = None
2788
+ if isinstance(target, ASTNode) and target.type == 'identifier':
2789
+ target_value = self.scope.get(target.value)
2790
+ if target_value is None:
2791
+ target_value = self.global_scope.get(target.value)
2792
+
2793
+ # Handle UniversalInstance injection
2794
+ if isinstance(target_value, UniversalInstance):
2795
+ return self._inject_into_instance(target_value, code_block, mode)
2796
+
2752
2797
  # Get function name from target
2753
2798
  func_name = None
2754
2799
  if isinstance(target, ASTNode):
@@ -2796,6 +2841,60 @@ class CSSLRuntime:
2796
2841
 
2797
2842
  return None
2798
2843
 
2844
+ def _inject_into_instance(self, instance: Any, code_block: Any, mode: str) -> Any:
2845
+ """Inject code/methods into a UniversalInstance.
2846
+
2847
+ Usage:
2848
+ instance<"myContainer"> container;
2849
+ container +<<== {
2850
+ void sayHello() { printl("Hello!"); }
2851
+ int value = 42;
2852
+ }
2853
+ """
2854
+ from .cssl_types import UniversalInstance
2855
+
2856
+ if not isinstance(instance, UniversalInstance):
2857
+ return None
2858
+
2859
+ if code_block is None:
2860
+ return None
2861
+
2862
+ # Store the raw injection
2863
+ instance.add_injection(code_block)
2864
+
2865
+ # Parse the code block for function definitions and variable declarations
2866
+ if isinstance(code_block, ASTNode):
2867
+ children = code_block.children if hasattr(code_block, 'children') else []
2868
+
2869
+ for child in children:
2870
+ if isinstance(child, ASTNode):
2871
+ if child.type == 'function':
2872
+ # Extract function name and store the AST node
2873
+ func_info = child.value
2874
+ func_name = func_info.get('name') if isinstance(func_info, dict) else None
2875
+ if func_name:
2876
+ instance.set_method(func_name, child)
2877
+ elif child.type == 'var_declaration':
2878
+ # Extract variable and value
2879
+ var_info = child.value
2880
+ if isinstance(var_info, dict):
2881
+ var_name = var_info.get('name')
2882
+ value_node = var_info.get('value')
2883
+ if var_name:
2884
+ value = self._evaluate(value_node) if value_node else None
2885
+ instance.set_member(var_name, value)
2886
+ elif child.type == 'typed_var_declaration':
2887
+ # Typed variable declaration
2888
+ var_info = child.value
2889
+ if isinstance(var_info, dict):
2890
+ var_name = var_info.get('name')
2891
+ value_node = var_info.get('value')
2892
+ if var_name:
2893
+ value = self._evaluate(value_node) if value_node else None
2894
+ instance.set_member(var_name, value)
2895
+
2896
+ return instance
2897
+
2799
2898
  def _exec_infuse_right(self, node: ASTNode) -> Any:
2800
2899
  """Execute right-side code infusion (==>>)"""
2801
2900
  source = node.value.get('source')
@@ -3516,7 +3615,33 @@ class CSSLRuntime:
3516
3615
  if isinstance(callee, ASTNode) and callee.type == 'function':
3517
3616
  return self._call_function(callee, args, kwargs)
3518
3617
 
3519
- callee_name = callee_node.value if isinstance(callee_node, ASTNode) and hasattr(callee_node, 'value') else str(callee_node)
3618
+ # Extract callee name for error messages
3619
+ if isinstance(callee_node, ASTNode) and hasattr(callee_node, 'value'):
3620
+ val = callee_node.value
3621
+ if isinstance(val, str):
3622
+ callee_name = val
3623
+ elif isinstance(val, dict):
3624
+ # For member access nodes like obj.method, get the member name
3625
+ if 'member' in val:
3626
+ obj_node = val.get('object')
3627
+ member = val.get('member')
3628
+ obj_name = obj_node.value if isinstance(obj_node, ASTNode) else str(obj_node)
3629
+ callee_name = f"{obj_name}.{member}"
3630
+ # For call nodes, try to get the callee name
3631
+ elif 'callee' in val:
3632
+ callee_val = val.get('callee')
3633
+ if isinstance(callee_val, ASTNode):
3634
+ callee_name = callee_val.value if isinstance(callee_val.value, str) else str(callee_val.value)
3635
+ else:
3636
+ callee_name = str(callee_val)
3637
+ elif 'name' in val:
3638
+ callee_name = str(val.get('name'))
3639
+ else:
3640
+ callee_name = str(val)
3641
+ else:
3642
+ callee_name = str(val)
3643
+ else:
3644
+ callee_name = str(callee_node)
3520
3645
 
3521
3646
  # Build detailed error with suggestions
3522
3647
  available_funcs = _get_available_functions(self.scope, self.global_scope, self.builtins)
@@ -4112,6 +4237,48 @@ class CSSLRuntime:
4112
4237
  hint
4113
4238
  )
4114
4239
 
4240
+ # === UNIVERSAL INSTANCE METHODS ===
4241
+ from .cssl_types import UniversalInstance
4242
+ if isinstance(obj, UniversalInstance):
4243
+ # Check for member variable
4244
+ if obj.has_member(member):
4245
+ return obj.get_member(member)
4246
+ # Check for method
4247
+ if obj.has_method(member):
4248
+ method_node = obj.get_method(member)
4249
+ # Create a callable that executes the method in context
4250
+ def instance_method_caller(*args, **kwargs):
4251
+ # Set 'this' to refer to the instance
4252
+ old_this = self.scope.get('this')
4253
+ self.scope.set('this', obj)
4254
+ try:
4255
+ return self._call_function(method_node, list(args))
4256
+ finally:
4257
+ if old_this is not None:
4258
+ self.scope.set('this', old_this)
4259
+ else:
4260
+ self.scope.remove('this') if hasattr(self.scope, 'remove') else None
4261
+ return instance_method_caller
4262
+ # Build helpful error with available members
4263
+ instance_name = obj.name
4264
+ available_members = list(obj.get_all_members().keys())
4265
+ available_methods = list(obj.get_all_methods().keys())
4266
+ all_available = available_members + available_methods
4267
+ similar = _find_similar_names(member, all_available)
4268
+
4269
+ if similar:
4270
+ hint = f"Did you mean: {', '.join(similar)}?"
4271
+ elif all_available:
4272
+ hint = f"Available: {', '.join(all_available[:5])}"
4273
+ else:
4274
+ hint = f"Instance '{instance_name}' has no accessible members."
4275
+
4276
+ raise self._format_error(
4277
+ node.line,
4278
+ f"Instance '{instance_name}' has no member or method '{member}'",
4279
+ hint
4280
+ )
4281
+
4115
4282
  # === STRING METHODS ===
4116
4283
  if isinstance(obj, str):
4117
4284
  string_methods = self._get_string_method(obj, member)
@@ -4350,6 +4517,12 @@ class CSSLRuntime:
4350
4517
  obj.set_member(member, value)
4351
4518
  return
4352
4519
 
4520
+ # Check for UniversalInstance - use set_member method
4521
+ from .cssl_types import UniversalInstance
4522
+ if isinstance(obj, UniversalInstance):
4523
+ obj.set_member(member, value)
4524
+ return
4525
+
4353
4526
  # Check for SharedObjectProxy - directly access underlying object
4354
4527
  # This is more robust than relying on the proxy's __setattr__
4355
4528
  if hasattr(obj, '_direct_object') and hasattr(obj, '_name'):
@@ -1624,10 +1624,152 @@ class CSSLInstance:
1624
1624
  return f"<{self._class.name} instance at 0x{id(self):x}>"
1625
1625
 
1626
1626
 
1627
+ class UniversalInstance:
1628
+ """Universal shared container accessible from CSSL, Python, and C++.
1629
+
1630
+ Created via instance<"name"> syntax in CSSL or getInstance("name") in Python.
1631
+ Supports dynamic member/method injection via +<<== operator.
1632
+
1633
+ Example CSSL:
1634
+ instance<"myContainer"> container;
1635
+ container +<<== { void sayHello() { printl("Hello!"); } }
1636
+ container.sayHello();
1637
+
1638
+ Example Python:
1639
+ container = cssl.getInstance("myContainer")
1640
+ container.sayHello()
1641
+ """
1642
+
1643
+ # Global registry for all universal instances
1644
+ _registry: Dict[str, 'UniversalInstance'] = {}
1645
+
1646
+ def __init__(self, name: str):
1647
+ self._name = name
1648
+ self._members: Dict[str, Any] = {}
1649
+ self._methods: Dict[str, Any] = {} # Method name -> AST node or callable
1650
+ self._injections: List[Any] = [] # Code blocks injected via +<<==
1651
+ # Register globally
1652
+ UniversalInstance._registry[name] = self
1653
+
1654
+ @classmethod
1655
+ def get_or_create(cls, name: str) -> 'UniversalInstance':
1656
+ """Get existing instance or create new one."""
1657
+ if name in cls._registry:
1658
+ return cls._registry[name]
1659
+ return cls(name)
1660
+
1661
+ @classmethod
1662
+ def get(cls, name: str) -> Optional['UniversalInstance']:
1663
+ """Get existing instance by name, returns None if not found."""
1664
+ return cls._registry.get(name)
1665
+
1666
+ @classmethod
1667
+ def exists(cls, name: str) -> bool:
1668
+ """Check if instance exists."""
1669
+ return name in cls._registry
1670
+
1671
+ @classmethod
1672
+ def delete(cls, name: str) -> bool:
1673
+ """Delete instance from registry."""
1674
+ if name in cls._registry:
1675
+ del cls._registry[name]
1676
+ return True
1677
+ return False
1678
+
1679
+ @classmethod
1680
+ def clear_all(cls) -> int:
1681
+ """Clear all instances. Returns count of cleared instances."""
1682
+ count = len(cls._registry)
1683
+ cls._registry.clear()
1684
+ return count
1685
+
1686
+ @classmethod
1687
+ def list_all(cls) -> List[str]:
1688
+ """List all instance names."""
1689
+ return list(cls._registry.keys())
1690
+
1691
+ @property
1692
+ def name(self) -> str:
1693
+ """Get instance name."""
1694
+ return self._name
1695
+
1696
+ def set_member(self, name: str, value: Any) -> None:
1697
+ """Set a member value."""
1698
+ self._members[name] = value
1699
+
1700
+ def get_member(self, name: str) -> Any:
1701
+ """Get a member value."""
1702
+ if name in self._members:
1703
+ return self._members[name]
1704
+ raise AttributeError(f"Instance '{self._name}' has no member '{name}'")
1705
+
1706
+ def has_member(self, name: str) -> bool:
1707
+ """Check if member exists."""
1708
+ return name in self._members
1709
+
1710
+ def set_method(self, name: str, method: Any) -> None:
1711
+ """Set a method (AST node or callable)."""
1712
+ self._methods[name] = method
1713
+
1714
+ def get_method(self, name: str) -> Any:
1715
+ """Get a method by name."""
1716
+ if name in self._methods:
1717
+ return self._methods[name]
1718
+ raise AttributeError(f"Instance '{self._name}' has no method '{name}'")
1719
+
1720
+ def has_method(self, name: str) -> bool:
1721
+ """Check if method exists."""
1722
+ return name in self._methods
1723
+
1724
+ def add_injection(self, code_block: Any) -> None:
1725
+ """Add a code injection (from +<<== operator)."""
1726
+ self._injections.append(code_block)
1727
+
1728
+ def get_injections(self) -> List[Any]:
1729
+ """Get all injected code blocks."""
1730
+ return self._injections
1731
+
1732
+ def get_all_members(self) -> Dict[str, Any]:
1733
+ """Get all members."""
1734
+ return dict(self._members)
1735
+
1736
+ def get_all_methods(self) -> Dict[str, Any]:
1737
+ """Get all methods."""
1738
+ return dict(self._methods)
1739
+
1740
+ def __getattr__(self, name: str) -> Any:
1741
+ """Allow direct attribute access for members and methods."""
1742
+ if name.startswith('_'):
1743
+ raise AttributeError(name)
1744
+ if name in object.__getattribute__(self, '_members'):
1745
+ return object.__getattribute__(self, '_members')[name]
1746
+ if name in object.__getattribute__(self, '_methods'):
1747
+ return object.__getattribute__(self, '_methods')[name]
1748
+ raise AttributeError(f"Instance '{object.__getattribute__(self, '_name')}' has no attribute '{name}'")
1749
+
1750
+ def __setattr__(self, name: str, value: Any) -> None:
1751
+ """Allow direct attribute setting for members."""
1752
+ if name.startswith('_'):
1753
+ object.__setattr__(self, name, value)
1754
+ else:
1755
+ if hasattr(self, '_members'):
1756
+ self._members[name] = value
1757
+ else:
1758
+ object.__setattr__(self, name, value)
1759
+
1760
+ def __repr__(self):
1761
+ members = len(self._members)
1762
+ methods = len(self._methods)
1763
+ return f"<UniversalInstance '{self._name}' ({members} members, {methods} methods)>"
1764
+
1765
+ def __str__(self):
1766
+ return f"<UniversalInstance '{self._name}'>"
1767
+
1768
+
1627
1769
  __all__ = [
1628
1770
  'DataStruct', 'Shuffled', 'Iterator', 'Combo', 'DataSpace', 'OpenQuote',
1629
1771
  'OpenFind', 'Parameter', 'Stack', 'Vector', 'Array', 'List', 'Dictionary', 'Map',
1630
- 'CSSLClass', 'CSSLInstance',
1772
+ 'CSSLClass', 'CSSLInstance', 'UniversalInstance',
1631
1773
  'create_datastruct', 'create_shuffled', 'create_iterator',
1632
1774
  'create_combo', 'create_dataspace', 'create_openquote', 'create_parameter',
1633
1775
  'create_stack', 'create_vector', 'create_array', 'create_list', 'create_dictionary', 'create_map'
@@ -266,8 +266,8 @@ class CSSLFunctionModule:
266
266
 
267
267
  from .cssl import CSSLRuntime, parse_cssl_program, ASTNode
268
268
 
269
- # Create a dedicated runtime for this module
270
- self._runtime = CSSLRuntime()
269
+ # Create a dedicated runtime for this module, preserving output_callback
270
+ self._runtime = CSSLRuntime(output_callback=self._cssl._output_callback)
271
271
 
272
272
  # If we have a payload, load it first (defines functions/globals for main)
273
273
  if self._payload_code:
@@ -330,7 +330,12 @@ class CSSLFunctionModule:
330
330
  self._runtime.global_scope.set('parameter', Parameter(list(args)))
331
331
  self._runtime.global_scope.set('args', list(args))
332
332
  self._runtime.global_scope.set('argc', len(args))
333
- return self._runtime._call_function(func_node, list(args))
333
+ # Enable running flag for function execution
334
+ self._runtime._running = True
335
+ try:
336
+ return self._runtime._call_function(func_node, list(args))
337
+ finally:
338
+ self._runtime._running = False
334
339
 
335
340
  return wrapper
336
341
 
@@ -603,7 +608,8 @@ class CsslLang:
603
608
  self,
604
609
  main_script: Union[str, 'CSSLScript'],
605
610
  payload_script: Union[str, 'CSSLScript', None] = None,
606
- name: str = None
611
+ name: str = None,
612
+ bind: str = None
607
613
  ) -> 'CSSLFunctionModule':
608
614
  """
609
615
  Create a CSSL module with accessible functions.
@@ -612,13 +618,22 @@ class CsslLang:
612
618
  Optionally registers the module for payload() access in other scripts.
613
619
 
614
620
  Args:
615
- main_script: Main CSSL code (string or CSSLScript)
621
+ main_script: Main CSSL code, file path, or CSSLScript
616
622
  payload_script: Optional payload code (string or CSSLScript)
617
623
  name: Optional name to register for payload(name) access
624
+ bind: Optional payload name to auto-prepend (from makepayload)
618
625
 
619
626
  Returns:
620
627
  CSSLFunctionModule - module with callable function attributes
621
628
 
629
+ Usage (simplified - with file path and bind):
630
+ # First register the payload
631
+ cssl.makepayload("api", "lib/api/einkaufsmanager.cssl-pl")
632
+
633
+ # Then create module from file, binding to payload
634
+ mod = cssl.makemodule("writer", "lib/writer.cssl", bind="api")
635
+ mod.SaySomething("Hello!") # Functions are now accessible
636
+
622
637
  Usage (v3.8.0 - with CSSLScript objects):
623
638
  main = cssl.script("cssl", '''
624
639
  printl("Main");
@@ -644,6 +659,28 @@ class CsslLang:
644
659
  ''')
645
660
  module.greet("World") # Returns "Hello, World!"
646
661
  """
662
+ # Handle simplified API: makemodule(name, path, bind=...)
663
+ # Check if main_script looks like a short identifier and payload_script looks like a path
664
+ if (isinstance(main_script, str) and isinstance(payload_script, str) and
665
+ not '\n' in main_script and not ';' in main_script and not '{' in main_script):
666
+ # main_script is likely a name, payload_script is likely a path
667
+ module_name = main_script
668
+ path = payload_script
669
+
670
+ # Check if it's actually a file path
671
+ path_obj = Path(path)
672
+ if path_obj.exists():
673
+ main_code = path_obj.read_text(encoding='utf-8')
674
+
675
+ # If bind is specified, prepend that payload's code
676
+ payload_code = None
677
+ if bind:
678
+ runtime = self._get_runtime()
679
+ if hasattr(runtime, '_inline_payloads') and bind in runtime._inline_payloads:
680
+ payload_code = runtime._inline_payloads[bind]
681
+
682
+ return CSSLFunctionModule(self, main_code, payload_code, module_name)
683
+
647
684
  # Extract code from CSSLScript objects if provided
648
685
  if isinstance(main_script, CSSLScript):
649
686
  main_code = main_script.code
@@ -657,6 +694,12 @@ class CsslLang:
657
694
  else:
658
695
  payload_code = payload_script
659
696
 
697
+ # If bind is specified and no payload_script, use the bound payload
698
+ if bind and payload_code is None:
699
+ runtime = self._get_runtime()
700
+ if hasattr(runtime, '_inline_payloads') and bind in runtime._inline_payloads:
701
+ payload_code = runtime._inline_payloads[bind]
702
+
660
703
  return CSSLFunctionModule(self, main_code, payload_code, name)
661
704
 
662
705
  def load(self, path: str, name: str) -> None:
@@ -781,6 +824,45 @@ class CsslLang:
781
824
  runtime._inline_payloads = {}
782
825
  runtime._inline_payloads[name] = code
783
826
 
827
+ def makepayload(self, name: str, path: str) -> str:
828
+ """
829
+ Register a payload from a file path.
830
+
831
+ Reads the file and registers it as a payload accessible via payload(name) in CSSL.
832
+ This is a convenience method that combines reading a file and calling code().
833
+
834
+ Usage:
835
+ from includecpp import CSSL
836
+ cssl = CSSL.CsslLang()
837
+
838
+ # Register a payload from file
839
+ cssl.makepayload("api", "lib/api/myapi.cssl-pl")
840
+
841
+ # Now use in CSSL code
842
+ cssl.run('''
843
+ payload("api"); // Load the payload
844
+ myApiFunction(); // Call functions from it
845
+ ''')
846
+
847
+ # Or use with makemodule for automatic binding
848
+ mod = cssl.makemodule("writer", "lib/writer.cssl", bind="api")
849
+ mod.SaySomething("Hello!")
850
+
851
+ Args:
852
+ name: Name to register the payload under (used in payload(name) and bind=name)
853
+ path: Path to the .cssl-pl or .cssl file
854
+
855
+ Returns:
856
+ The payload code that was registered
857
+ """
858
+ path_obj = Path(path)
859
+ if not path_obj.exists():
860
+ raise FileNotFoundError(f"Payload file not found: {path}")
861
+
862
+ code = path_obj.read_text(encoding='utf-8')
863
+ self.code(name, code)
864
+ return code
865
+
784
866
  def share(self, instance: Any, name: str = None) -> str:
785
867
  """
786
868
  Share a Python object instance with CSSL scripts (LIVE sharing).
@@ -979,6 +1061,73 @@ class CsslLang:
979
1061
  """
980
1062
  return self.get_shared(name)
981
1063
 
1064
+ def getInstance(self, name: str) -> Optional[Any]:
1065
+ """
1066
+ Get a universal instance by name (for Python-side access).
1067
+
1068
+ Universal instances are shared containers accessible from CSSL, Python, and C++.
1069
+ They support dynamic member/method access and are mutable across all contexts.
1070
+
1071
+ Usage:
1072
+ from includecpp import CSSL
1073
+ cssl = CSSL.CsslLang()
1074
+
1075
+ # In CSSL: instance<"myContainer"> container;
1076
+ # Then in Python:
1077
+ container = cssl.getInstance("myContainer")
1078
+ container.member = "value"
1079
+ print(container.member) # value
1080
+
1081
+ Args:
1082
+ name: Name of the instance (without quotes)
1083
+
1084
+ Returns:
1085
+ The UniversalInstance or None if not found
1086
+ """
1087
+ from .cssl.cssl_types import UniversalInstance
1088
+ return UniversalInstance.get(name)
1089
+
1090
+ def createInstance(self, name: str) -> Any:
1091
+ """
1092
+ Create or get a universal instance by name (for Python-side creation).
1093
+
1094
+ Usage:
1095
+ container = cssl.createInstance("myContainer")
1096
+ container.data = {"key": "value"}
1097
+ # Now accessible in CSSL via instance<"myContainer">
1098
+
1099
+ Args:
1100
+ name: Name for the instance
1101
+
1102
+ Returns:
1103
+ The UniversalInstance (new or existing)
1104
+ """
1105
+ from .cssl.cssl_types import UniversalInstance
1106
+ return UniversalInstance.get_or_create(name)
1107
+
1108
+ def deleteInstance(self, name: str) -> bool:
1109
+ """
1110
+ Delete a universal instance by name.
1111
+
1112
+ Args:
1113
+ name: Name of the instance to delete
1114
+
1115
+ Returns:
1116
+ True if deleted, False if not found
1117
+ """
1118
+ from .cssl.cssl_types import UniversalInstance
1119
+ return UniversalInstance.delete(name)
1120
+
1121
+ def listInstances(self) -> list:
1122
+ """
1123
+ List all universal instance names.
1124
+
1125
+ Returns:
1126
+ List of instance names
1127
+ """
1128
+ from .cssl.cssl_types import UniversalInstance
1129
+ return UniversalInstance.list_all()
1130
+
982
1131
 
983
1132
  # Global shared objects registry (for cross-instance sharing)
984
1133
  _global_shared_objects: Dict[str, str] = {}
@@ -1303,14 +1452,49 @@ def module(code: str) -> CSSLModule:
1303
1452
  return get_cssl().module(code)
1304
1453
 
1305
1454
 
1455
+ def makepayload(name: str, path: str) -> str:
1456
+ """
1457
+ Register a payload from a file path.
1458
+
1459
+ Reads the file and registers it as a payload accessible via payload(name) in CSSL.
1460
+
1461
+ Usage:
1462
+ from includecpp import CSSL
1463
+
1464
+ # Register a payload from file
1465
+ CSSL.makepayload("api", "lib/api/myapi.cssl-pl")
1466
+
1467
+ # Use with makemodule for automatic binding
1468
+ mod = CSSL.makemodule("writer", "lib/writer.cssl", bind="api")
1469
+ mod.SaySomething("Hello!")
1470
+
1471
+ Args:
1472
+ name: Name to register the payload under (used in payload(name) and bind=name)
1473
+ path: Path to the .cssl-pl or .cssl file
1474
+
1475
+ Returns:
1476
+ The payload code that was registered
1477
+ """
1478
+ return get_cssl().makepayload(name, path)
1479
+
1480
+
1306
1481
  def makemodule(
1307
1482
  main_script: Union[str, CSSLScript],
1308
1483
  payload_script: Union[str, CSSLScript, None] = None,
1309
- name: str = None
1484
+ name: str = None,
1485
+ bind: str = None
1310
1486
  ) -> CSSLFunctionModule:
1311
1487
  """
1312
1488
  Create a CSSL module with accessible functions.
1313
1489
 
1490
+ Usage (simplified - with file path and bind):
1491
+ # First register the payload
1492
+ CSSL.makepayload("api", "lib/api/einkaufsmanager.cssl-pl")
1493
+
1494
+ # Then create module from file, binding to payload
1495
+ mod = CSSL.makemodule("writer", "lib/writer.cssl", bind="api")
1496
+ mod.SaySomething("Hello!")
1497
+
1314
1498
  Usage (v3.8.0 - with CSSLScript):
1315
1499
  main = CSSL.script("cssl", '''printl("Main");''')
1316
1500
  payload = CSSL.script("cssl-pl", '''void helper() {}''')
@@ -1323,14 +1507,15 @@ def makemodule(
1323
1507
  math_mod.add(2, 3) # Returns 5
1324
1508
 
1325
1509
  Args:
1326
- main_script: Main CSSL code (string or CSSLScript)
1510
+ main_script: Main CSSL code, file path, or CSSLScript
1327
1511
  payload_script: Optional payload code (string or CSSLScript)
1328
1512
  name: Optional name to register for payload(name) access
1513
+ bind: Optional payload name to auto-prepend (from makepayload)
1329
1514
 
1330
1515
  Returns:
1331
1516
  CSSLFunctionModule - module with callable function attributes
1332
1517
  """
1333
- return get_cssl().makemodule(main_script, payload_script, name)
1518
+ return get_cssl().makemodule(main_script, payload_script, name, bind)
1334
1519
 
1335
1520
 
1336
1521
  # Export all
@@ -1360,6 +1545,7 @@ __all__ = [
1360
1545
  'get_output',
1361
1546
  'clear_output',
1362
1547
  'module',
1548
+ 'makepayload',
1363
1549
  'makemodule',
1364
1550
  'share',
1365
1551
  'unshare',
@@ -412,7 +412,37 @@ class CsslLang:
412
412
  """
413
413
  ...
414
414
 
415
- def makemodule(self, code_or_script: Union[str, CSSLScript], *more: Any) -> CSSLFunctionModule:
415
+ def makepayload(self, name: str, path: str) -> str:
416
+ """
417
+ Register a payload from a file path.
418
+
419
+ Reads the file and registers it as a payload accessible via payload(name) in CSSL.
420
+ This is a convenience method for loading payload files.
421
+
422
+ Args:
423
+ name: Name to register the payload under (used in payload(name) and bind=name)
424
+ path: Path to the .cssl-pl or .cssl file
425
+
426
+ Returns:
427
+ The payload code that was registered
428
+
429
+ Usage:
430
+ # Register a payload from file
431
+ cssl.makepayload("api", "lib/api/myapi.cssl-pl")
432
+
433
+ # Use with makemodule for automatic binding
434
+ mod = cssl.makemodule("writer", "lib/writer.cssl", bind="api")
435
+ mod.SaySomething("Hello!")
436
+ """
437
+ ...
438
+
439
+ def makemodule(
440
+ self,
441
+ main_script: Union[str, CSSLScript],
442
+ payload_script: Union[str, CSSLScript, None] = ...,
443
+ name: str = ...,
444
+ bind: str = ...
445
+ ) -> CSSLFunctionModule:
416
446
  """
417
447
  Create a CSSL module with accessible functions as methods.
418
448
 
@@ -420,14 +450,23 @@ class CsslLang:
420
450
  Functions defined in the code become callable Python methods.
421
451
 
422
452
  Args:
423
- code_or_script: CSSL code string or CSSLScript object
424
- *more: Additional scripts or module name
453
+ main_script: CSSL code string, file path, or CSSLScript object
454
+ payload_script: Optional payload code (string or CSSLScript)
455
+ name: Optional name to register for payload(name) access
456
+ bind: Optional payload name to auto-prepend (from makepayload)
425
457
 
426
458
  Returns:
427
459
  CSSLFunctionModule with callable function attributes
428
460
 
429
- Usage:
430
- # From code string
461
+ Usage (simplified - with file path and bind):
462
+ # First register the payload
463
+ cssl.makepayload("api", "lib/api/einkaufsmanager.cssl-pl")
464
+
465
+ # Then create module from file, binding to payload
466
+ mod = cssl.makemodule("writer", "lib/writer.cssl", bind="api")
467
+ mod.SaySomething("Hello!") # Functions are now accessible
468
+
469
+ Usage (from code string):
431
470
  math = cssl.makemodule('''
432
471
  int add(int a, int b) { return a + b; }
433
472
  int sub(int a, int b) { return a - b; }
@@ -435,7 +474,7 @@ class CsslLang:
435
474
  print(math.add(10, 5)) # 15
436
475
  print(math.sub(10, 5)) # 5
437
476
 
438
- # From script objects (for .cssl-mod creation)
477
+ Usage (from script objects):
439
478
  main = cssl.script("cssl", "...")
440
479
  helpers = cssl.script("cssl-pl", "...")
441
480
  mod = cssl.makemodule(main, helpers, "mymodule")
@@ -541,6 +580,66 @@ class CsslLang:
541
580
  """
542
581
  ...
543
582
 
583
+ def getInstance(self, name: str) -> Optional[Any]:
584
+ """
585
+ Get a universal instance by name (for Python-side access).
586
+
587
+ Universal instances are shared containers accessible from CSSL, Python, and C++.
588
+ They support dynamic member/method access and are mutable across all contexts.
589
+
590
+ Args:
591
+ name: Name of the instance (without quotes)
592
+
593
+ Returns:
594
+ The UniversalInstance or None if not found
595
+
596
+ Usage:
597
+ # In CSSL: instance<"myContainer"> container;
598
+ # Then in Python:
599
+ container = cssl.getInstance("myContainer")
600
+ container.member = "value"
601
+ print(container.member) # value
602
+ """
603
+ ...
604
+
605
+ def createInstance(self, name: str) -> Any:
606
+ """
607
+ Create or get a universal instance by name (for Python-side creation).
608
+
609
+ Args:
610
+ name: Name for the instance
611
+
612
+ Returns:
613
+ The UniversalInstance (new or existing)
614
+
615
+ Usage:
616
+ container = cssl.createInstance("myContainer")
617
+ container.data = {"key": "value"}
618
+ # Now accessible in CSSL via instance<"myContainer">
619
+ """
620
+ ...
621
+
622
+ def deleteInstance(self, name: str) -> bool:
623
+ """
624
+ Delete a universal instance by name.
625
+
626
+ Args:
627
+ name: Name of the instance to delete
628
+
629
+ Returns:
630
+ True if deleted, False if not found
631
+ """
632
+ ...
633
+
634
+ def listInstances(self) -> List[str]:
635
+ """
636
+ List all universal instance names.
637
+
638
+ Returns:
639
+ List of instance names
640
+ """
641
+ ...
642
+
544
643
  def set_global(self, name: str, value: Any) -> None:
545
644
  """
546
645
  Set a global variable in the CSSL runtime.
@@ -733,20 +832,59 @@ def module(code: str) -> CSSLModule:
733
832
  ...
734
833
 
735
834
 
736
- def makemodule(code_or_script: Union[str, CSSLScript], *more: Any) -> CSSLFunctionModule:
835
+ def makepayload(name: str, path: str) -> str:
836
+ """
837
+ Register a payload from a file path.
838
+
839
+ Reads the file and registers it as a payload accessible via payload(name) in CSSL.
840
+
841
+ Args:
842
+ name: Name to register the payload under (used in payload(name) and bind=name)
843
+ path: Path to the .cssl-pl or .cssl file
844
+
845
+ Returns:
846
+ The payload code that was registered
847
+
848
+ Usage:
849
+ from includecpp import CSSL
850
+
851
+ # Register a payload from file
852
+ CSSL.makepayload("api", "lib/api/myapi.cssl-pl")
853
+
854
+ # Use with makemodule for automatic binding
855
+ mod = CSSL.makemodule("writer", "lib/writer.cssl", bind="api")
856
+ mod.SaySomething("Hello!")
857
+ """
858
+ ...
859
+
860
+
861
+ def makemodule(
862
+ main_script: Union[str, CSSLScript],
863
+ payload_script: Union[str, CSSLScript, None] = ...,
864
+ name: str = ...,
865
+ bind: str = ...
866
+ ) -> CSSLFunctionModule:
737
867
  """
738
868
  Create a CSSL module with accessible functions.
739
869
 
740
870
  Args:
741
- code_or_script: CSSL code string or CSSLScript object
742
- *more: Additional scripts or module name
871
+ main_script: CSSL code string, file path, or CSSLScript object
872
+ payload_script: Optional payload code (string or CSSLScript)
873
+ name: Optional name to register for payload(name) access
874
+ bind: Optional payload name to auto-prepend (from makepayload)
743
875
 
744
876
  Returns:
745
877
  CSSLFunctionModule with callable function attributes
746
878
 
747
- Usage:
879
+ Usage (simplified):
748
880
  from includecpp import CSSL
749
881
 
882
+ # Register payload and create module
883
+ CSSL.makepayload("api", "lib/api/myapi.cssl-pl")
884
+ mod = CSSL.makemodule("writer", "lib/writer.cssl", bind="api")
885
+ mod.SaySomething("Hello!")
886
+
887
+ Usage (code string):
750
888
  math = CSSL.makemodule('''
751
889
  int add(int a, int b) { return a + b; }
752
890
  ''')
@@ -2,7 +2,7 @@
2
2
  "name": "cssl",
3
3
  "displayName": "CSSL Language",
4
4
  "description": "Professional syntax highlighting, snippets, and language support for CSSL scripts (.cssl, .cssl-pl, .cssl-mod)",
5
- "version": "1.6.0",
5
+ "version": "1.7.1",
6
6
  "publisher": "IncludeCPP",
7
7
  "icon": "images/cssl.png",
8
8
  "engines": {
@@ -151,6 +151,48 @@
151
151
  "description": "Show output panel when running CSSL files"
152
152
  }
153
153
  }
154
+ },
155
+ "configurationDefaults": {
156
+ "editor.tokenColorCustomizations": {
157
+ "textMateRules": [
158
+ {
159
+ "scope": "storage.modifier.cssl",
160
+ "settings": {
161
+ "fontStyle": "italic"
162
+ }
163
+ },
164
+ {
165
+ "scope": "storage.modifier.extends.cssl",
166
+ "settings": {
167
+ "fontStyle": "italic"
168
+ }
169
+ },
170
+ {
171
+ "scope": "storage.modifier.overwrites.cssl",
172
+ "settings": {
173
+ "fontStyle": "italic"
174
+ }
175
+ },
176
+ {
177
+ "scope": "support.type.cssl",
178
+ "settings": {
179
+ "foreground": "#C586C0"
180
+ }
181
+ },
182
+ {
183
+ "scope": "variable.other.declaration.cssl",
184
+ "settings": {
185
+ "foreground": "#9CDCFE"
186
+ }
187
+ },
188
+ {
189
+ "scope": "variable.parameter.cssl",
190
+ "settings": {
191
+ "foreground": "#9CDCFE"
192
+ }
193
+ }
194
+ ]
195
+ }
154
196
  }
155
197
  }
156
198
  }
@@ -15,6 +15,7 @@
15
15
  { "include": "#super-call" },
16
16
  { "include": "#sql-types" },
17
17
  { "include": "#keywords" },
18
+ { "include": "#typed-declarations" },
18
19
  { "include": "#types" },
19
20
  { "include": "#function-modifiers" },
20
21
  { "include": "#injection-operators" },
@@ -211,17 +212,21 @@
211
212
  { "include": "#constructor-definition" },
212
213
  { "include": "#class-method-definition" },
213
214
  { "include": "#class-member-declaration" },
215
+ { "include": "#typed-declarations" },
214
216
  { "include": "#types" },
217
+ { "include": "#function-modifiers" },
215
218
  { "include": "#this-access" },
216
219
  { "include": "#captured-references" },
217
220
  { "include": "#global-references" },
218
221
  { "include": "#shared-references" },
222
+ { "include": "#instance-references" },
219
223
  { "include": "#strings" },
220
224
  { "include": "#numbers" },
221
225
  { "include": "#keywords" },
222
226
  { "include": "#function-calls" },
223
227
  { "include": "#builtins" },
224
- { "include": "#operators" }
228
+ { "include": "#operators" },
229
+ { "include": "#constants" }
225
230
  ]
226
231
  },
227
232
  {
@@ -241,17 +246,21 @@
241
246
  { "include": "#constructor-definition" },
242
247
  { "include": "#class-method-definition" },
243
248
  { "include": "#class-member-declaration" },
249
+ { "include": "#typed-declarations" },
244
250
  { "include": "#types" },
251
+ { "include": "#function-modifiers" },
245
252
  { "include": "#this-access" },
246
253
  { "include": "#captured-references" },
247
254
  { "include": "#global-references" },
248
255
  { "include": "#shared-references" },
256
+ { "include": "#instance-references" },
249
257
  { "include": "#strings" },
250
258
  { "include": "#numbers" },
251
259
  { "include": "#keywords" },
252
260
  { "include": "#function-calls" },
253
261
  { "include": "#builtins" },
254
- { "include": "#operators" }
262
+ { "include": "#operators" },
263
+ { "include": "#constants" }
255
264
  ]
256
265
  },
257
266
  {
@@ -267,17 +276,21 @@
267
276
  { "include": "#constructor-definition" },
268
277
  { "include": "#class-method-definition" },
269
278
  { "include": "#class-member-declaration" },
279
+ { "include": "#typed-declarations" },
270
280
  { "include": "#types" },
281
+ { "include": "#function-modifiers" },
271
282
  { "include": "#this-access" },
272
283
  { "include": "#captured-references" },
273
284
  { "include": "#global-references" },
274
285
  { "include": "#shared-references" },
286
+ { "include": "#instance-references" },
275
287
  { "include": "#strings" },
276
288
  { "include": "#numbers" },
277
289
  { "include": "#keywords" },
278
290
  { "include": "#function-calls" },
279
291
  { "include": "#builtins" },
280
- { "include": "#operators" }
292
+ { "include": "#operators" },
293
+ { "include": "#constants" }
281
294
  ]
282
295
  }
283
296
  ]
@@ -354,11 +367,42 @@
354
367
  "class-member-declaration": {
355
368
  "patterns": [
356
369
  {
370
+ "comment": "Generic type member: datastruct<dynamic> Container;",
371
+ "name": "meta.member.generic.cssl",
372
+ "match": "(\\b(?:array|vector|stack|list|dictionary|dict|map|datastruct|dataspace|shuffled|iterator|combo|openquote|tuple|set|queue))(<)([^>]+)(>)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*;",
373
+ "captures": {
374
+ "1": { "name": "support.type.cssl" },
375
+ "2": { "name": "punctuation.definition.typeparameters.begin.cssl" },
376
+ "3": { "name": "support.type.cssl" },
377
+ "4": { "name": "punctuation.definition.typeparameters.end.cssl" },
378
+ "5": { "name": "variable.other.declaration.cssl" }
379
+ }
380
+ },
381
+ {
382
+ "comment": "Primitive type member: string ApiID;",
357
383
  "name": "meta.member.cssl",
358
- "match": "\\b(int|string|float|bool|dynamic|auto)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*;",
384
+ "match": "\\b(int|string|float|bool|dynamic|auto|void|json|long|double)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*;",
359
385
  "captures": {
360
- "1": { "name": "storage.type.cssl" },
361
- "2": { "name": "variable.other.member.cssl" }
386
+ "1": { "name": "support.type.cssl" },
387
+ "2": { "name": "variable.other.declaration.cssl" }
388
+ }
389
+ },
390
+ {
391
+ "comment": "Container type member without generic: list items;",
392
+ "name": "meta.member.container.cssl",
393
+ "match": "\\b(array|vector|stack|list|dictionary|dict|map|datastruct|dataspace|shuffled|iterator|combo|openquote|tuple|set|queue)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*;",
394
+ "captures": {
395
+ "1": { "name": "support.type.cssl" },
396
+ "2": { "name": "variable.other.declaration.cssl" }
397
+ }
398
+ },
399
+ {
400
+ "comment": "Primitive type member with assignment: string ApiID = value;",
401
+ "name": "meta.member.assigned.cssl",
402
+ "match": "\\b(int|string|float|bool|dynamic|auto|void|json|long|double)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*=",
403
+ "captures": {
404
+ "1": { "name": "support.type.cssl" },
405
+ "2": { "name": "variable.other.declaration.cssl" }
362
406
  }
363
407
  }
364
408
  ]
@@ -440,10 +484,65 @@
440
484
  }
441
485
  ]
442
486
  },
487
+ "typed-declarations": {
488
+ "patterns": [
489
+ {
490
+ "comment": "Generic type declaration: datastruct<dynamic> Container; or vector<int> items;",
491
+ "name": "meta.declaration.typed.generic.cssl",
492
+ "match": "(\\b(?:array|vector|stack|list|dictionary|dict|map|datastruct|dataspace|shuffled|iterator|combo|openquote|tuple|set|queue))(<)([^>]+)(>)\\s+([a-zA-Z_][a-zA-Z0-9_]*)",
493
+ "captures": {
494
+ "1": { "name": "support.type.cssl" },
495
+ "2": { "name": "punctuation.definition.typeparameters.begin.cssl" },
496
+ "3": { "name": "support.type.cssl" },
497
+ "4": { "name": "punctuation.definition.typeparameters.end.cssl" },
498
+ "5": { "name": "variable.other.declaration.cssl" }
499
+ }
500
+ },
501
+ {
502
+ "comment": "Primitive type declaration: string ID; or int count;",
503
+ "name": "meta.declaration.typed.primitive.cssl",
504
+ "match": "\\b(int|string|float|bool|void|json|dynamic|auto|long|double)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=[;=])",
505
+ "captures": {
506
+ "1": { "name": "support.type.cssl" },
507
+ "2": { "name": "variable.other.declaration.cssl" }
508
+ }
509
+ },
510
+ {
511
+ "comment": "Container type declaration without generic: list items;",
512
+ "name": "meta.declaration.typed.container.cssl",
513
+ "match": "\\b(array|vector|stack|list|dictionary|dict|map|datastruct|dataspace|shuffled|iterator|combo|openquote|tuple|set|queue)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=[;=])",
514
+ "captures": {
515
+ "1": { "name": "support.type.cssl" },
516
+ "2": { "name": "variable.other.declaration.cssl" }
517
+ }
518
+ },
519
+ {
520
+ "comment": "Generic type in function parameter: func(datastruct<dynamic> param)",
521
+ "name": "meta.parameter.typed.generic.cssl",
522
+ "match": "(\\b(?:array|vector|stack|list|dictionary|dict|map|datastruct|dataspace|shuffled|iterator|combo|openquote|tuple|set|queue))(<)([^>]+)(>)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=[,)])",
523
+ "captures": {
524
+ "1": { "name": "support.type.cssl" },
525
+ "2": { "name": "punctuation.definition.typeparameters.begin.cssl" },
526
+ "3": { "name": "support.type.cssl" },
527
+ "4": { "name": "punctuation.definition.typeparameters.end.cssl" },
528
+ "5": { "name": "variable.parameter.cssl" }
529
+ }
530
+ },
531
+ {
532
+ "comment": "Primitive type in function parameter: func(string name)",
533
+ "name": "meta.parameter.typed.primitive.cssl",
534
+ "match": "\\b(int|string|float|bool|void|json|dynamic|auto|long|double)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=[,)])",
535
+ "captures": {
536
+ "1": { "name": "support.type.cssl" },
537
+ "2": { "name": "variable.parameter.cssl" }
538
+ }
539
+ }
540
+ ]
541
+ },
443
542
  "types": {
444
543
  "patterns": [
445
544
  {
446
- "name": "storage.type.primitive.cssl",
545
+ "name": "support.type.cssl",
447
546
  "match": "\\b(int|string|float|bool|void|json|dynamic|auto|long|double)\\b"
448
547
  },
449
548
  {
@@ -451,18 +550,18 @@
451
550
  "name": "meta.generic.cssl",
452
551
  "match": "(\\b(?:array|vector|stack|list|dictionary|dict|map|datastruct|dataspace|shuffled|iterator|combo|openquote|tuple|set|queue))(<)([^>]+)(>)",
453
552
  "captures": {
454
- "1": { "name": "storage.type.container.cssl" },
553
+ "1": { "name": "support.type.cssl" },
455
554
  "2": { "name": "punctuation.definition.typeparameters.begin.cssl" },
456
- "3": { "name": "storage.type.parameter.cssl" },
555
+ "3": { "name": "support.type.cssl" },
457
556
  "4": { "name": "punctuation.definition.typeparameters.end.cssl" }
458
557
  }
459
558
  },
460
559
  {
461
- "name": "storage.type.container.cssl",
560
+ "name": "support.type.cssl",
462
561
  "match": "\\b(array|vector|stack|list|dictionary|dict|map|datastruct|dataspace|shuffled|iterator|combo|openquote|instance|tuple|set|queue)\\b"
463
562
  },
464
563
  {
465
- "name": "storage.type.combo-open.cssl",
564
+ "name": "support.type.cssl",
466
565
  "match": "\\bcombo\\s*<\\s*open\\s*&"
467
566
  }
468
567
  ]
@@ -471,7 +570,7 @@
471
570
  "patterns": [
472
571
  {
473
572
  "name": "storage.modifier.cssl",
474
- "match": "\\b(undefined|open|closed|private|virtual|meta|super|sqlbased|protected|limited)\\b"
573
+ "match": "\\b(undefined|open|closed|private|virtual|meta|super|sqlbased|protected|limited|const|static|final|abstract|readonly)\\b"
475
574
  }
476
575
  ]
477
576
  },
@@ -619,24 +718,48 @@
619
718
  "instance-references": {
620
719
  "patterns": [
621
720
  {
622
- "comment": "instance<\"name\"> - shared instance reference with string",
721
+ "comment": "instance<\"name\"> varName - shared instance declaration with variable",
722
+ "name": "meta.instance.declaration.cssl",
723
+ "match": "(\\binstance)(<)(\"[^\"]+\")(>)\\s+([a-zA-Z_][a-zA-Z0-9_]*)",
724
+ "captures": {
725
+ "1": { "name": "support.type.cssl" },
726
+ "2": { "name": "punctuation.definition.typeparameters.begin.cssl" },
727
+ "3": { "name": "string.quoted.double.cssl" },
728
+ "4": { "name": "punctuation.definition.typeparameters.end.cssl" },
729
+ "5": { "name": "variable.other.declaration.cssl" }
730
+ }
731
+ },
732
+ {
733
+ "comment": "instance<Type> varName - shared instance declaration with type and variable",
734
+ "name": "meta.instance.declaration.cssl",
735
+ "match": "(\\binstance)(<)([a-zA-Z_][a-zA-Z0-9_]*)(>)\\s+([a-zA-Z_][a-zA-Z0-9_]*)",
736
+ "captures": {
737
+ "1": { "name": "support.type.cssl" },
738
+ "2": { "name": "punctuation.definition.typeparameters.begin.cssl" },
739
+ "3": { "name": "support.type.cssl" },
740
+ "4": { "name": "punctuation.definition.typeparameters.end.cssl" },
741
+ "5": { "name": "variable.other.declaration.cssl" }
742
+ }
743
+ },
744
+ {
745
+ "comment": "instance<\"name\"> - shared instance reference without variable",
623
746
  "name": "meta.instance.cssl",
624
747
  "match": "(\\binstance)(<)(\"[^\"]+\")(>)",
625
748
  "captures": {
626
- "1": { "name": "storage.type.instance.cssl" },
749
+ "1": { "name": "support.type.cssl" },
627
750
  "2": { "name": "punctuation.definition.typeparameters.begin.cssl" },
628
751
  "3": { "name": "string.quoted.double.cssl" },
629
752
  "4": { "name": "punctuation.definition.typeparameters.end.cssl" }
630
753
  }
631
754
  },
632
755
  {
633
- "comment": "instance<Type> - shared instance reference with type",
756
+ "comment": "instance<Type> - shared instance reference without variable",
634
757
  "name": "meta.instance.cssl",
635
758
  "match": "(\\binstance)(<)([a-zA-Z_][a-zA-Z0-9_]*)(>)",
636
759
  "captures": {
637
- "1": { "name": "storage.type.instance.cssl" },
760
+ "1": { "name": "support.type.cssl" },
638
761
  "2": { "name": "punctuation.definition.typeparameters.begin.cssl" },
639
- "3": { "name": "entity.name.type.cssl" },
762
+ "3": { "name": "support.type.cssl" },
640
763
  "4": { "name": "punctuation.definition.typeparameters.end.cssl" }
641
764
  }
642
765
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: IncludeCPP
3
- Version: 4.0.2
3
+ Version: 4.0.3
4
4
  Summary: Professional C++ Python bindings with type-generic templates, pystubs and native threading
5
5
  Home-page: https://github.com/liliassg/IncludeCPP
6
6
  Author: Lilias Hatterscheidt
@@ -11,8 +11,8 @@ includecpp/core/build_manager.py,sha256=uLuYsuiC6OsOGaU5wAJfl4M3IbdnIDgogfMd8VsV
11
11
  includecpp/core/cpp_api.py,sha256=8y_B1L18rhSBZln654xPPzqO2PdvAlLpJrfEjzl7Wnc,14039
12
12
  includecpp/core/cpp_api.pyi,sha256=IEiaKqaPItnn6rjL7aK32D3o9FYmRYCgCZbqiQNUwdc,3496
13
13
  includecpp/core/cppy_converter.py,sha256=b7yqu-aoa0wShNY0GvQT67TnNhYya4GyYmG7oDdqDV4,156686
14
- includecpp/core/cssl_bridge.py,sha256=AyYD-vFkxRtWy1LZv6OP_XJtPRWIPTf2YVHOiajmSY8,43016
15
- includecpp/core/cssl_bridge.pyi,sha256=fukpnvyRQEl8bn7KsKXYYOLUNydPscWGgq5O6pr9KKQ,24358
14
+ includecpp/core/cssl_bridge.py,sha256=xYfIRagegO8irdWl97dfanRB1qLU80p9lQ2wxkttGQ4,49963
15
+ includecpp/core/cssl_bridge.pyi,sha256=nreh2gtK94I6VFrzTWcYVUHN97wcYQF0dY_-HySi7yQ,28787
16
16
  includecpp/core/error_catalog.py,sha256=VS3N-P0yEbiHimsDPtcaYfrUb7mXQ-7pqw18PtSngaU,33869
17
17
  includecpp/core/error_formatter.py,sha256=7-MzRIT8cM4uODxy0IZ9pu7pqR4Pq2I8Si0QQZHjmVc,39239
18
18
  includecpp/core/exceptions.py,sha256=szeF4qdzi_q8hBBZi7mJxkliyQ0crplkLYe0ymlBGtk,2459
@@ -27,9 +27,9 @@ includecpp/core/cssl/cssl_builtins.pyi,sha256=-yr9JbxHKFv9Vc1iufChcqCQvNQLL3-Ow_
27
27
  includecpp/core/cssl/cssl_events.py,sha256=nupIcXW_Vjdud7zCU6hdwkQRQ0MujlPM7Tk2u7eDAiY,21013
28
28
  includecpp/core/cssl/cssl_modules.py,sha256=cUg0-zdymMnWWTsA_BUrW5dx4R04dHpKcUhm-Wfiwwo,103006
29
29
  includecpp/core/cssl/cssl_parser.py,sha256=4GHFcGa6jv7sgQxP0wWqCci8eS4E8Ie2t-qfJ2Ux9BU,154072
30
- includecpp/core/cssl/cssl_runtime.py,sha256=eSmR1eq9by5VXjsYZp3x8ksJj4PaUR46iqsby2Y0bAI,209792
30
+ includecpp/core/cssl/cssl_runtime.py,sha256=7R3lGdw-2G9_0H5jf3D8Cn_2inLHyw2771XFopMz51s,217360
31
31
  includecpp/core/cssl/cssl_syntax.py,sha256=bgo3NFehoPTQa5dqwNd_CstkVGVCNYAXbGYUcu5BEN0,16982
32
- includecpp/core/cssl/cssl_types.py,sha256=7jbrtZf3xmVQJA_mnL9iYrmdjhjuc4--mxxNigi7fsk,53425
32
+ includecpp/core/cssl/cssl_types.py,sha256=e3yJfM7VqaeuU92jtmvpxfwURWXGmIJlEC41baZryvw,58452
33
33
  includecpp/generator/__init__.py,sha256=Rsy41bwimaEloD3gDRR_znPfIJzIsCFuWZgCTJBLJlc,62
34
34
  includecpp/generator/parser.cpp,sha256=hbhHdtFH65rzp6prnARN9pNFF_ssr0NseVVcxq0fJh4,76833
35
35
  includecpp/generator/parser.h,sha256=EDm0b-pEesIIIQQ2PvH5h2qwlqJU9BH8SiMV7MWbsTo,11073
@@ -40,14 +40,14 @@ includecpp/vscode/__init__.py,sha256=yLKw-_7MTX1Rx3jLk5JjharJQfFXbwtZVE7YqHpM7yg
40
40
  includecpp/vscode/cssl/__init__.py,sha256=rQJAx5X05v-mAwqX1Qb-rbZO219iR73MziFNRUCNUIo,31
41
41
  includecpp/vscode/cssl/extension.js,sha256=FZaKfOpzo2jXtubVCZmnhDZd4eUVHltm5VW_fgNnSkE,4327
42
42
  includecpp/vscode/cssl/language-configuration.json,sha256=61Q00cKI9may5L8YpxMmvfo6PAc-abdJqApfR85DWuw,904
43
- includecpp/vscode/cssl/package.json,sha256=5MCJts7zYIgF8EdWcBnn98deIMyZamlGXvt1acO0Q1U,4853
43
+ includecpp/vscode/cssl/package.json,sha256=u5iHl79-GfeJiQ7vPe8DP5hXlOpGP41d1A54bn4Yy6M,6391
44
44
  includecpp/vscode/cssl/images/cssl.png,sha256=BxAGsnfS0ZzzCvqV6Zb1OAJAZpDUoXlR86MsvUGlSZw,510
45
45
  includecpp/vscode/cssl/images/cssl_pl.png,sha256=z4WMk7g6YCTbUUbSFk343BO6yi_OmNEVYkRenWGydwM,799
46
46
  includecpp/vscode/cssl/snippets/cssl.snippets.json,sha256=uV3nHJyQ5f7Pr3FzfbQT2VZOEY3AlGs4wrmqe884jm4,37372
47
- includecpp/vscode/cssl/syntaxes/cssl.tmLanguage.json,sha256=FZw1_VDz1ll4ZBZeGqo-935CK5RuF2kD75rNp5tVdC0,35068
48
- includecpp-4.0.2.dist-info/licenses/LICENSE,sha256=fWCsGGsiWZir0UzDd20Hh-3wtRyk1zqUntvtVuAWhvc,1093
49
- includecpp-4.0.2.dist-info/METADATA,sha256=gVavbx1QXP6Z1UfYdGQT3fl5wSvqW89iSLyo6-fBiZA,22542
50
- includecpp-4.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
51
- includecpp-4.0.2.dist-info/entry_points.txt,sha256=6A5Mif9gi0139Bf03W5plAb3wnAgbNaEVe1HJoGE-2o,59
52
- includecpp-4.0.2.dist-info/top_level.txt,sha256=RFUaR1KG-M6mCYwP6w4ydP5Cgc8yNbP78jxGAvyjMa8,11
53
- includecpp-4.0.2.dist-info/RECORD,,
47
+ includecpp/vscode/cssl/syntaxes/cssl.tmLanguage.json,sha256=nYy7aRWREcgCu9Jbx5QmtQHfD4WRlk-HkPhqzKVtoIA,42806
48
+ includecpp-4.0.3.dist-info/licenses/LICENSE,sha256=fWCsGGsiWZir0UzDd20Hh-3wtRyk1zqUntvtVuAWhvc,1093
49
+ includecpp-4.0.3.dist-info/METADATA,sha256=HrQsoVYGdTmArZ8MsnftKkBoY7a25f9Zv3AiyFpuHn8,22542
50
+ includecpp-4.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
51
+ includecpp-4.0.3.dist-info/entry_points.txt,sha256=6A5Mif9gi0139Bf03W5plAb3wnAgbNaEVe1HJoGE-2o,59
52
+ includecpp-4.0.3.dist-info/top_level.txt,sha256=RFUaR1KG-M6mCYwP6w4ydP5Cgc8yNbP78jxGAvyjMa8,11
53
+ includecpp-4.0.3.dist-info/RECORD,,