Conversation
- Change `SourceParseBuffer<'a>` from a struct to a type alias: `type SourceParseBuffer<'a> = ParseBuffer<'a, Source>` - Move Source-specific methods (parse, parse_optional, parse_terminated, call, parse_virtual_empty_stream) to `impl ParseBuffer<'a, Source>` - Add Output-specific parse methods to `impl ParseBuffer<'a, Output>` - Rename generic ParseBuffer methods to avoid conflicts: parse -> parse_generic, call -> call_generic, parse_terminated -> parse_terminated_generic - Make `ParseStreamStack` generic over `K` and `'a`, with Source-specific methods in a separate impl block
…018rdQvBWCgaBLgwwaiQYVLG refactor: Remove SourceParseBuffer wrapper, make it a type alias
refactor: Input lives in interpreter
Add parser values
Create a detailed plan for incrementally migrating binary operations from the HandleBinaryOperation trait pattern to method resolution. First PR scope: - Add BinaryOperationInterface infrastructure - Extend HierarchicalTypeData with resolve_own_binary_operation - Migrate addition (+) for UntypedInteger as proof of concept - Maintain backwards compatibility with existing tests
- Document resolved design decisions for RHS type, symmetric ops, and spans - Add detailed analysis of short-circuiting operator challenges - Recommend excluding && and || from initial migration - Outline possible future approaches for lazy evaluation
Implement the first phase of the BinaryOperation migration: - Add BinaryOperationInterface struct for binary operation method resolution - Add BinaryOperationCallContext for passing operation context - Update MethodResolver trait to take rhs_kind parameter - Update BinaryOperationBuilder to resolve methods with both LHS and RHS kinds - Implement addition (+) for UntypedInteger + UntypedInteger via new system - Add create_binary_interface! macro for building BinaryOperationInterface The new method resolution flow: 1. Evaluate both operands (currently using Owned ownership) 2. Resolve method with both LHS kind and RHS kind 3. If method found, execute via BinaryOperationInterface 4. Otherwise, fall back to legacy HandleBinaryOperation trait Currently only UntypedInteger + UntypedInteger uses the new path. Mixed cases (e.g., 1 + 5u16) still use the legacy system. This establishes the infrastructure for incrementally migrating all binary operations to the new method resolution pattern.
…UntypedInteger - Add BinaryOperationInterface struct to type_data.rs for binary operation method resolution - Add BinaryOperationCallContext to interface_macros.rs for passing operation context - Extend define_interface! macro to support binary_operations module - Add create_binary_interface! macro for generating binary operation interfaces - Update value_frames.rs BinaryOperationBuilder to use BinaryOperationInterface - Implement paired_operation for UntypedInteger that handles all paired binary operations (+, -, *, /, %, ==, !=, <, >, <=, >=) with proper type coercion - Add backward-compatible macro rule for define_interface! without binary_operations The new interface properly handles: - UntypedInteger + UntypedInteger (stays untyped) - UntypedInteger + TypedInteger (coerces to typed) Error message for integer/float comparison is now more specific about the type mismatch.
…ace!
Remove backward-compatible macro rule that auto-generated empty
binary_operations. All define_interface! invocations now explicitly
include `pub(crate) mod binary_operations {}` section.
Move output(), output_if_some(), and unsupported() methods from WrappedOp directly onto the Operation trait. Update HandleBinaryOperation trait and all implementations to take &PairedBinaryOperation and &IntegerBinaryOperation instead of WrappedOp<...>. This simplifies the code by removing an unnecessary wrapper type.
…into binary-operation-migration
Replace all the value wrappers with leaf-based specific values
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.
No description provided.