# HG changeset patch # User Thien-Thi Nguyen # Date 1118534193 0 # Node ID 3fc0c472c166a83cb1ea536cb100e55e3bba8249 # Parent e51dacaad0d0d9652c117d0193a89e606efa5fb6 Fix `repeat' BNF and `bits 2' example in Commentary. diff -r e51dacaad0d0 -r 3fc0c472c166 lisp/emacs-lisp/bindat.el --- a/lisp/emacs-lisp/bindat.el Sat Jun 11 23:52:51 2005 +0000 +++ b/lisp/emacs-lisp/bindat.el Sat Jun 11 23:56:33 2005 +0000 @@ -85,7 +85,7 @@ ;; (items u8) ;; (fill 3) ;; (item repeat (items) -;; ((struct data-spec))))) +;; (struct data-spec)))) ;; ;; ;; A binary data representation may look like @@ -131,7 +131,7 @@ ;; | ( [FIELD] align LEN ) -- skip to next multiple of LEN bytes ;; | ( [FIELD] struct SPEC_NAME ) ;; | ( [FIELD] union TAG_VAL (TAG SPEC)... [(t SPEC)] ) -;; | ( [FIELD] repeat COUNT SPEC ) +;; | ( [FIELD] repeat COUNT ITEM... ) ;; -- In (eval EXPR), the value of the last field is available in ;; the dynamically bound variable `last'. @@ -151,7 +151,8 @@ ;; -- Note: 32 bit values may be limited by emacs' INTEGER ;; implementation limits. ;; -;; -- Example: bits 2 will map bytes 0x1c 0x28 to list (2 3 7 11 13) +;; -- Example: `bits 2' will unpack 0x28 0x1c to (2 3 4 11 13) +;; and 0x1c 0x28 to (3 5 10 11 12). ;; FIELD ::= ( eval EXPR ) -- use result as NAME ;; | NAME