Tests for lexing a basic HTML document.

This also comes with some changes to the lexer so that it advances column/line
numbers correctly.
This commit is contained in:
Yorick Peterse committed 2014-03-13 23:55:18 +01:00
1 parent edf2e4112b
commit 6b2f682c5c
2 files changed
+63 -2

No files matched your search

+9 -2
View File
@@ -264,7 +264,13 @@ module Oga
element_start = '<' element_name;
element_text := |*
^'<' => buffer_text;
newline => {
emit_text_buffer
t(:T_TEXT)
advance_line
};
^('<' | newline) => buffer_text;
'<' => {
emit_text_buffer
@@ -284,7 +290,8 @@ module Oga
advance_column(2)
# Advance the column for the closing name.
advance_column(@te - p)
advance_column(text.length)
fret;
};