IncludeCPP 3.7.2__tar.gz → 3.7.3__tar.gz

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.
Files changed (57) hide show
  1. {includecpp-3.7.2 → includecpp-3.7.3}/IncludeCPP.egg-info/PKG-INFO +1 -1
  2. {includecpp-3.7.2 → includecpp-3.7.3}/PKG-INFO +1 -1
  3. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/__init__.py +1 -1
  4. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/cssl/cssl_parser.py +47 -2
  5. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/cssl/cssl_runtime.py +12 -1
  6. {includecpp-3.7.2 → includecpp-3.7.3}/pyproject.toml +1 -1
  7. {includecpp-3.7.2 → includecpp-3.7.3}/setup.py +1 -1
  8. {includecpp-3.7.2 → includecpp-3.7.3}/IncludeCPP.egg-info/SOURCES.txt +0 -0
  9. {includecpp-3.7.2 → includecpp-3.7.3}/IncludeCPP.egg-info/dependency_links.txt +0 -0
  10. {includecpp-3.7.2 → includecpp-3.7.3}/IncludeCPP.egg-info/entry_points.txt +0 -0
  11. {includecpp-3.7.2 → includecpp-3.7.3}/IncludeCPP.egg-info/requires.txt +0 -0
  12. {includecpp-3.7.2 → includecpp-3.7.3}/IncludeCPP.egg-info/top_level.txt +0 -0
  13. {includecpp-3.7.2 → includecpp-3.7.3}/LICENSE +0 -0
  14. {includecpp-3.7.2 → includecpp-3.7.3}/MANIFEST.in +0 -0
  15. {includecpp-3.7.2 → includecpp-3.7.3}/README.md +0 -0
  16. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/__init__.pyi +0 -0
  17. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/__main__.py +0 -0
  18. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/cli/__init__.py +0 -0
  19. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/cli/commands.py +0 -0
  20. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/cli/config_parser.py +0 -0
  21. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/__init__.py +0 -0
  22. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/ai_integration.py +0 -0
  23. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/build_manager.py +0 -0
  24. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/cpp_api.py +0 -0
  25. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/cpp_api.pyi +0 -0
  26. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/cppy_converter.py +0 -0
  27. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/cssl/CSSL_DOCUMENTATION.md +0 -0
  28. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/cssl/__init__.py +0 -0
  29. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/cssl/cssl_builtins.py +0 -0
  30. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/cssl/cssl_builtins.pyi +0 -0
  31. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/cssl/cssl_events.py +0 -0
  32. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/cssl/cssl_modules.py +0 -0
  33. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/cssl/cssl_syntax.py +0 -0
  34. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/cssl/cssl_types.py +0 -0
  35. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/cssl_bridge.py +0 -0
  36. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/cssl_bridge.pyi +0 -0
  37. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/error_catalog.py +0 -0
  38. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/error_formatter.py +0 -0
  39. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/exceptions.py +0 -0
  40. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/path_discovery.py +0 -0
  41. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/project_ui.py +0 -0
  42. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/core/settings_ui.py +0 -0
  43. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/generator/__init__.py +0 -0
  44. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/generator/parser.cpp +0 -0
  45. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/generator/parser.h +0 -0
  46. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/generator/type_resolver.cpp +0 -0
  47. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/generator/type_resolver.h +0 -0
  48. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/py.typed +0 -0
  49. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/templates/cpp.proj.template +0 -0
  50. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/vscode/__init__.py +0 -0
  51. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/vscode/cssl/__init__.py +0 -0
  52. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/vscode/cssl/language-configuration.json +0 -0
  53. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/vscode/cssl/package.json +0 -0
  54. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/vscode/cssl/snippets/cssl.snippets.json +0 -0
  55. {includecpp-3.7.2 → includecpp-3.7.3}/includecpp/vscode/cssl/syntaxes/cssl.tmLanguage.json +0 -0
  56. {includecpp-3.7.2 → includecpp-3.7.3}/requirements.txt +0 -0
  57. {includecpp-3.7.2 → includecpp-3.7.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: IncludeCPP
3
- Version: 3.7.2
3
+ Version: 3.7.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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: IncludeCPP
3
- Version: 3.7.2
3
+ Version: 3.7.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
@@ -2,7 +2,7 @@ from .core.cpp_api import CppApi
2
2
  from .core import cssl_bridge as CSSL
3
3
  import warnings
4
4
 
5
- __version__ = "3.7.2"
5
+ __version__ = "3.7.3"
6
6
  __all__ = ["CppApi", "CSSL"]
7
7
 
8
8
  # Module-level cache for C++ modules
@@ -2335,17 +2335,62 @@ class CSSLParser:
2335
2335
  self._expect(TokenType.COMPARE_GT) # consume >
2336
2336
  return ASTNode('instance_ref', value=instance_name)
2337
2337
 
2338
- # Check for type generic instantiation: stack<string>, vector<int>, etc.
2338
+ # Check for type generic instantiation: stack<string>, vector<int>, map<string, int>, etc.
2339
2339
  # This creates a new instance of the type with the specified element type
2340
2340
  if name in TYPE_GENERICS and self._check(TokenType.COMPARE_LT):
2341
2341
  self._advance() # consume <
2342
2342
  element_type = 'dynamic'
2343
+ value_type = None # For map<K, V>
2344
+
2343
2345
  if self._check(TokenType.KEYWORD) or self._check(TokenType.IDENTIFIER):
2344
2346
  element_type = self._advance().value
2347
+
2348
+ # Check for second type parameter (map<K, V>)
2349
+ if name == 'map' and self._check(TokenType.COMMA):
2350
+ self._advance() # consume ,
2351
+ if self._check(TokenType.KEYWORD) or self._check(TokenType.IDENTIFIER):
2352
+ value_type = self._advance().value
2353
+ else:
2354
+ value_type = 'dynamic'
2355
+
2345
2356
  self._expect(TokenType.COMPARE_GT) # consume >
2357
+
2358
+ # Check for inline initialization: map<K,V>{"key": "value", ...}
2359
+ init_values = None
2360
+ if self._check(TokenType.BLOCK_START):
2361
+ self._advance() # consume {
2362
+ init_values = {}
2363
+
2364
+ while not self._check(TokenType.BLOCK_END) and not self._is_at_end():
2365
+ # Parse key
2366
+ if self._check(TokenType.STRING):
2367
+ key = self._advance().value
2368
+ elif self._check(TokenType.IDENTIFIER):
2369
+ key = self._advance().value
2370
+ else:
2371
+ key = str(self._parse_expression().value) if hasattr(self._parse_expression(), 'value') else 'key'
2372
+
2373
+ # Expect : or =
2374
+ if self._check(TokenType.COLON):
2375
+ self._advance()
2376
+ elif self._check(TokenType.EQUALS):
2377
+ self._advance()
2378
+
2379
+ # Parse value
2380
+ value = self._parse_expression()
2381
+ init_values[key] = value
2382
+
2383
+ # Optional comma
2384
+ if self._check(TokenType.COMMA):
2385
+ self._advance()
2386
+
2387
+ self._expect(TokenType.BLOCK_END) # consume }
2388
+
2346
2389
  return ASTNode('type_instantiation', value={
2347
2390
  'type': name,
2348
- 'element_type': element_type
2391
+ 'element_type': element_type,
2392
+ 'value_type': value_type,
2393
+ 'init_values': init_values
2349
2394
  })
2350
2395
 
2351
2396
  # Check for type-parameterized function call: OpenFind<string>(0)
@@ -1890,9 +1890,11 @@ class CSSLRuntime:
1890
1890
  return self._eval_this_access(node)
1891
1891
 
1892
1892
  if node.type == 'type_instantiation':
1893
- # Create new instance of a type: stack<string>, vector<int>, etc.
1893
+ # Create new instance of a type: stack<string>, vector<int>, map<K,V>, etc.
1894
1894
  type_name = node.value.get('type')
1895
1895
  element_type = node.value.get('element_type', 'dynamic')
1896
+ value_type = node.value.get('value_type') # For map<K, V>
1897
+ init_values = node.value.get('init_values') # For inline init: map<K,V>{...}
1896
1898
 
1897
1899
  if type_name == 'stack':
1898
1900
  return Stack(element_type)
@@ -1916,6 +1918,15 @@ class CSSLRuntime:
1916
1918
  return List(element_type)
1917
1919
  elif type_name in ('dictionary', 'dict'):
1918
1920
  return Dictionary(element_type)
1921
+ elif type_name == 'map':
1922
+ # Create Map with key_type and value_type
1923
+ m = Map(element_type, value_type or 'dynamic')
1924
+ # If inline initialization provided, populate the map
1925
+ if init_values:
1926
+ for key, value_node in init_values.items():
1927
+ value = self._evaluate(value_node)
1928
+ m.insert(key, value)
1929
+ return m
1919
1930
  else:
1920
1931
  return None
1921
1932
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "IncludeCPP"
7
- version = "3.7.2"
7
+ version = "3.7.3"
8
8
  description = "Professional C++ Python bindings with type-generic templates, pystubs and native threading"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -6,7 +6,7 @@ long_description = (this_directory / "README.md").read_text(encoding="utf-8")
6
6
 
7
7
  setup(
8
8
  name="IncludeCPP",
9
- version="3.7.2",
9
+ version="3.7.3",
10
10
  author="Lilias Hatterscheidt",
11
11
  author_email="lilias@includecpp.dev",
12
12
  description="Professional C++ Python bindings with type-generic templates and native threading",
File without changes
File without changes
File without changes
File without changes
File without changes