~ubuntu-branches/ubuntu/wily/acl2/wily

« back to all changes in this revision

Viewing changes to books/xdoc/parse-xml.lisp

  • Committer: Package Import Robot
  • Author(s): Camm Maguire
  • Date: 2015-01-16 10:35:45 UTC
  • mfrom: (3.3.26 sid)
  • Revision ID: package-import@ubuntu.com-20150116103545-prehe9thgo79o8w8
Tags: 7.0-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
;
66
66
;    (:ENTITY TYPE) represents entities like &
67
67
;
68
 
;      - TYPE is :AMP, :LT, :GT, :APOS, :NBSP, :MDASH, or :RARR
 
68
;      - TYPE is :AMP, :LT, :GT, :APOS, :NBSP, :MDASH, :RARR, LSQUO, RSQUO, LDQUO, or RDQUO
69
69
 
70
70
(defun opentok-p (x) (eq (first x) :OPEN))
71
71
(defun opentok-name (x) (second x))
280
280
       ((when (equal str "apos")) (mv nil n '(:ENTITY :APOS)))
281
281
       ((when (equal str "nbsp")) (mv nil n '(:ENTITY :NBSP)))
282
282
       ((when (equal str "mdash")) (mv nil n '(:ENTITY :MDASH)))
283
 
       ((when (equal str "rarr")) (mv nil n '(:ENTITY :RARR))))
 
283
       ((when (equal str "rarr")) (mv nil n '(:ENTITY :RARR)))
 
284
       ((when (equal str "lsquo")) (mv nil n '(:ENTITY :LSQUO)))
 
285
       ((when (equal str "rsquo")) (mv nil n '(:ENTITY :RSQUO)))
 
286
       ((when (equal str "ldquo")) (mv nil n '(:ENTITY :LDQUO)))
 
287
       ((when (equal str "rdquo")) (mv nil n '(:ENTITY :RDQUO)))
 
288
       )
284
289
    (mv (str::cat "Unsupported entity: &" str ";" *nls*
285
290
                  "Nearby text: {" (error-context x saved-n xl) "}" *nls*)
286
291
        n nil)))
327
332
    (:NBSP  " ")
328
333
    (:MDASH "—")
329
334
    (:RARR  "→")
 
335
    (:LSQUO "‘")
 
336
    (:RSQUO "’")
 
337
    (:LDQUO "“")
 
338
    (:RDQUO "”")
330
339
    ))
331
340
 
332
341
(defun entitytok-as-plaintext (x)
338
347
    (:APOS  "'")
339
348
    (:NBSP  " ")
340
349
    (:MDASH "---")
341
 
    (:RARR  "-->")))
 
350
    (:RARR  "-->")
 
351
    (:LSQUO "`")
 
352
    (:RSQUO "'")
 
353
    (:LDQUO "``")
 
354
    (:RDQUO "''")))
342
355
 
343
356
(defun flatten-token-for-errormsg (x)
344
357
  (cond ((opentok-p x)