feat(codegen): support Pine drawing objects as data#27
Merged
Conversation
….point)
Pine v6 drawing geometry becomes real C++ state via a value-view handle
over a per-type DrawingArena; every visual kwarg (color/style/width/
bgcolor/text_*/extend/force_overlay) is accepted and dropped. All new
behaviour is gated on _uses_drawing, so non-drawing strategies emit
byte-identical C++ (245/246 engine parity unchanged).
- tables.py: DRAWING_TYPE_TO_CPP / DRAWING_NS / DRAWING_STYLE_NS; remove
line/box/label/linefill/polyline from SKIP_NAMESPACES (table kept)
- base.py: shrink _DRAWING_TYPES_INIT to {table,polyline}; _detect_drawing_usage
+ _compute_drawing_caps (max_lines/boxes/labels/polylines_count); arena members
- codegen/types.py + analyzer/types.py: udt(line/box/...) -> Line/Box/...;
DRAWING_RETURN_SPECS so *.new/*.copy/get_line* type as handles
- new codegen/drawing.py + visit_call.py: DRAWING_DISPATCH at all four receiver
sites incl. the arbitrary-expression receiver (arr.get(i).delete()); user
methods on drawing types fall through (L.1 precedence); chart.point inline
aggregate lowering; point-form overload selection; geometry-only ctor kwarg filter
- visit_expr.py: DRAWING_STYLE_NS const reads -> "0" (.all exempted)
- emit_top.py: drawing.hpp include; udt-method drawing self/param/return mapping
- support_checker.py: SUPPORTED_LINE/BOX/LABEL/LINEFILL/CHART_POINT
Unblocks egoigor1976-1-trendline-strategy (the corpus's sole geometry
read-back). pytest: 1321 passed, 0 failed (was 1312; +9 drawing tests).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Related
Scope / caveats
Verification