X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/322b7dab59b98b5d8625d2cd29e48f1ce605f769..eed18bf1fd1162872e196091ab795a773f277e8e:/lisp/nxml/xmltok.el diff --git a/lisp/nxml/xmltok.el b/lisp/nxml/xmltok.el index a9b24955fa..f80a5fd2fa 100644 --- a/lisp/nxml/xmltok.el +++ b/lisp/nxml/xmltok.el @@ -1,9 +1,9 @@ -;;; xmltok.el --- XML tokenization +;;; xmltok.el --- XML tokenization -*- lexical-binding:t -*- -;; Copyright (C) 2003, 2007-2011 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML +;; Keywords: wp, hypermedia, languages, XML ;; This file is part of GNU Emacs. @@ -132,33 +132,6 @@ from referencing the entity in element content and AR is either nil, meaning the replacement text included a <, or a string which is the normalized attribute value.") -(defvar xmltok-dependent-regions nil - "List of descriptors of regions that a parsed token depends on. - -A token depends on a region if the region occurs after the token and a -change in the region may require the token to be reparsed. This only -happens with markup that is not well-formed. For example, if a , then the then the buffer must be reparsed from the " nil t) - 'cdata-section - (xmltok-add-error "No closing ]]>") - (xmltok-add-dependent 'xmltok-unclosed-reparse-p - nil - nil - "]]>") - 'not-well-formed))) + (progn (search-forward "]]>" nil 'move) + 'cdata-section))) ((xmltok-after-lt start processing-instruction-question) (xmltok-scan-after-processing-instruction-open)) ((xmltok-after-lt start comment-open) @@ -758,68 +713,45 @@ Return the type of the token." ;; xmltok-scan-prolog-after-processing-instruction-open ;; XXX maybe should include rest of line (up to any <,>) in unclosed PI (defun xmltok-scan-after-processing-instruction-open () - (cond ((not (search-forward "?>" nil t)) - (xmltok-add-error "No closing ?>" - xmltok-start - (+ xmltok-start 2)) - (xmltok-add-dependent 'xmltok-unclosed-reparse-p - nil - nil - "?>") - (setq xmltok-type 'not-well-formed)) - (t - (cond ((not (save-excursion - (goto-char (+ 2 xmltok-start)) - (and (looking-at (xmltok-ncname regexp)) - (setq xmltok-name-end (match-end 0))))) - (setq xmltok-name-end (+ xmltok-start 2)) - (xmltok-add-error "" nil 'move) + (cond ((not (save-excursion + (goto-char (+ 2 xmltok-start)) + (and (looking-at (xmltok-ncname regexp)) + (setq xmltok-name-end (match-end 0))))) + (setq xmltok-name-end (+ xmltok-start 2)) + (xmltok-add-error "") - (xmltok-add-dependent 'xmltok-unclosed-reparse-p - nil - nil - ;; not --> because - ;; -- is not allowed - ;; in comments in XML - "--") - 'not-well-formed) - ((eq (char-after) ?>) - (goto-char (1+ (point))) - 'comment) - (t - (xmltok-add-dependent - 'xmltok-semi-closed-reparse-p - nil - (point) - "--" - 2) - ;; just include the