IncludeCPP 3.7.4__py3-none-any.whl → 3.7.5__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 +1 -1
- includecpp/core/cssl/cssl_parser.py +23 -4
- includecpp/core/cssl/cssl_runtime.py +14 -4
- {includecpp-3.7.4.dist-info → includecpp-3.7.5.dist-info}/METADATA +1 -1
- {includecpp-3.7.4.dist-info → includecpp-3.7.5.dist-info}/RECORD +9 -9
- {includecpp-3.7.4.dist-info → includecpp-3.7.5.dist-info}/WHEEL +0 -0
- {includecpp-3.7.4.dist-info → includecpp-3.7.5.dist-info}/entry_points.txt +0 -0
- {includecpp-3.7.4.dist-info → includecpp-3.7.5.dist-info}/licenses/LICENSE +0 -0
- {includecpp-3.7.4.dist-info → includecpp-3.7.5.dist-info}/top_level.txt +0 -0
includecpp/__init__.py
CHANGED
|
@@ -1629,23 +1629,42 @@ class CSSLParser:
|
|
|
1629
1629
|
return ASTNode('c_for_update', value={'var': var_name, 'op': 'none'})
|
|
1630
1630
|
|
|
1631
1631
|
def _parse_python_style_for(self) -> ASTNode:
|
|
1632
|
-
"""Parse Python-style for loop: for (i in range(...)) { }
|
|
1632
|
+
"""Parse Python-style for loop: for (i in range(...)) { } or for (item in collection) { }
|
|
1633
1633
|
|
|
1634
1634
|
Supports:
|
|
1635
1635
|
for (i in range(n)) { } - 0 to n-1
|
|
1636
1636
|
for (i in range(start, end)) { } - start to end-1
|
|
1637
1637
|
for (i in range(start, end, step)) { }
|
|
1638
|
+
for (item in collection) { } - iterate over list/vector
|
|
1639
|
+
for (item in @global_collection) { } - iterate over global
|
|
1638
1640
|
"""
|
|
1639
1641
|
var_name = self._advance().value
|
|
1640
1642
|
self._expect(TokenType.KEYWORD) # 'in'
|
|
1641
1643
|
|
|
1642
|
-
#
|
|
1644
|
+
# Check if this is range() or collection iteration
|
|
1645
|
+
is_range = False
|
|
1643
1646
|
if self._check(TokenType.KEYWORD) and self._peek().value == 'range':
|
|
1644
1647
|
self._advance() # consume 'range' keyword
|
|
1648
|
+
is_range = True
|
|
1645
1649
|
elif self._check(TokenType.IDENTIFIER) and self._peek().value == 'range':
|
|
1646
1650
|
self._advance() # consume 'range' identifier
|
|
1647
|
-
|
|
1648
|
-
|
|
1651
|
+
is_range = True
|
|
1652
|
+
|
|
1653
|
+
# If not range, parse as collection iteration
|
|
1654
|
+
if not is_range:
|
|
1655
|
+
iterable = self._parse_expression()
|
|
1656
|
+
self._expect(TokenType.PAREN_END)
|
|
1657
|
+
|
|
1658
|
+
node = ASTNode('foreach', value={'var': var_name, 'iterable': iterable}, children=[])
|
|
1659
|
+
self._expect(TokenType.BLOCK_START)
|
|
1660
|
+
|
|
1661
|
+
while not self._check(TokenType.BLOCK_END) and not self._is_at_end():
|
|
1662
|
+
stmt = self._parse_statement()
|
|
1663
|
+
if stmt:
|
|
1664
|
+
node.children.append(stmt)
|
|
1665
|
+
|
|
1666
|
+
self._expect(TokenType.BLOCK_END)
|
|
1667
|
+
return node
|
|
1649
1668
|
|
|
1650
1669
|
self._expect(TokenType.PAREN_START)
|
|
1651
1670
|
first_arg = self._parse_expression()
|
|
@@ -963,10 +963,20 @@ class CSSLRuntime:
|
|
|
963
963
|
|
|
964
964
|
# Bind parameters - handle both positional and named arguments
|
|
965
965
|
for i, param in enumerate(params):
|
|
966
|
-
# Extract param name from dict format: {'name': 'a', 'type': 'int'}
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
966
|
+
# Extract param name and type from dict format: {'name': 'a', 'type': 'int'}
|
|
967
|
+
if isinstance(param, dict):
|
|
968
|
+
param_name = param['name']
|
|
969
|
+
param_type = param.get('type', '')
|
|
970
|
+
else:
|
|
971
|
+
param_name = param
|
|
972
|
+
param_type = ''
|
|
973
|
+
|
|
974
|
+
# Check if this is an 'open' parameter - receives all args as a list
|
|
975
|
+
if param_type == 'open' or param_name == 'Params':
|
|
976
|
+
# 'open Params' receives all arguments as a list
|
|
977
|
+
new_scope.set(param_name, list(args))
|
|
978
|
+
new_scope.set('Params', list(args)) # Also set 'Params' for OpenFind
|
|
979
|
+
elif param_name in kwargs:
|
|
970
980
|
# Named argument takes priority
|
|
971
981
|
new_scope.set(param_name, kwargs[param_name])
|
|
972
982
|
elif i < len(args):
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
includecpp/__init__.py,sha256=
|
|
1
|
+
includecpp/__init__.py,sha256=8JacV7ueRGIFTpDB8SFbIsmF0Mrnjw-ujKfm3Ppwhnc,1672
|
|
2
2
|
includecpp/__init__.pyi,sha256=c4gZW7_XQXcp6FBcTi5W7zXTmCtbgQhlC4cyeVqtRRM,7253
|
|
3
3
|
includecpp/__main__.py,sha256=d6QK0PkvUe1ENofpmHRAg3bwNbZr8PiRscfI3-WRfVg,72
|
|
4
4
|
includecpp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -25,8 +25,8 @@ includecpp/core/cssl/cssl_builtins.py,sha256=MJtWF7PeWkasxxkpN2zaCjeIJoQw5BPy-jQ
|
|
|
25
25
|
includecpp/core/cssl/cssl_builtins.pyi,sha256=Zc__PCO9FDaTPPG92zgK6_QoeMohbs0xlv6YGPubEdQ,31010
|
|
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=
|
|
29
|
-
includecpp/core/cssl/cssl_runtime.py,sha256=
|
|
28
|
+
includecpp/core/cssl/cssl_parser.py,sha256=yWQtveeAH5U-Ar-KpFoj8rTTm_HlpN79SoMT_EmI7nc,111417
|
|
29
|
+
includecpp/core/cssl/cssl_runtime.py,sha256=a9cHN4lh6fSNE33q6Ql5wMChIv-oKoR9UxcIJEVMmus,130111
|
|
30
30
|
includecpp/core/cssl/cssl_syntax.py,sha256=vgI-dgj6gs9cOHwNRff6JbwZZYW_fYutnwCkznlgZiE,17006
|
|
31
31
|
includecpp/core/cssl/cssl_types.py,sha256=XftmkvjxL-mKMz6HiTtnruG6P7haM21gFm7P9Caovug,48213
|
|
32
32
|
includecpp/generator/__init__.py,sha256=Rsy41bwimaEloD3gDRR_znPfIJzIsCFuWZgCTJBLJlc,62
|
|
@@ -41,9 +41,9 @@ includecpp/vscode/cssl/language-configuration.json,sha256=vBZSVBpV0UFlTO4d0aQrhT
|
|
|
41
41
|
includecpp/vscode/cssl/package.json,sha256=MWWIRLUnGvadWzEyfWdykUZHTsrG18sqpn5US5sXqac,1435
|
|
42
42
|
includecpp/vscode/cssl/snippets/cssl.snippets.json,sha256=l4SCEPR3CsPxA8HIVLKYY__I979TfKzYWtH1KYIsboo,33062
|
|
43
43
|
includecpp/vscode/cssl/syntaxes/cssl.tmLanguage.json,sha256=FODjb4v7K9qScxmiUP4HLgTNk6nDHF_HMqUA2HfyzLM,12747
|
|
44
|
-
includecpp-3.7.
|
|
45
|
-
includecpp-3.7.
|
|
46
|
-
includecpp-3.7.
|
|
47
|
-
includecpp-3.7.
|
|
48
|
-
includecpp-3.7.
|
|
49
|
-
includecpp-3.7.
|
|
44
|
+
includecpp-3.7.5.dist-info/licenses/LICENSE,sha256=fWCsGGsiWZir0UzDd20Hh-3wtRyk1zqUntvtVuAWhvc,1093
|
|
45
|
+
includecpp-3.7.5.dist-info/METADATA,sha256=1vwBnCzqAQ2oENqhR8MWa9d_qZ_RKTWMkIyNnvoqrDg,32122
|
|
46
|
+
includecpp-3.7.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
47
|
+
includecpp-3.7.5.dist-info/entry_points.txt,sha256=6A5Mif9gi0139Bf03W5plAb3wnAgbNaEVe1HJoGE-2o,59
|
|
48
|
+
includecpp-3.7.5.dist-info/top_level.txt,sha256=RFUaR1KG-M6mCYwP6w4ydP5Cgc8yNbP78jxGAvyjMa8,11
|
|
49
|
+
includecpp-3.7.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|