Supported for parsing nested elements.

This commit is contained in:
Yorick Peterse committed 2014-03-12 23:13:28 +01:00
1 parent 8cfa81aed9
commit 2fbca93ae8
2 files changed
+31 -23

No files matched your search

+8 -17
View File
@@ -76,23 +76,7 @@ rule
# Elements
element
# <p></p>
: element_open T_ELEM_CLOSE { s(:element, val[0]) }
# <p class="foo"></p>
| element_open attributes T_ELEM_CLOSE
{
s(:element, val[0], val[1])
}
# <p>foo</p>
| element_open text T_ELEM_CLOSE
{
s(:element, val[0], nil, val[1])
}
# <p class="foo">Bar</p>
| element_open attributes text T_ELEM_CLOSE
: element_open attributes element_body T_ELEM_CLOSE
{
s(:element, val[0], val[1], val[2])
}
@@ -106,10 +90,17 @@ rule
| T_ELEM_OPEN T_ELEM_NS T_ELEM_NAME { [val[1], val[2]] }
;
element_body
: text
| element
| /* none */ { nil }
;
# Attributes
attributes
: attributes_ { s(:attributes, val[0]) }
| /* none */ { nil }
;
attributes_