rpg_date_convert.zig, rpg_eval.zig, rpg_eval_builtins.zig, rpg_source.zig, rpg_facts.zig: date conversions of other formats, of a subfield, and inside a condition #775
Loading…
Reference in a new issue
No description provided.
Delete branch "ldt2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
rpg_date_convert.zig, rpg_eval.zig, rpg_eval_builtins.zig, rpg_source.zig, rpg_facts.zig: date conversions of other formats, of a subfield, and inside a condition
Nine of the ten
ldt-dt-cvtcaptures that left aSOURCERER-FAILline at v0.1.490 now emit with no failure. Rules:rpg_date_convert.formats: the descriptors of*CMDY(id 52, 9 bytes,/),*CYMD(id 31, 9 bytes,/),*LONGJUL(id 29, 8 bytes,/) and of a timestamp with the separators of*ISO(id 9, 26 bytes,-). Each is the descriptor literal of one measured capture (ldt-char-d-cmdy,-cymd,-longjul,ldt-char-ts,ldt-ts-c). The0forms (*CMDY0, ...) are not in the table.rpg_date_convert.recover: the source of the call may be byte K of a structure (33 S; 27 K; 62, then the target as before, or the target with its own type word). The proof'ssourcecarries the offset;rpg_eval.dateConvertCallnames itS253.10, andrpg_facts.dateConvertTextprints it in the call text. Captures:ldt-ds-char-date-usa,ldt-ds-char-time-eur.rpg_eval.callFactandrpg_eval_builtins.dateCompare: a condition showed only the lines of a decimal conversion. The five stores into the three descriptor areas of a date call (descriptorLines) and the call line of a date conversion are counted the same way, soif %CHAR(d: *USA) = candif %DATE(c: *USA) > dread as conditions. Captures:ldt-cmp-char-usa,ldt-cmp-date-c.rpg_source.zig(callees ofrpg_date_fields):_QRNX_DT_CMPis a callee, so the descriptors of a comparison type a static date or time field. Inldt-cmp-date-cthe fielddwaschar(10) inz('2026-03-09'), the source hasdate. The public twinsdtcmp-date-gt-d,dtcmp-d-gt-dateanddtcmp-date-eq-ddeclaredchar(10) inz(...)at v0.1.490 and now declaredate inz(d'...'), as their source does;dtcmp-t-lt-timedeclaredchar(8) inz('04.05.06')and now declarestime inz(t'04.05.06'). The three pinnedchar(10)lines insrc/rpg_file_device_test.zigare updated.Measured at this change (host Debug build,
savf rpgle):ldt-char-d-cmdy,-cymd,-longjul,ldt-char-ts,ldt-ts-c,ldt-ds-char-date-usa,ldt-ds-char-time-eur,ldt-cmp-char-usa,ldt-cmp-date-ceach reportfailures 0. The pub400 compile and the object comparison were not run by this lane.ldt-ts-cemits%TIMESTAMP(A_00253: *ISO): its source descriptor holds the separator-.lr3-ts-char(%timestamp(c)with no format) has the separator 0 in both descriptors and keeps%TIMESTAMP(A_00253).Not fixed:
ldt-ds-date-c-off(ds.d = %date(ds.c : *usa)). The conversion now reads: the statement text isS253.0 = %DATE(S253.10: *USA)anddateConvertCall s02no longer fires. The emit still fails withS253.0: 2 types: byte 0 of the structure has the 20-byte store of the start value (37 S253 0, type 13) and the 10-byte store of the date (42, type 11),partTypesrecords both, andpartInforefuses. The target date is named by no descriptor (the converted value goes into a native temporary), sorpg_date_fieldsdoes not type the subfield either. The same shape islr3x-date-char-in-ds(still unresolved, as at v0.1.490). A rule needspartTypes/narrowPiecesinrpg_source.zigto treat the store of the statement at byte 0 as the subfield's type against the structure's start-value store, plus a date field proof from the store of a native temporary; not done here.The tracer tokens
rpg_source_stmt.runtimeSummary s19ands21fire on none of the 24ldt-dt-cvtcaptures, with the v0.1.490 Debug build or this one. A sweep of the other publicSC-ILE/EXPERIMENTSprobes with this build reachesruntimeSummarys10 (h-now2), s13, s20 (h-now1) and s22, and never s19 or s21.dateConvertCall s02still fires onlr3x-date-char-in-ds,s7f-typesands7f-types-dflt.Requested, not captured:
requests/ldt2/dt-fmt, 13 probes (*CDMY, the0forms of*CMDYand*LONGJUL,%CHARof adate(*usa)field in*EURand*ISO,%TIMESTAMP(c)without a format,%CHAR(ts: *ISO0), the date target at byte 0 with the source after it, a timestamp subfield, and the conversion inIF,DOWand a field comparison).Tests:
src/rpg_ldt2_test.zig(nine probesldt2-*; none has a pub400 measurement, each asserts noSOURCERER-FAILand the lines that v0.1.490 did not write)Gates (ship.sh):
8694077b24022cc3be36