Repository navigation
Codegen: keyword binding, request contexts, array and numeric semantics, drawing collections, diagnostics - #327
Merged
Merged
Conversation
… check The array-history read, the request.security input-length getter and the method envelopes of two dynamic-offset rows now also check a negative history offset. Each moved pin expects exactly the text the generator emits, with the check where the generator puts it; the two hash pins carry the hashes of the new method text, and the only difference from the earlier text is that check. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…d constants input.enum(OPT_FAST, "Mode", options = [OPT_FAST, OPT_SLOW]) with `const Mode OPT_FAST = Mode.fast` lost its option list (empty options, setting reported unsupported), while the same input written with Mode.fast directly kept it. The options are now resolved through the same immutable-declaration walk the default already used; a reassigned, var, later-declared, mixed-enum or non-enum element keeps the unsupported descriptor. The direct form's emission is unchanged. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Validate keyword names against each strategy order function's declared signature and preserve valid positional, named, and mixed calls. Add regression coverage for diagnostics and native once-only behavior.
Preserve per-bar expression history, global tuple reads, string initialization, array constructor keyword binding, and reassigned input declarations. Add source-derived value regression cases and preservation controls.
Bind a late entry fill to its extra callback and independently check history values at defaults and overrides. Require a marker-restore mutation to fail by semantic values while retaining the Series restore.
Apply the owner's release CI reduction rule to the commit created by release.yml. The explicitly dispatched release and downstream notify remain.
Combine the accepted member chains and the receiver-use integration fixture on the current main base. Final composition review and the single batch gate remain pending; additional members still require their admission conditions.
Add the accepted request/lookahead member including the catalog hint repair. Final metadata union, composed review and the single batch gate remain due.
Record the receipt-backed fixed math parameter names and common argument binding, refuse variadic math keywords, and catalog PF-E5089/PF-E5090 with pins and exact diagnostic fixtures while preserving historical messages. Part of #287. Local partial source checkpoint; direct Analyzer strategy header folding still requires the admitted constant_fold seam repair. Native RED/GREEN and Claude source/process acceptance remain pending.
Resolve Series selection through the typed common writer, keep the supported default-quantity refusal, and retain both strategy string and float slots. Final composed-hunk review and the single batch gate remain required.
Add the selected history-offset member without changing its constant and non-negative behavior. Final rebase, composed review and combined gate remain.
Route registered math header keywords through the shared validator before binding, preserving constant evaluation and located catalog diagnostics. Add direct Analyzer header controls alongside the existing public paths. Part of #287. Source checkpoint; identical focused RED/GREEN and Claude acceptance remain pending before batch admission.
…eries argument bound to a simple parameter and for a keyword element in array.from TradingView stops compiling a script that passes a series value to a function or method parameter declared simple or const, or that names an element of array.from; the generator accepted these scripts and ran them. The analyzer now compares the proven qualifier of each bound argument with the declared parameter qualifier in one place shared by functions and methods, and raises a located diagnostic for the two rules. Unknown expressions, qualifier-only overloads and imported v5 definitions keep their previous handling, and a script with a qualifier-correct argument translates to the C++ it had. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Keep numeric destination conversion while using missing quantity for omitted order size. Preserve authored zero and the existing string and keyword fixes. Final composed review, paired rebase and combined gate remain required.
Union the accepted diagnostic entries, pins and declared-addition handling. Keep the existing lookahead migration and all prior changelog entries.
Keep every accepted catalog entry and pin, both declared-addition mechanisms, the lookahead metadata migration and the numeric conversion contract.
Preserve existing changelog entries and the accepted enum option folding. Final named tests, paired rebase and the single batch gate remain required.
Part of #293. Add generic full-month formats beside the existing abbreviated-month parser formats. Preserve independent calendar and boundary checks. This local checkpoint retains all four unresolved native tuple-consumer failures and their original expectations. It is not a completed acceptance or publication claim; the independent native proof and required reviews remain pending.
… copy shares its array fields Records that stay within one bar hold their array fields through a handle. A field that is omitted in Type.new(), or given na, is now a missing array ID (na(record.field) is true), distinct from a valid empty array, and using it as an array stops with the usual na-array error. Copying such a record with Type.copy() is now accepted and shares the array fields with the original, as TradingView does, while scalar fields stay independent. Records kept across bars still refuse the copy. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
session.regular and session.extended are constant strings in Pine, so passing one to a simple parameter is valid; the qualifier check ranked every session member as a series and refused it. The two names now rank as constants, the per-bar session flags stay series, and the controls compare the translated C++ of the valid forms with the previous version's. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Preserve actual diagnostic filenames, register named argument children before analysis, and return math keyword errors before unrelated notes. Configure the native quarter-tick fixture through the public engine setter. The independent oracle and all assertions remain unchanged. Part of #287; fresh identical-fixture RED/GREEN and Claude acceptance remain pending.
…fuses The control assumed the previous version translates ticker.modify; it reports ticker.modify as unsupported, so there is no previous translation to compare with. The two session constants keep their controls. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
TradingView CE10236 requires a method body to use its first argument. The exact unused-forward refusal is retained in receipt sha256/a182f1b4dd8f2c5aa36169fd4bd25c77771d41dd5cb70f55376088f37e4055af. Copy only the three reviewed receiver-use corrections from ce12d296. Keep every existing assertion and require native execution by name on the composed tree before acceptance; source correction is not a test pass.
Handle integral non-bool missing indices for floating arrays: get returns a floating NA value and set performs no indexed write after evaluating its operands. Preserve finite bounds, negative indexing, evaluation order and journal behavior. Keep a bounded proven-finite constant path byte-compatible with the existing checked emitter. Add native input-derived coverage for the measured array case, evaluation and journal controls, finite/error boundaries and the complete selector classes.
Two files conflicted, both in how timestamp(dateString) reads a date string. pineforge_codegen/codegen/visit_call.py, _parse_pine_datestring_ms: the branch had added full month names and kept the written sign of a zero-hour zone (GMT-00:30) by reading the old two-group zone regex; main (#330) replaced that regex and the zone arithmetic with the zone-word grammar that reads the sign, hours and minutes separately and lets the last zone token decide. The merge keeps the branch's full month names (the docstring wording and the %B formats merged without conflict) and takes main's zone-word code, which already keeps the written sign of a negative zone with a zero hour, so both behaviours hold. CHANGELOG.md: both sides added entries under "Unreleased"; all of them are kept. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
After merging codegen main into this branch, four rows of tests/test_timestamp_zero_hour_offset.py failed: UTC and GMT with +24:00 and -24:00 were expected to keep raising ValueError. That error came from building the zone word as a datetime.timezone, which refuses an offset of 24 hours or more. Main replaced it (the zone-word change in #330): the offset is plain arithmetic on the date fields, as in TradingView, whose exported trade lists for UTC+24, GMT-24 and UTC+25 match that rule. So the rows now pin the value instead of the old failure: the fields read as UTC minus the signed offset (2024-01-01 00:00 +24:00 is 2023-12-31 00:00 UTC, -24:00 is 2024-01-02 00:00 UTC), with the expected fields written independently of the parser like the rows above them. The +-24:00 spelling is the same rule applied; the exported lists cover the spellings UTC+24 and GMT-24. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A non-constant array.get index now emits the na-aware getter that matches TradingView (get with an na index returns na), so this shape's generated C++ intentionally differs from the older reference. Its behaviour is covered by the native na-index rows; the other twelve shapes keep their byte-for-byte comparison. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Restore unbounded generated drawing arenas while the bounded implementation is profiled and repaired separately. Keep the existing collector behavior and remove the emission assertions that require the bounded construction.
luisleo526
added a commit
that referenced
this pull request
Nov 6, 2026
Brings the integration of the pending compiler fixes (#327) into this branch. The only conflict is CHANGELOG.md, where both sides add entries at the top of the Unreleased section: both are kept, this change's entry first. The code and the tests merge without a conflict, including tests/test_calendar_lambda_locals.py and tests/test_codegen_audit_fixes.py, which both sides edit. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This was referenced Nov 6, 2026
Closed
luisleo526
added a commit
that referenced
this pull request
Nov 6, 2026
Restores test coverage for the declared drawing-count refusal (`PF-E0036`) after the bounded drawing arenas were reverted in #327, which removed `tests/test_drawing_arena_bounds.py` with them. The refusal code itself was not changed. The file holds only rows that do not depend on the arena text: - a declared `max_lines_count` / `max_boxes_count` / `max_labels_count` above 2147483642 is refused at its literal with `PF-E0036` (exact message, line and column); - the largest accepted value, 2147483642, still translates; - an oversized count in a script that draws nothing is not refused and emits no drawing arena. Test-only; no generated C++ changes. `tests/test_drawing_arena_bounds.py`: 21 passed on Linux aarch64. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
luisleo526
added a commit
that referenced
this pull request
Nov 7, 2026
The Unreleased section lists the keyword-argument and allow_entry_in fixes of #327 but not three other changes it made. Add them: - a var array with a non-empty initializer declared inside an if block is initialized when the declaration is first reached (#333); - strategy.risk.max_drawdown() and strategy.risk.max_intraday_loss() called with type = strategy.percent_of_equity, or with that constant held in a variable, apply the percentage limit like the positional form (#325, #326); - max_bars_back() with a const int depth keeps that depth (#326). Each form was run next to its control (the positional or literal form, or the same var declared at the top level) on the released 1.10.0 and on main: every form listed here differs from its control on 1.10.0 and equals it on main. Documentation only; CHANGELOG.md is the only file changed. Co-authored-by: Claude Sonnet 5.5 <[email protected]>
This was referenced Nov 8, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Integrates a set of codegen changes across keyword binding, request contexts, collections, numeric values, drawing collections, and diagnostics.
na, quotient fractions, and runtime history-offset checks.max_bars_back, and synchronized catalog pins.Validation
Missing Git identitybecause that archived engine input had no.gitdirectory. Engine-free CI now skips native-only rows with explicit reasons; the paired gate runs them.request.securityforms refused:lookaheadfrom a variable,''timeframe,[]on a requested value in a nested request, an uncalled wrapper #294 rows.Coverage limits
The full suite ran on the preceding composition; this head also carries the mainline timing-test retirement and native-input contract, so the final paired gate remeasures the exact head. Additional tuple traversal-arm coverage and the varip mutation discriminator remain follow-up checks.
🤖 Generated with Claude Code