@pineforge/codegen-pyodide 0.9.0 → 0.10.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pineforge/codegen-pyodide",
3
- "version": "0.9.0",
3
+ "version": "0.10.1",
4
4
  "description": "Gate-validated Pyodide payload for the PineScript v6 -> C++ transpiler: archive (run in Pyodide), unpacked source, introspected tables, and release metadata.",
5
5
  "type": "module",
6
6
  "main": "index.mjs",
@@ -4,6 +4,7 @@ from .lexer import Lexer
4
4
  from .parser import Parser
5
5
  from .analyzer import Analyzer
6
6
  from .codegen import CodeGen
7
+ from .finite_ta_length import expand_finite_choice_extrema_lengths
7
8
  from .pragmas import extract_pf_trace_pragmas
8
9
  from .support_checker import check_support_or_raise
9
10
 
@@ -44,6 +45,7 @@ def transpile(pine_source: str, *, check_support: bool = True, filename: str = "
44
45
  ast = Parser(tokens, source=pine_source, filename=filename).parse()
45
46
  if check_support:
46
47
  check_support_or_raise(ast, filename=filename)
48
+ ast = expand_finite_choice_extrema_lengths(ast)
47
49
  ctx = Analyzer(ast, filename=filename).analyze()
48
50
  # Attach after analysis: pragma expressions are not part of the
49
51
  # program body, so the analyzer never inspects them; the codegen
@@ -81,6 +83,7 @@ def transpile_full(pine_source: str, *, check_support: bool = True,
81
83
  ast = Parser(tokens, source=pine_source, filename=filename).parse()
82
84
  if check_support:
83
85
  check_support_or_raise(ast, filename=filename)
86
+ ast = expand_finite_choice_extrema_lengths(ast)
84
87
  ctx = Analyzer(ast, filename=filename).analyze()
85
88
  ctx.pf_trace_pragmas = pragmas
86
89
  gen = CodeGen(ctx)