Fix DateTime timezone support: namespace::autoclean stub + keyword autoquoting#343
Merged
Conversation
…toquoting
Phase 11 completion:
1. namespace::autoclean stub (src/main/perl/lib/namespace/autoclean.pm)
- Provides interface but skips cleanup entirely
- Allows imported functions (Try::Tiny try/catch) to remain available
- Fixes Undefined subroutine DateTime::TimeZone::catch error
2. Parser fix for keyword autoquoting (ListParser.java)
- Extended AUTOQUOTABLE_KEYWORDS set to include: if, unless, while,
until, for, foreach (in addition to and, or, xor, when)
- Keywords followed by => are now treated as bareword hash keys
- Fixes Expected token } but got until parser error
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ete)
Added missing key-value slice delete operations:
1. RuntimeHash.java: Added deleteKeyValueSlice() method
- Returns alternating keys and values of deleted elements
- Fixes delete %hash{key1, key2} returning keys and values
2. RuntimeArray.java: Added getKeyValueSlice() and deleteKeyValueSlice()
- getKeyValueSlice() returns alternating indices and values
- deleteKeyValueSlice() deletes and returns index/value pairs
- Fixes delete %array[idx1, idx2] returning indices and values
3. Dereference.java: Extended handleHashElementOperator and handleArrayElementOperator
- Added handling for % sigil with delete operation
- Properly routes to the new *KeyValueSlice methods
This improves op/delete.t from 13 to ~50 passing tests.
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Implement three new opcodes for the bytecode interpreter: - ARRAY_SLICE_DELETE (390): delete @array[indices] - HASH_KV_SLICE_DELETE (391): delete %hash{keys} (returns key-value pairs) - ARRAY_KV_SLICE_DELETE (392): delete %array[indices] (returns index-value pairs) These operations were already supported in the JVM backend via RuntimeArray.deleteSlice() and RuntimeHash/RuntimeArray.deleteKeyValueSlice(), but the interpreter was failing with "Array exists/delete requires simple array variable" errors. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Fix refaddr to return identity hash of underlying object, not wrapper This fixes Specio enum validation and DateTime truncate/today - Add POSIX math functions: floor, ceil, fmod, fabs, pow, trig, etc. DateTime uses POSIX::floor and POSIX::fmod - Update cpan_client.md with Phase 12 completion details DateTime now uses Java XS implementation ($DateTime::IsPurePerl = 0) with 98.5% of DateTime tests passing. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Added comprehensive list of remaining DateTime test failures (45/3292): - Overload stringification StackOverflowError (HIGH PRIORITY) - Leap second handling issues (19 failures) - End-of-month arithmetic bugs (21 failures) - Missing test dependencies - DateTime::Locale data file installation - IPC::Open3 read-only modification bug - Dist::CheckConflicts method resolution - Encode::PERLQQ undefined - Number::Overloaded integration Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…erloaded objects When a double-quoted string contains only a single interpolated variable like "$obj", the parser was optimizing it to just return the variable directly. This broke overloaded objects because: 1. The 'eq' overload handler does: return "$a" eq "$b" 2. PerlOnJava was treating "$a" as just $a (no stringification) 3. This caused the eq overload to call itself infinitely (StackOverflowError) The fix ensures that single non-string segments in string interpolation are wrapped in a join() operation, which forces proper stringification. This does NOT apply in regex context (isRegex=true) because regex patterns should use the 'qr' overload, not stringify. Fixes DateTime test failures: - t/20infinite.t: stringified infinity comparisons now work - t/31formatter.t: formatter stringification now works Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- t/20infinite.t: All 104 tests now pass - t/31formatter.t: All 11 tests now pass - DateTime test results improved: 3260/3302 (98.7%), down from 45 to 42 failures Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Set $XSLoader::VERSION to 0.32 (compatible with CPAN version) - Add bootstrap_inherit() stub that delegates to load() This fixes 'XSLoader does not define $XSLoader::VERSION' errors when CPAN runs XSLoader's own test suite during dependency resolution. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.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
This PR completes Phase 11 of the CPAN client support, enabling full DateTime functionality including timezone support.
Changes
namespace::autoclean stub (
src/main/perl/lib/namespace/autoclean.pm)try/catch) to remain availableParser fix for keyword autoquoting (
ListParser.java)AUTOQUOTABLE_KEYWORDSset to include:if,unless,while,until,for,foreach(in addition to existingand,or,xor,when)=>are now correctly treated as bareword hash keysDateTime Now Works with Timezones
Test Plan
make){ foo => 1, until => 2 })Generated with Devin