IncludeCPP 3.7.19__py3-none-any.whl → 3.7.20__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.
includecpp/__init__.py CHANGED
@@ -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.19"
5
+ __version__ = "3.7.20"
6
6
  __all__ = ["CppApi", "CSSL"]
7
7
 
8
8
  # Module-level cache for C++ modules
@@ -2118,6 +2118,11 @@ class CSSLParser:
2118
2118
  elif self._match(TokenType.COMPARE_GE):
2119
2119
  right = self._parse_term()
2120
2120
  left = ASTNode('binary', value={'op': '>=', 'left': left, 'right': right})
2121
+ elif self._check(TokenType.KEYWORD) and self._peek().value == 'in':
2122
+ # 'in' operator for containment: item in list
2123
+ self._advance() # consume 'in'
2124
+ right = self._parse_term()
2125
+ left = ASTNode('binary', value={'op': 'in', 'left': left, 'right': right})
2121
2126
  else:
2122
2127
  break
2123
2128
 
@@ -2047,6 +2047,10 @@ class CSSLRuntime:
2047
2047
  """Execute expression statement"""
2048
2048
  return self._evaluate(node.value)
2049
2049
 
2050
+ def _exec_type_instantiation(self, node: ASTNode) -> Any:
2051
+ """Execute type instantiation as statement (e.g., vector<int>)"""
2052
+ return self._evaluate(node)
2053
+
2050
2054
  def _exec_await(self, node: ASTNode) -> Any:
2051
2055
  """Execute await statement - waits for expression to complete"""
2052
2056
  # Evaluate the awaited expression
