Renamed element lexer tags.

T_ELEM_OPEN has been renamed to T_ELEM_START, T_ELEM_CLOSE has been renamed to
T_ELEM_END. This keeps the token names consistent with the other ones (e.g.
T_COMMENT_START).
This commit is contained in:
Yorick Peterse committed 2014-03-24 20:32:43 +01:00
1 parent 0b6ba6e6b5
commit b695ecf0df
6 files changed
+56 -56

No files matched your search

+4 -4
View File
@@ -385,7 +385,7 @@ module Oga
# (if any). Remaining work is delegated to a dedicated machine.
action start_element {
emit_buffer
add_token(:T_ELEM_OPEN, nil)
add_token(:T_ELEM_START, nil)
# Add the element name. If the name includes a namespace we'll break
# the name up into two separate tokens.
@@ -442,7 +442,7 @@ module Oga
# element is a void element we'll close it and bail out.
'>' => {
if html? and HTML_VOID_ELEMENTS.include?(current_element)
add_token(:T_ELEM_CLOSE, nil)
add_token(:T_ELEM_END, nil)
@elements.pop
end
};
@@ -450,14 +450,14 @@ module Oga
# Regular closing tags.
'</' element_name '>' => {
emit_buffer
add_token(:T_ELEM_CLOSE, nil)
add_token(:T_ELEM_END, nil)
@elements.pop
};
# Self closing elements that are not handled by the HTML mode.
'/>' => {
add_token(:T_ELEM_CLOSE, nil)
add_token(:T_ELEM_END, nil)
@elements.pop
};
+4 -4
View File
@@ -13,7 +13,7 @@ token T_STRING T_TEXT
token T_DOCTYPE_START T_DOCTYPE_END T_DOCTYPE_TYPE
token T_CDATA_START T_CDATA_END
token T_COMMENT_START T_COMMENT_END
token T_ELEM_OPEN T_ELEM_NAME T_ELEM_NS T_ELEM_CLOSE T_ATTR
token T_ELEM_START T_ELEM_NAME T_ELEM_NS T_ELEM_END T_ATTR
options no_result_var
@@ -85,7 +85,7 @@ rule
# Elements
element
: element_open attributes expressions T_ELEM_CLOSE
: element_open attributes expressions T_ELEM_END
{
s(:element, val[0], val[1], val[2])
}
@@ -93,10 +93,10 @@ rule
element_open
# <p>
: T_ELEM_OPEN T_ELEM_NAME { [nil, val[1]] }
: T_ELEM_START T_ELEM_NAME { [nil, val[1]] }
# <foo:p>
| T_ELEM_OPEN T_ELEM_NS T_ELEM_NAME { [val[1], val[2]] }
| T_ELEM_START T_ELEM_NS T_ELEM_NAME { [val[1], val[2]] }
;
# Attributes