From e46714c6afeb1fcb554b7626bde9c7954de80d84 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Fri, 31 Mar 2017 14:25:56 -0700 Subject: [PATCH] parse --- pitfall/pitfall/parse.rkt | 2 +- pitfall/pitfall/parser.rkt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pitfall/pitfall/parse.rkt b/pitfall/pitfall/parse.rkt index fcbdefee..d1e7cb40 100644 --- a/pitfall/pitfall/parse.rkt +++ b/pitfall/pitfall/parse.rkt @@ -75,7 +75,7 @@ (define data (string->bytes/utf-8 str)) (when (not (equal? (hash-ref (co-dict-dict dict) 'Length) (bytes-length data))) (raise-argument-error 'pf-stream - (format "~a bytes of data" (hash-ref dict 'Length)) + (format "~a bytes of data" (hash-ref (co-dict-dict dict) 'Length)) (format "~a = ~v" (bytes-length data) data))) (co-stream dict data)) diff --git a/pitfall/pitfall/parser.rkt b/pitfall/pitfall/parser.rkt index 4d7ff176..5cb1e395 100644 --- a/pitfall/pitfall/parser.rkt +++ b/pitfall/pitfall/parser.rkt @@ -1,6 +1,6 @@ #lang brag -pf-program : pf-header pf-object* +pf-program : [pf-header] pf-object* pf-header : PDF-HEADER @pf-object : pf-null | CHAR | BOOLEAN | INT | REAL | pf-name | pf-string | pf-array | pf-dict | pf-stream | pf-indirect-object | pf-indirect-object-ref | pf-comment @pf-null : NULL