@@ -422,12 +422,19 @@ class CsslLang:
422
422
  """
423
423
  runtime = self._get_runtime()
424
424
 
425
- # Check if it's a file path
426
- path = Path(path_or_code)
427
- if path.exists() and path.suffix in ('.cssl', '.cssl-mod', '.cssl-pl'):
428
- source = path.read_text(encoding='utf-8')
429
- else:
430
- source = path_or_code
425
+ # Check if it's a file path (not code)
426
+ # Code detection: contains newlines, semicolons, or braces = definitely code
427
+ is_likely_code = '\n' in path_or_code or ';' in path_or_code or '{' in path_or_code
428
+ source = path_or_code
429
+
430
+ if not is_likely_code:
431
+ try:
432
+ path = Path(path_or_code)
433
+ if path.exists() and path.suffix in ('.cssl', '.cssl-mod', '.cssl-pl'):
434
+ source = path.read_text(encoding='utf-8')
435
+ except OSError:
436
+ # Path too long or invalid - treat as code
437
+ pass
431
438
 
432
439
  # Set arguments in runtime scope
433
440
  from .cssl import Parameter
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: IncludeCPP
3
- Version: 3.7.19
3
+ Version: 3.7.20
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,4 +1,4 @@
1
- includecpp/__init__.py,sha256=gj_5tYvwpPV2DnslA0z3Ub6qF5Ahsr5cIe4G1xmamN4,1673
1
+ includecpp/__init__.py,sha256=4Ymntg7zK4sO2Z-sJmMHLXLI0Dqe1DbKESuvJYSZgDg,1673
2
2
  includecpp/__init__.pyi,sha256=uSDYlbqd2TinmrdepmE_zvN25jd3Co2cgyPzXgDpopM,7193
3
3
  includecpp/__main__.py,sha256=d6QK0PkvUe1ENofpmHRAg3bwNbZr8PiRscfI3-WRfVg,72
4
4
  includecpp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -11,7 +11,7 @@ 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=mbNsfq9T9NuY7duqTVYe7rmRlumXG-Y5dDAfeBpwtzM,42610
14
+ includecpp/core/cssl_bridge.py,sha256=Kgq08agrsSCZDXTv2sJZi-K8tkW-04Ezb8ev9-p7Rh0,42968
15
15
  includecpp/core/cssl_bridge.pyi,sha256=tQxb3lneufgVmXSAqDUwjoluUNo8Wa5QIOnaL8ai6q0,12055
16
16
  includecpp/core/error_catalog.py,sha256=VS3N-P0yEbiHimsDPtcaYfrUb7mXQ-7pqw18PtSngaU,33869
17
17
  includecpp/core/error_formatter.py,sha256=7-MzRIT8cM4uODxy0IZ9pu7pqR4Pq2I8Si0QQZHjmVc,39239
@@ -25,8 +25,8 @@ includecpp/core/cssl/cssl_builtins.py,sha256=6L2C_74mlVnd5C27z9LwmD5Z2jbT4wXp_QN
25
25
  includecpp/core/cssl/cssl_builtins.pyi,sha256=3ai2V4LyhzPBhAKjRRf0rLVu_bg9ECmTfTkdFKM64iA,127430
26
26
  includecpp/core/cssl/cssl_events.py,sha256=nupIcXW_Vjdud7zCU6hdwkQRQ0MujlPM7Tk2u7eDAiY,21013
27
27
  includecpp/core/cssl/cssl_modules.py,sha256=cUg0-zdymMnWWTsA_BUrW5dx4R04dHpKcUhm-Wfiwwo,103006
28
- includecpp/core/cssl/cssl_parser.py,sha256=t1C0fplyJz_ZqJOlfx5fG2GZZtCMJj4fCIgWzf-1JAY,113147
29
- includecpp/core/cssl/cssl_runtime.py,sha256=XT49-GCSE1AwLsy1DNqoHH0p2dCPk-cvUnqNsvyWHPQ,141859
28
+ includecpp/core/cssl/cssl_parser.py,sha256=YLQUnuKwY37d1LtrJ2UMysgpAXVgIvcRQO7gUFUONts,113476
29
+ includecpp/core/cssl/cssl_runtime.py,sha256=6wtifsRurFRm62KrdnTpzNdofl5vSOfaHM6KPXzhJVE,142036
30
30
  includecpp/core/cssl/cssl_syntax.py,sha256=bgo3NFehoPTQa5dqwNd_CstkVGVCNYAXbGYUcu5BEN0,16982
31
31
  includecpp/core/cssl/cssl_types.py,sha256=ebgZrrddhmTRK8vQ3dNWVH15Z4rMqEx1sSmozhnJyQA,48292
32
32
  includecpp/generator/__init__.py,sha256=Rsy41bwimaEloD3gDRR_znPfIJzIsCFuWZgCTJBLJlc,62
@@ -43,9 +43,9 @@ includecpp/vscode/cssl/images/cssl.png,sha256=BxAGsnfS0ZzzCvqV6Zb1OAJAZpDUoXlR86
43
43
  includecpp/vscode/cssl/images/cssl_pl.png,sha256=z4WMk7g6YCTbUUbSFk343BO6yi_OmNEVYkRenWGydwM,799
44
44
  includecpp/vscode/cssl/snippets/cssl.snippets.json,sha256=l4SCEPR3CsPxA8HIVLKYY__I979TfKzYWtH1KYIsboo,33062
45
45
  includecpp/vscode/cssl/syntaxes/cssl.tmLanguage.json,sha256=XKRLBOHlCqDDnGPvmNHDQPsIMR1UD9PBaJIlgZOiPqM,21173
46
- includecpp-3.7.19.dist-info/licenses/LICENSE,sha256=fWCsGGsiWZir0UzDd20Hh-3wtRyk1zqUntvtVuAWhvc,1093
47
- includecpp-3.7.19.dist-info/METADATA,sha256=rJCTbjHnCbTvk5zcRH3OQnMldLgErETKGd19Adunkok,32122
48
- includecpp-3.7.19.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
49
- includecpp-3.7.19.dist-info/entry_points.txt,sha256=6A5Mif9gi0139Bf03W5plAb3wnAgbNaEVe1HJoGE-2o,59
50
- includecpp-3.7.19.dist-info/top_level.txt,sha256=RFUaR1KG-M6mCYwP6w4ydP5Cgc8yNbP78jxGAvyjMa8,11
51
- includecpp-3.7.19.dist-info/RECORD,,
46
+ includecpp-3.7.20.dist-info/licenses/LICENSE,sha256=fWCsGGsiWZir0UzDd20Hh-3wtRyk1zqUntvtVuAWhvc,1093
47
+ includecpp-3.7.20.dist-info/METADATA,sha256=K63lr_YXZIRgYK-UUGPkwnRp4f-9JqvyJZtpibEjKFI,32122
48
+ includecpp-3.7.20.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
49
+ includecpp-3.7.20.dist-info/entry_points.txt,sha256=6A5Mif9gi0139Bf03W5plAb3wnAgbNaEVe1HJoGE-2o,59
50
+ includecpp-3.7.20.dist-info/top_level.txt,sha256=RFUaR1KG-M6mCYwP6w4ydP5Cgc8yNbP78jxGAvyjMa8,11
51
+ includecpp-3.7.20.dist-info/RECORD,,