Commit cf17bfa
Fix DateTime timezone support: namespace::autoclean stub + keyword autoquoting (#343)
* Fix DateTime timezone support: namespace::autoclean stub + keyword autoquoting
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>
* Implement delete %hash{keys} and delete %array[indices] (kv-slice delete)
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>
* Add slice delete operations to interpreter backend
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>
* Phase 12: DateTime Java XS fallback and fixes
- 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>
* Document DateTime test issues for Phase 13+
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>
* Fix: single-variable string interpolation now properly stringifies overloaded 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>
* Document Phase 13: overload stringification fix
- 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>
* Add XSLoader VERSION and bootstrap_inherit for CPAN compatibility
- 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>
---------
Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>1 parent 9363ed0 commit cf17bfa
15 files changed
Lines changed: 854 additions & 77 deletions
File tree
- dev/design
- src/main
- java/org/perlonjava
- backend
- bytecode
- jvm
- frontend/parser
- runtime
- perlmodule
- runtimetypes
- perl/lib
- namespace
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
81 | | - | |
| 85 | + | |
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
85 | | - | |
| 89 | + | |
86 | 90 | | |
87 | | - | |
| 91 | + | |
88 | 92 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
98 | 100 | | |
99 | | - | |
100 | 101 | | |
101 | | - | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
104 | 114 | | |
105 | | - | |
106 | 115 | | |
107 | 116 | | |
108 | 117 | | |
109 | 118 | | |
110 | | - | |
111 | | - | |
| 119 | + | |
| 120 | + | |
112 | 121 | | |
113 | 122 | | |
114 | | - | |
115 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
116 | 127 | | |
117 | | - | |
| 128 | + | |
118 | 129 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
152 | 299 | | |
153 | 300 | | |
154 | 301 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1755 | 1755 | | |
1756 | 1756 | | |
1757 | 1757 | | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
1758 | 1774 | | |
1759 | 1775 | | |
1760 | 1776 | | |
| |||
0 commit comments