From 96b7296910af54fb8ad244d650a5333bb977b640 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Tue, 2 Sep 2014 22:50:21 +0200 Subject: [PATCH] Ragel variable of element closing tags. --- ext/ragel/base_lexer.rl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ext/ragel/base_lexer.rl b/ext/ragel/base_lexer.rl index e38705e..336dd4f 100644 --- a/ext/ragel/base_lexer.rl +++ b/ext/ragel/base_lexer.rl @@ -208,6 +208,9 @@ # name/namespace, contents of the open tag and the body of an element. The # body of an element is lexed using the `main` machine. # + + element_end = ''; + action start_element { callback_simple("on_element_start"); fnext element_name; @@ -267,18 +270,17 @@ cdata => start_cdata; proc_ins_start => start_proc_ins; - # The start of an element. '<' => start_element; # Regular closing tags. - '' => { + element_end => { callback_simple("on_element_end"); }; # Treat everything else, except for "<", as regular text. The "<" sign # is used for tags so we can't emit text nodes for these characters. - ^'<'+ => { + any+ -- '<' => { callback("on_text", data, encoding, ts, te); }; *|;