Changeset 37937 in project


Ignore:
Timestamp:
09/30/19 01:34:04 (3 weeks ago)
Author:
felix winkelmann
Message:

s11n 0.9.9: handle changed keyword representation (thanks to Kon Lovett)

Location:
release/5/s11n
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • release/5/s11n/tags/0.9.9/constants.scm

    r37921 r37937  
    2323(define-constant thirtytwo-bit-tag 18)
    2424(define-constant sixtyfour-bit-tag 19)
     25(define-constant keyword-tag 20)
    2526
    2627(define +sizeof-ulong+ (foreign-value "sizeof(unsigned long)" int))
  • release/5/s11n/tags/0.9.9/s11n.scm

    r37921 r37937  
    1212        (chicken base)
    1313        (chicken io)
     14        (chicken keyword)
    1415        (chicken foreign))
    1516(import miscmacros srfi-69)
     
    123124                    (emit (header_to_bytes x))
    124125                    (emitbytes x) )
     126                   ((keyword? x)
     127                    (emitb keyword-tag)
     128                    (walk (substring (##sys#slot x 1) 1)))
    125129                   ((symbol? x)
    126130                    (emitb
     
    195199             (vector-set! backrefs r x)
    196200             x) )
     201          ((keyword-tag)
     202           (addref #f)
     203           (let* ((r (sub1 backref-count))
     204                  (x (string->keyword (fetch)) ))
     205             (vector-set! backrefs r x)
     206             x) )
    197207          ((symbol-tag)
    198208           (addref #f)
     
    253263    (fetch) ) )
    254264
     265
    255266)
  • release/5/s11n/trunk/constants.scm

    r37921 r37937  
    2323(define-constant thirtytwo-bit-tag 18)
    2424(define-constant sixtyfour-bit-tag 19)
     25(define-constant keyword-tag 20)
    2526
    2627(define +sizeof-ulong+ (foreign-value "sizeof(unsigned long)" int))
  • release/5/s11n/trunk/s11n.scm

    r37921 r37937  
    1212        (chicken base)
    1313        (chicken io)
     14        (chicken keyword)
    1415        (chicken foreign))
    1516(import miscmacros srfi-69)
     
    123124                    (emit (header_to_bytes x))
    124125                    (emitbytes x) )
     126                   ((keyword? x)
     127                    (emitb keyword-tag)
     128                    (walk (substring (##sys#slot x 1) 1)))
    125129                   ((symbol? x)
    126130                    (emitb
     
    195199             (vector-set! backrefs r x)
    196200             x) )
     201          ((keyword-tag)
     202           (addref #f)
     203           (let* ((r (sub1 backref-count))
     204                  (x (string->keyword (fetch)) ))
     205             (vector-set! backrefs r x)
     206             x) )
    197207          ((symbol-tag)
    198208           (addref #f)
     
    253263    (fetch) ) )
    254264
     265
    255266)
Note: See TracChangeset for help on using the changeset viewer.