Changeset 35426 in project


Ignore:
Timestamp:
04/22/18 04:29:44 (6 months ago)
Author:
kon
Message:

add ±[0-9]+ as std-time name (but not dst-name), any name pattern match is name, add test, reflow

Location:
release/4/locale/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/4/locale/trunk/locale-components.scm

    r35403 r35426  
    1616  make-locale-components
    1717  locale-components?
    18   check-locale-components
    19   error-locale-components
     18  check-locale-components error-locale-components
    2019  locale-components=?
    2120  locale-component-ref
     
    2625  make-timezone-components
    2726  timezone-components?
    28   check-timezone-components
    29   error-timezone-components
     27  check-timezone-components error-timezone-components
    3028  set-timezone-component!
    3129  timezone-component-ref
     
    3331  ;
    3432  timezone-offset?
    35   check-timezone-offset
    36   error-timezone-offset
     33  check-timezone-offset error-timezone-offset
    3734  ;
    3835  make-timezone-dst-rule-julian-leap
    3936  timezone-dst-rule-julian-leap?
    40   check-timezone-dst-rule-julian-leap-day
    41   error-timezone-dst-rule-julian-leap-day
     37  check-timezone-dst-rule-julian-leap-day error-timezone-dst-rule-julian-leap-day
    4238  ;
    4339  make-timezone-dst-rule-julian-noleap
    4440  timezone-dst-rule-julian-noleap?
    45   check-timezone-dst-rule-julian-noleap-day
    46   error-timezone-dst-rule-julian-noleap-day
     41  check-timezone-dst-rule-julian-noleap-day error-timezone-dst-rule-julian-noleap-day
    4742  ;
    4843  timezone-dst-rule-julian?
     
    5146  make-timezone-dst-rule-mwd
    5247  timezone-dst-rule-mwd?
    53   check-timezone-dst-rule-mwd
    54   error-timezone-dst-rule-mwd
    55   check-timezone-dst-rule-mwd-day
    56   error-timezone-dst-rule-mwd-day
    57   check-timezone-dst-rule-mwd-week
    58   error-timezone-dst-rule-mwd-week
    59   check-timezone-dst-rule-mwd-month
    60   error-timezone-dst-rule-mwd-month
     48  check-timezone-dst-rule-mwd error-timezone-dst-rule-mwd
     49  check-timezone-dst-rule-mwd-day error-timezone-dst-rule-mwd-day
     50  check-timezone-dst-rule-mwd-week error-timezone-dst-rule-mwd-week
     51  check-timezone-dst-rule-mwd-month error-timezone-dst-rule-mwd-month
    6152  timezone-components=?
    6253  timezone-dst-rule-day
  • release/4/locale/trunk/locale-posix.scm

    r35403 r35426  
    9393(define parse-posix-literal-timezone
    9494  (let (
    95     (name-re (regexp "(^[^<:][^0-9,+-]+)|^<([^>]+)>"))
     95    (ext-name-re (regexp "(^[+-][0-9]+)|(^[^<:0-9,+-][^0-9,+-]*)|^<([^>]+)>"))
     96    (int-name-re (regexp "(^[^<:0-9,+-][^0-9,+-]*)|^<([^>]+)>"))
    9697    (offset-re (regexp "^(\\+|-)?([0-9]+)(:[0-9]+)?(:[0-9]+)?"))
    9798    ;For compatibility with System V Release 3.1, a semicolon (`;') may be
     
    205206              ;DST section is optional
    206207              (let (
    207                 (n-m (next-match name-re)) )
     208                (n-m (next-match int-name-re)) )
    208209                (or
    209210                  (not n-m)
     
    217218                        #; ;XXX What does "ahead" mean?
    218219                        (fx+ (timezone-component-ref tz 'std-offset) SEC/HR))) )
    219                     (set-timezone-component! tz 'dst-name (cadr n-m))
     220                    (set-timezone-component! tz 'dst-name (car n-m))
    220221                    (set-timezone-component! tz 'dst-offset off)
    221222                    ;Rule, if present, must be complete
     
    228229              ;Must have name & offset components
    229230              (let (
    230                 (n-m (next-match name-re)) )
     231                (n-m (next-match ext-name-re)) )
    231232                (cond
    232233                  ((not n-m)
     
    239240                          (fail "bad timezone STD offset") )
    240241                        (else
    241                           (set-timezone-component! tz 'std-name (cadr n-m))
     242                          (set-timezone-component! tz 'std-name (car n-m))
    242243                          (set-timezone-component! tz 'std-offset (hms->offset (cadr o-m) (cddr o-m)))
    243244                          #t ) ) ) ) ) ) ) ) )
  • release/4/locale/trunk/tests/locale-test.scm

    r35403 r35426  
    4343
    4444    ; unsupported but not an error
    45     (test-assert "T1" (not (posix-timezone-string->timezone-components ":foo,bar,baz")))
     45    (test-assert "T1a" (not (posix-timezone-string->timezone-components ":foo,bar,baz")))
     46
     47    ;
     48    (test-assert "T1b" (posix-timezone-string->timezone-components "+03-3:0:0XXXX-4:0:0"))
    4649
    4750    ; cannot have a name composed of digits
Note: See TracChangeset for help on using the changeset viewer.