Ragel variable of element closing tags.

This commit is contained in:
Yorick Peterse 2014-09-02 22:50:21 +02:00
parent d92133ef43
commit 96b7296910
1 changed files with 5 additions and 3 deletions

View File

@ -208,6 +208,9 @@
# name/namespace, contents of the open tag and the body of an element. The # name/namespace, contents of the open tag and the body of an element. The
# body of an element is lexed using the `main` machine. # body of an element is lexed using the `main` machine.
# #
element_end = '</' identifier (':' identifier)* '>';
action start_element { action start_element {
callback_simple("on_element_start"); callback_simple("on_element_start");
fnext element_name; fnext element_name;
@ -267,18 +270,17 @@
cdata => start_cdata; cdata => start_cdata;
proc_ins_start => start_proc_ins; proc_ins_start => start_proc_ins;
# The start of an element. # The start of an element.
'<' => start_element; '<' => start_element;
# Regular closing tags. # Regular closing tags.
'</' identifier (':' identifier)* '>' => { element_end => {
callback_simple("on_element_end"); callback_simple("on_element_end");
}; };
# Treat everything else, except for "<", as regular text. The "<" sign # Treat everything else, except for "<", as regular text. The "<" sign
# is used for tags so we can't emit text nodes for these characters. # is used for tags so we can't emit text nodes for these characters.
^'<'+ => { any+ -- '<' => {
callback("on_text", data, encoding, ts, te); callback("on_text", data, encoding, ts, te);
}; };
*|; *|;