Changeset 444


Ignore:
Timestamp:
Jan 30, 2004, 8:34:38 PM (21 years ago)
Author:
Gary Byers
Message:

PARSE-FOREIGN-STRUCT-OR-UNION-SPEC allows for anonymous fields.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/examples/bridge.lisp

    r429 r444  
    416416                     `(,record-class ,record-name ,@(fields)))
    417417                   (1+ (string-input-stream-index string-stream))))
    418               (let* ((field-name-string (read string-stream)))
     418              (let* ((field-name-string
     419                      (if (eql (peek-char nil string-stream) #\")
     420                        (read string-stream))))
    419421                (if (eql (peek-char nil string-stream) #\")
    420422                  (setq field-name-string (read string-stream)))
    421                 (unless (typep field-name-string 'string)
     423                (unless (or (null field-name-string)
     424                            (typep field-name-string 'string))
    422425                  (error "Bad field name in ~s: expected a quoted string, got ~s"
    423426                         typestring field-name-string))
     
    427430                     (string-input-stream-index string-stream)
    428431                     nil)
    429                   (fields `(,(escape-foreign-name field-name-string)
     432                  (fields `(,(if field-name-string (escape-foreign-name field-name-string))
    430433                            ,typespec))
    431434                  (setf (string-input-stream-index string-stream) endpos))))))))))
Note: See TracChangeset for help on using the changeset viewer.