pineforge-codegen 1.7.0__py3-none-any.whl → 1.8.0__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.
Files changed (30) hide show
  1. pineforge_codegen/__init__.py +6 -1
  2. pineforge_codegen/codegen/base.py +548 -4
  3. pineforge_codegen/codegen/capabilities.py +8 -0
  4. pineforge_codegen/codegen/checked_settings.py +13 -1
  5. pineforge_codegen/codegen/collection_history.py +95 -9
  6. pineforge_codegen/codegen/emit_top.py +107 -13
  7. pineforge_codegen/codegen/graph_journal.py +540 -0
  8. pineforge_codegen/codegen/helpers.py +8 -7
  9. pineforge_codegen/codegen/history_sharing.py +222 -0
  10. pineforge_codegen/codegen/id_sites.py +260 -0
  11. pineforge_codegen/codegen/input.py +70 -7
  12. pineforge_codegen/codegen/security.py +701 -54
  13. pineforge_codegen/codegen/tables.py +160 -33
  14. pineforge_codegen/codegen/types.py +13 -1
  15. pineforge_codegen/codegen/visit_call.py +30 -32
  16. pineforge_codegen/codegen/visit_expr.py +26 -1
  17. pineforge_codegen/codegen/visit_stmt.py +15 -11
  18. pineforge_codegen/collection_history.py +1 -1
  19. pineforge_codegen/cpp_allowlist.py +3 -3
  20. pineforge_codegen/diagnostics_catalog.json +11 -2
  21. pineforge_codegen/lexer.py +62 -2
  22. pineforge_codegen/parser.py +76 -14
  23. pineforge_codegen/pragmas.py +3 -2
  24. pineforge_codegen/signatures.py +18 -0
  25. pineforge_codegen/support_checker.py +14 -10
  26. {pineforge_codegen-1.7.0.dist-info → pineforge_codegen-1.8.0.dist-info}/METADATA +10 -5
  27. {pineforge_codegen-1.7.0.dist-info → pineforge_codegen-1.8.0.dist-info}/RECORD +30 -27
  28. {pineforge_codegen-1.7.0.dist-info → pineforge_codegen-1.8.0.dist-info}/WHEEL +1 -1
  29. {pineforge_codegen-1.7.0.dist-info → pineforge_codegen-1.8.0.dist-info}/entry_points.txt +0 -0
  30. {pineforge_codegen-1.7.0.dist-info → pineforge_codegen-1.8.0.dist-info}/licenses/LICENSE +0 -0
@@ -26,11 +26,14 @@ def _parse_bounded(pine_source: str, filename: str, budget: TimeBudget | None =
26
26
  ensure_recursion_headroom()
27
27
  check_source_size(pine_source, filename)
28
28
  budget = budget or TimeBudget(filename)
29
+ # Normalize once before the pre-pass; all stages use the lexer's text.
30
+ lexer = Lexer(pine_source, filename=filename, budget=budget)
31
+ pine_source = lexer.source
29
32
  pragmas = extract_pf_trace_pragmas(
30
33
  pine_source, filename=filename, budget=budget,
31
34
  )
32
35
  budget.check(phase=Phase.LEXER)
33
- tokens = Lexer(pine_source, filename=filename, budget=budget).tokenize()
36
+ tokens = lexer.tokenize()
34
37
  budget.check(phase=Phase.LEXER)
35
38
  ast = Parser(tokens, source=pine_source, filename=filename,
36
39
  budget=budget).parse()
@@ -170,6 +173,8 @@ def transpile_full(pine_source: str, *, check_support: bool = True,
170
173
  ``min`` / ``max`` / ``step`` / ``options`` (omitted when the
171
174
  corresponding signature argument is absent or is not a literal the
172
175
  receipt holds); an ``input.symbol`` entry also has ``kind: "symbol"``.
176
+ An ``input.color`` has ``type: "color"`` and an unsigned packed
177
+ ``0xAARRGGBB`` integer default when its color expression is literal-foldable.
173
178
  See :meth:`CodeGen.extract_input_manifest`.
174
179
  - ``strategyParams``: the literal ``strategy(...)`` kwargs the analyzer
175
180
  surfaced (e.g. ``initial_capital``, ``pyramiding``).