Commit 9c5ed2ce authored by Robert Strandh's avatar Robert Strandh

HTML syntax now does syntax highlighting.

The current code is a mess, because I haven't figured out how much of
html-syntax.lisp can be factored out and put in syntax.lisp for use
with other syntax modules.

Also, the HTML syntax module is nowhere near complete.  It exists
merely as an illustration of what can be done with incremental
parsing.  It is definitely premature to try to turn it into something
more complete and truly useful for editing HTML.
parent 5c330694
This diff is collapsed.
......@@ -139,14 +139,15 @@ the mark, according to the specified syntax."))
(target :initarg :target :reader target)
(initial-state :reader initial-state)))
(defclass rule-item () ())
(defclass rule-item ()
((parse-trees :initform '() :initarg :parse-trees :reader parse-trees)))
(defclass incomplete-item (rule-item)
((orig-state :initarg :orig-state :reader orig-state)
(predicted-from :initarg :predicted-from :reader predicted-from)
(rule :initarg :rule :reader rule)
(dot-position :initarg :dot-position :reader dot-position)
(parse-trees :initarg :parse-trees :reader parse-trees)
(suffix :initarg :suffix :reader suffix)))
(defmethod print-object ((item incomplete-item) stream)
......@@ -180,7 +181,8 @@ the mark, according to the specified syntax."))
:suffix remaining))
(t
(make-instance 'complete-item
:parse-tree remaining)))))
:parse-tree remaining
:parse-trees (cons parse-tree (parse-trees prev-item)))))))
(defgeneric item-equal (item1 item2))
......@@ -257,7 +259,6 @@ the mark, according to the specified syntax."))
:predicted-from item
:rule rule
:dot-position 0
:parse-trees '()
:suffix (right-hand-side rule))
(make-instance 'complete-item
:parse-tree (right-hand-side rule)))
......@@ -284,7 +285,6 @@ the mark, according to the specified syntax."))
:predicted-from nil
:rule rule
:dot-position 0
:parse-trees '()
:suffix (right-hand-side rule))
(make-instance 'complete-item
:parse-tree (right-hand-side rule)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment