rpg_eval.zig and rpg_source.zig: steps in every unit, differences of times and timestamps, parts of times and timestamps, and characters or digits read as a date, a time or a timestamp #755
Loading…
Reference in a new issue
No description provided.
Delete branch "lr3b"
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_eval.zig and rpg_source.zig: steps in every unit, differences of times and timestamps, parts of times and timestamps, and characters or digits read as a date, a time or a timestamp
Second part of the date, time and timestamp work, from the capture
lr3-dt-arith(41 compiles). The unit codes and descriptors below are read from those twins.+ %SECONDS(n)and- %SECONDS(n)(unit 0x12) on a time or a timestamp.%DIFF(a: b: *UNIT)of two fields: years 0x0d, months 0x0e, days 0x0f, hours 0x10, minutes 0x11, seconds 0x12, mseconds 0x13; dates take years, months and days, times hours, minutes and seconds, timestamps all of them. All fields named by a%DIFFare typed by their width.%SUBDT(f: *PART)of a time field or a timestamp field (the work area of_QRNX_DT_CVTis the native form of the kind).%DATE(c: *USA),%DATE(c: *EUR),%DATE(c: *ISO0),%TIME(c: *ISO)and%TIMESTAMP(c)of a character field, and%DATE(i: *YMD)of a number, recover.%TIME(c: *ISO)and%TIMESTAMP(c)were emitted as%CHAR(c: *ISO)into a character field; they are the same conversion with the same descriptors, read by the kind.*USAor*EURdate field and on a*USAor*HMStime field recovers (the result is converted back to the format of the field).S.0 = ...) takes the type of the field it steps from, also when the target steps from itself; a field started by*SYSof its own (not in a data structure) is a date.*SYSis recognised only by the code itself (the call of the current time before the field, the conversion of its buffer after it), not by its default start value; a conversion of a field in another format than *ISO is a%CHAR(date: fmt)that needs the format of the field, so it stays a failure here; and the start value of a time field is a time literalt'hh.mm.ss'in the ISO form whatever the format of the field (a character literal on a time field is RNF3430): a value hh.mm.ss is a baretime, hh:mm:ss istime(*hms)and hh:mm AM or PM istime(*usa), which is the declaration that the value shows (the*JISand*EURforms have the same bytes).%DIFFor a step on it,%SUBDTof a time or a timestamp,%TIME(c),%TIMESTAMP(c),%DATE(c: fmt)) is typed when its start value has a rule in that type (the default of the type or a literal that it takes). When it has none, the field keeps the declaration of the program without these rules, and the statements that the rules recovered about it fail, as they did: the date work cannot lower the statements that are emitted nor turn a declaration into a refusal.timeInitial).%DAYS,%MONTHS,%YEARSon 10 bytes,%HOURS,%MINUTES,%SECONDSon 8, any on 26); before, a step on a field that no other statement typed was emitted on acharfield (char(10) = char(10) + %DAYS(1)). A date start value in the *USA (mm/dd/yyyy) or *EUR (dd.mm.yyyy) form is a date literal in adate(*usa)ordate(*eur)field, as the time start values are. Thetimeanddatethat a declaration has so far name no format: a colon time start value istime(*hms)and a *USA onetime(*usa)(the form of the start value did not reachtimeLiteralbefore, which compared the format withtime). Probeslr3y-*(capture dt-arith3, red tests insrc/rpg_lr3b_test.zig).*JIS,*MDY,*DMY,*YMD,*JULand the time formats*EURand*JISof a field.d = %date()into them is emitted as%CHAR(%DATE())into a character field because the field takes its format from its start value, which does not name them; the steps on them stay failures (probeslr3-date-jis-add,-mdy-,-dmy-,-ymd-,-jul-,lr3-time-eur-add,-jis-are in the capture, not adopted).%DIFFof two timestamps stores intoint(20), whose start value has no rule (probeslr3-diff-ts-*emit their%DIFFline and one failure for the start value).lr3-date-field-days,lr3-date-var-count,lr3-date-expr-count,lr3-ts-field-add,lr3-ts-var-count,lr3-time-field-add,lr3-ts-units,lr3-add-secs,lr3-step-from-sys,lr3-diff-date-months,lr3-diff-date-years,lr3-diff-time-hours,lr3-diff-time-minutes,lr3-diff-time-seconds,lr3-diff-ts-days,lr3-diff-ts-hours,lr3-diff-ts-minutes,lr3-diff-ts-seconds,lr3-diff-ts-mseconds,lr3-subdt-date-months,lr3-subdt-time-secs,lr3-subdt-ts-hours,lr3-date-char-usa,lr3-date-char-eur,lr3-date-char-iso0,lr3-date-num-ymd,lr3-time-char,lr3-ts-char,lr3-date-usa-add,lr3-date-eur-add,lr3-time-usa-add,lr3-time-hms-add(red tests insrc/rpg_lr3b_test.zig).Gates