[climacs-devel] html syntax buglet

Christophe Rhodes csr21 at cam.ac.uk
Mon Jun 27 21:31:31 UTC 2005


Hi,

I think NEXT-LEXEME has a buglet in HTML syntax.

in this clause:

        (#\< (fo) (cond ((or (end-of-buffer-p scan)
                             (not (eql (object-after scan) #\/)))
                         (make-instance 'start-tag-start))
                        (t (fo)
                           (make-instance 'end-tag-start))))

Here the effect of the /next/ character affects the identification of
the current lexeme.  This means that the lexer is no longer entirely
local, and so UPDATE-SYNTAX (which invalidates the lexemes based on
the damaged region) might not invalidate enough.  To see this, open an
empty html file and type

<html><head><title>foo</title>

and observe that the "</title>" is treated as a parse error.  The
problem is that the "<" of "</title>", when first typed, is treated as
a start-tag-start, and this is never invalidated.

I think the simplest way to fix this is probably to make #\< always
lex as a tag-start, rather than differentiating between
start-tag-start and end-tag-start, because then the update-syntax
method doesn't need to be updated.

(I found this while briefly looking for the bug which affects Prolog
syntax: loading a prolog file initially shows everything to be a parse
error; typing space at the top of the buffer forces a reparse and
everything is well from that point.  I have no idea why this happens.)

Cheers,

Christophe





More information about the climacs-devel mailing list