Unwrap a few lines in the XML parser.

This commit is contained in:
Yorick Peterse 2015-02-24 10:13:52 +01:00
parent cfc6749556
commit cbdaeb21f4
1 changed files with 5 additions and 17 deletions

View File

@ -164,16 +164,10 @@ attributes_
attribute attribute
# x:foo="bar" # x:foo="bar"
= T_ATTR_NS T_ATTR attribute_follow = T_ATTR_NS T_ATTR attribute_follow { on_attribute(val[1], val[0], val[2]) }
{
on_attribute(val[1], val[0], val[2])
}
# foo="bar" # foo="bar"
| T_ATTR attribute_follow | T_ATTR attribute_follow { on_attribute(val[0], nil, val[1]) }
{
on_attribute(val[0], nil, val[1])
}
; ;
attribute_follow attribute_follow
@ -211,18 +205,12 @@ string_squote_follow
; ;
string_body string_body
= T_STRING_BODY string_body_follow = T_STRING_BODY string_body_follow { val[1] ? val[0] + val[1] : val[0] }
{
val[1] ? val[0] + val[1] : val[0]
}
; ;
string_body_follow string_body_follow
= T_STRING_BODY string_body_follow = T_STRING_BODY string_body_follow { val[1] ? val[0] + val[1] : val[0] }
{ | _ { nil }
val[1] ? val[0] + val[1] : val[0]
}
| _ { nil }
; ;
%inner %inner