pineforge-codegen 0.7.0__py3-none-any.whl → 0.7.2__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.
- pineforge_codegen/codegen/base.py +22 -10
- {pineforge_codegen-0.7.0.dist-info → pineforge_codegen-0.7.2.dist-info}/METADATA +2 -1
- {pineforge_codegen-0.7.0.dist-info → pineforge_codegen-0.7.2.dist-info}/RECORD +5 -5
- {pineforge_codegen-0.7.0.dist-info → pineforge_codegen-0.7.2.dist-info}/WHEEL +0 -0
- {pineforge_codegen-0.7.0.dist-info → pineforge_codegen-0.7.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -185,19 +185,31 @@ class CodeGen(CallVisitor, ExprVisitor, StmtVisitor, TopLevelEmitter, SecurityEm
|
|
|
185
185
|
# This ensures sub-function series vars get cloned for the parent's call sites.
|
|
186
186
|
func_var_originals: dict[str, list[str]] = {} # func_name -> list of original var names
|
|
187
187
|
|
|
188
|
-
# First, collect all function-scoped series vars (union across all functions)
|
|
189
|
-
|
|
188
|
+
# First, collect all function-scoped series vars (union across all functions).
|
|
189
|
+
# Use an ordered, de-duplicated list (NOT a set): set iteration order is
|
|
190
|
+
# PYTHONHASHSEED-randomized, and this order reaches emitted C++ member
|
|
191
|
+
# declarations via ``orig_names`` -> ``func_var_originals`` ->
|
|
192
|
+
# ``_func_cs_var_remap``. ``ctx.func_series_vars`` is a dict whose VALUES
|
|
193
|
+
# are themselves sets (analyzer stores ``dict[str, set]``), so we must
|
|
194
|
+
# iterate each value in ``sorted`` order to be hash-seed independent.
|
|
195
|
+
all_func_scoped_series: list[str] = []
|
|
190
196
|
for svars in ctx.func_series_vars.values():
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
197
|
+
for sv in sorted(svars):
|
|
198
|
+
if sv not in all_func_scoped_series:
|
|
199
|
+
all_func_scoped_series.append(sv)
|
|
200
|
+
# Also include function-scoped var_members (same ordered-list rationale).
|
|
201
|
+
# ``ctx.func_var_members`` values are lists (already insertion-ordered).
|
|
202
|
+
all_func_scoped_vars: list[str] = []
|
|
194
203
|
for vlist in ctx.func_var_members.values():
|
|
195
204
|
for n, _, _ in vlist:
|
|
196
|
-
all_func_scoped_vars
|
|
205
|
+
if n not in all_func_scoped_vars:
|
|
206
|
+
all_func_scoped_vars.append(n)
|
|
197
207
|
|
|
198
208
|
# For each function with call-site cloning (has TA ranges or is called multiple times),
|
|
199
|
-
# include ALL function-scoped series/var vars that could be used in its body
|
|
200
|
-
|
|
209
|
+
# include ALL function-scoped series/var vars that could be used in its body.
|
|
210
|
+
# Iterate the dict directly (insertion-ordered) rather than ``set(...keys())``,
|
|
211
|
+
# which would randomize the order of emitted clones across hash seeds.
|
|
212
|
+
for fname in ctx.func_call_site_counts:
|
|
201
213
|
total_cs = ctx.func_call_site_counts[fname]
|
|
202
214
|
if total_cs <= 1:
|
|
203
215
|
continue # No cloning needed for single-call-site functions
|
|
@@ -207,9 +219,9 @@ class CodeGen(CallVisitor, ExprVisitor, StmtVisitor, TopLevelEmitter, SecurityEm
|
|
|
207
219
|
for n, _, _ in ctx.func_var_members[fname]:
|
|
208
220
|
if n not in orig_names:
|
|
209
221
|
orig_names.append(n)
|
|
210
|
-
# Include function's own series vars
|
|
222
|
+
# Include function's own series vars (set -> sorted for determinism)
|
|
211
223
|
if fname in ctx.func_series_vars:
|
|
212
|
-
for sv in ctx.func_series_vars[fname]:
|
|
224
|
+
for sv in sorted(ctx.func_series_vars[fname]):
|
|
213
225
|
if sv not in orig_names:
|
|
214
226
|
orig_names.append(sv)
|
|
215
227
|
# Include series vars from sub-functions (they share the same class members)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pineforge-codegen
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.2
|
|
4
4
|
Summary: PineScript v6 to C++ transpiler that targets the pineforge-engine runtime.
|
|
5
5
|
Project-URL: Homepage, https://github.com/pineforge-4pass/pineforge-codegen-oss
|
|
6
6
|
Project-URL: Issues, https://github.com/pineforge-4pass/pineforge-codegen-oss/issues
|
|
@@ -211,6 +211,7 @@ Classifier: License :: Free for non-commercial use
|
|
|
211
211
|
Classifier: Programming Language :: Python :: 3.11
|
|
212
212
|
Classifier: Programming Language :: Python :: 3.12
|
|
213
213
|
Classifier: Programming Language :: Python :: 3.13
|
|
214
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
214
215
|
Classifier: Topic :: Office/Business :: Financial
|
|
215
216
|
Requires-Python: >=3.11
|
|
216
217
|
Provides-Extra: dev
|
|
@@ -17,7 +17,7 @@ pineforge_codegen/analyzer/diagnostics.py,sha256=XQihiH2vQYcPQ83NwTKU6RAuakRXkuh
|
|
|
17
17
|
pineforge_codegen/analyzer/tables.py,sha256=KiI3gvYGWBw9PgX_PPXPS-fk8dfH54OjMCMGeb3tD0Y,7442
|
|
18
18
|
pineforge_codegen/analyzer/types.py,sha256=HAbEAnxkZxX7d5iFQA6KT0Ocs7kkUprX78z9DMcHVlc,12181
|
|
19
19
|
pineforge_codegen/codegen/__init__.py,sha256=jvwwf93pqyHnFSvGPcD8Mhr_kAk0Uc4W6IqhKu8UIlI,2232
|
|
20
|
-
pineforge_codegen/codegen/base.py,sha256=
|
|
20
|
+
pineforge_codegen/codegen/base.py,sha256=4KCg-nmETGZMzlfnb64jY3fy5AWdixdl23BQmIvMZSo,69690
|
|
21
21
|
pineforge_codegen/codegen/emit_top.py,sha256=htpiDaHI9q98ryd9eihKxGmVoZnbqz16vnw6Ax8L028,46076
|
|
22
22
|
pineforge_codegen/codegen/helpers.py,sha256=TIsTUjrri4DobEJ9Cr-rl9s6LILWuKWolROUu1-f4mw,7313
|
|
23
23
|
pineforge_codegen/codegen/helpers_syminfo.py,sha256=GFrx9i2HXSCmGIpIds0cFrtJ6IQiznfXxH8aI8h3DQ4,4878
|
|
@@ -29,7 +29,7 @@ pineforge_codegen/codegen/types.py,sha256=kt2tXtFhFmm4cWBuXnvPHfop-AWIB7drUiKNaD
|
|
|
29
29
|
pineforge_codegen/codegen/visit_call.py,sha256=x-AXr0pyoBjDBEGkXqfVaJtJqpEhvqL6XNP1P8acEHs,74482
|
|
30
30
|
pineforge_codegen/codegen/visit_expr.py,sha256=kXrwIRouG4uo-e0lze23Kat3p5LFSfldgML088s4G_U,36762
|
|
31
31
|
pineforge_codegen/codegen/visit_stmt.py,sha256=Vgtx_j_xYjH-qntnUlZiyYXIX9oioijN8vmBLrneYcA,38125
|
|
32
|
-
pineforge_codegen-0.7.
|
|
33
|
-
pineforge_codegen-0.7.
|
|
34
|
-
pineforge_codegen-0.7.
|
|
35
|
-
pineforge_codegen-0.7.
|
|
32
|
+
pineforge_codegen-0.7.2.dist-info/METADATA,sha256=aSO3fig51yq_9o53yCi3fz9xXNvDhFopQoIBhaLLQcM,17599
|
|
33
|
+
pineforge_codegen-0.7.2.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
34
|
+
pineforge_codegen-0.7.2.dist-info/licenses/LICENSE,sha256=Hf1kZ8OCaQ-nd2i92f2WEX1ZKCc6jqe-rtR4fVENQHY,7186
|
|
35
|
+
pineforge_codegen-0.7.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|