parser.leg: mk_link, mk_list: use named return values

This commit is contained in:
Michael Teichgräber 2012-04-21 22:51:26 +02:00
parent 91a38d3048
commit ef0f35c8b2

View File

@ -925,18 +925,18 @@ func mk_str_from_list(list *element, extra_newline bool) (result *element) {
* This is designed to be used with cons to build lists in a parser action. * This is designed to be used with cons to build lists in a parser action.
* The reversing is necessary because cons adds to the head of a list. * The reversing is necessary because cons adds to the head of a list.
*/ */
func mk_list(key int, lst *element) *element { func mk_list(key int, lst *element) (el *element) {
result := mk_element(key) el = mk_element(key)
result.children = reverse(lst) el.children = reverse(lst)
return result return
} }
/* mk_link - constructor for LINK element /* mk_link - constructor for LINK element
*/ */
func mk_link(label *element, url, title string) *element { func mk_link(label *element, url, title string) (el *element) {
result := mk_element(LINK) el = mk_element(LINK)
result.contents.link = &link{label: label, url: url, title: title} el.contents.link = &link{label: label, url: url, title: title}
return result return
} }