rpg_eval_builtins.zig: a date or timestamp that a procedure returns is converted into the target field #774

Manually merged
binjovi-bot merged 1 commit from ldt into trunk 2026-11-10 01:33:27 +00:00
Owner

rpg_eval_builtins.zig: a date or timestamp that a procedure returns is converted into the target field

d = q_adddays(d) (SC-CONSTRUCT TRPG3, statement 136) was a partial statement: the date run time (_QRNX_DT_CVT) converts the returned value into the field, and dateResult accepted only a saved current date (date_literal_caller) or an address (33 T). The compiler loads the address of the returned value from the temporary of the call (27 P), and both descriptors hold the same measured format. dateResult now takes that form when both descriptors decode to one format of a date or a timestamp, and the temporary holds the text of a call (NAME(...)). The descriptor plumbing line S62.16 = NAME(...) is dropped.

  • Measured at this change (host Debug build, tracer on the public twin): TRPG3 statements 136 and 137 went from partial (call / operation_semantics, dateResult s03 and dateConvertCall s02) to recovered. Statement 136 emits V00288 = Q_ADDDAYS(V00288);.
  • Statement 137 (ts = q_timestamp()) is recovered in the dump, but the emit still shows a failure: the timestamp variable is automatic and nothing declares it (rpg_date_fields types static fields only, and Q_TIMESTAMP has no return type, TRPG3 statement 65). Not changed.
  • Not in this change: s7f-types and s7f-types-dflt statements 276, 285, 294 (SQL host variables, source at S255.128, formats 25/27/9 with separators not in rpg_date_convert.formats); lr3x-date-char-in-ds (data() requires the whole symbol to be the format width; the declaration of a structure with an inz character subfield and a date subfield stays a failure, see ld.md).
  • lr2-fb-char-fmt-sub (%SUBST(%CHAR(f: *USA): 7: 4), noted open in lr2e.md) emits with no failure at v0.1.489. lr2-fb-sub-len (%SUBST(%CHAR(f): 1)) has no _QRNX_DT_CVT call (callees empty; rpg_eval.step s07): it is the %SUBST without a length, which h-bifs-char and h-subfill also carry.
  • Tests: src/rpg_ldt_test.zig.

Battery ldt-dt-cvt (request, not captured)

24 cases in requests/ldt/dt-cvt: %CHAR of date formats missing from formats (*LONGJUL, *CYMD, *CMDY) and of *JIS, *YMD, *DMY; %CHAR of time formats; timestamp to characters, date and time; %DATE, %TIME, %TIMESTAMP of characters with a format; the conversion in a comparison and in a concatenation; a date or time subfield at an offset as source and a date subfield as target.

Gates

{"checks":{"net_statements":0},"census":{"statuses":{"recovered":645,"partial":0,"unresolved":0},"regressions":0,"newly_recovered":0},"golden":"golden floor 173 ceiling 0 <= dump 173/5/0","legend":"current","emit":{"worse":[],"better":1,"newly_clean":0,"clean_delta":0,"base":572,"new":572},"twins":{"groups":811,"recovered":789,"regressions":[],"newly":0},"allgroups":{"regressions":[],"newly":["savf/SC-CONSTRUCT/TRPG3/archive.savf 2"],"worse":[]},"full_check":{"exit":0,"seconds":1026}}
# rpg_eval_builtins.zig: a date or timestamp that a procedure returns is converted into the target field `d = q_adddays(d)` (SC-CONSTRUCT TRPG3, statement 136) was a partial statement: the date run time (`_QRNX_DT_CVT`) converts the returned value into the field, and `dateResult` accepted only a saved current date (`date_literal_caller`) or an address (`33 T`). The compiler loads the address of the returned value from the temporary of the call (`27 P`), and both descriptors hold the same measured format. `dateResult` now takes that form when both descriptors decode to one format of a date or a timestamp, and the temporary holds the text of a call (`NAME(...)`). The descriptor plumbing line `S62.16 = NAME(...)` is dropped. - Measured at this change (host Debug build, tracer on the public twin): TRPG3 statements 136 and 137 went from `partial` (`call` / `operation_semantics`, `dateResult s03` and `dateConvertCall s02`) to `recovered`. Statement 136 emits `V00288 = Q_ADDDAYS(V00288);`. - Statement 137 (`ts = q_timestamp()`) is `recovered` in the dump, but the emit still shows a failure: the timestamp variable is automatic and nothing declares it (`rpg_date_fields` types static fields only, and `Q_TIMESTAMP` has no return type, TRPG3 statement 65). Not changed. - Not in this change: `s7f-types` and `s7f-types-dflt` statements 276, 285, 294 (SQL host variables, source at `S255.128`, formats 25/27/9 with separators not in `rpg_date_convert.formats`); `lr3x-date-char-in-ds` (`data()` requires the whole symbol to be the format width; the declaration of a structure with an `inz` character subfield and a date subfield stays a failure, see `ld.md`). - `lr2-fb-char-fmt-sub` (`%SUBST(%CHAR(f: *USA): 7: 4)`, noted open in `lr2e.md`) emits with no failure at v0.1.489. `lr2-fb-sub-len` (`%SUBST(%CHAR(f): 1)`) has no `_QRNX_DT_CVT` call (callees empty; `rpg_eval.step s07`): it is the `%SUBST` without a length, which `h-bifs-char` and `h-subfill` also carry. - Tests: `src/rpg_ldt_test.zig`. ## Battery ldt-dt-cvt (request, not captured) 24 cases in `requests/ldt/dt-cvt`: `%CHAR` of date formats missing from `formats` (`*LONGJUL`, `*CYMD`, `*CMDY`) and of `*JIS`, `*YMD`, `*DMY`; `%CHAR` of time formats; timestamp to characters, date and time; `%DATE`, `%TIME`, `%TIMESTAMP` of characters with a format; the conversion in a comparison and in a concatenation; a date or time subfield at an offset as source and a date subfield as target. ## Gates ``` {"checks":{"net_statements":0},"census":{"statuses":{"recovered":645,"partial":0,"unresolved":0},"regressions":0,"newly_recovered":0},"golden":"golden floor 173 ceiling 0 <= dump 173/5/0","legend":"current","emit":{"worse":[],"better":1,"newly_clean":0,"clean_delta":0,"base":572,"new":572},"twins":{"groups":811,"recovered":789,"regressions":[],"newly":0},"allgroups":{"regressions":[],"newly":["savf/SC-CONSTRUCT/TRPG3/archive.savf 2"],"worse":[]},"full_check":{"exit":0,"seconds":1026}} ```
sean force-pushed ldt from e6942bc9d6
Some checks failed
binjovi/ci Binjovi failed the frozen plan
to bb7463cd3b
All checks were successful
binjovi/ci Binjovi completed the frozen plan
2026-11-10 01:23:45 +00:00
Compare
binjovi-bot manually merged commit bb7463cd3b into trunk 2026-11-10 01:33:27 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sean/sourcerer!774
No description provided.