Removed useless rules from the parser.

This commit is contained in:
Yorick Peterse 2014-03-20 18:58:32 +01:00
parent 03774f2788
commit 70a39042e7
1 changed files with 2 additions and 22 deletions

View File

@ -17,6 +17,7 @@ rule
expressions
: expressions expression { val.compact }
| expression { val[0] }
| /* none */ { nil }
;
expression
@ -75,7 +76,7 @@ rule
# Elements
element
: element_open attributes element_body T_ELEM_CLOSE
: element_open attributes expressions T_ELEM_CLOSE
{
s(:element, val[0], val[1], val[2])
}
@ -89,22 +90,6 @@ rule
| T_ELEM_OPEN T_ELEM_NS T_ELEM_NAME { [val[1], val[2]] }
;
elements
: elements element { val }
| element
;
element_body
: element_body element_body_ { val }
| element_body_
| /* none */ { nil }
;
element_body_
: texts
| elements
;
# Attributes
attributes
@ -130,11 +115,6 @@ rule
text
: T_TEXT { s(:text, val[0]) }
;
texts
: texts text { val }
| text
;
end
---- inner