From ef0f35c8b2080fc75f50d38eba136c9424c91134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Teichgr=C3=A4ber?= Date: Sat, 21 Apr 2012 22:51:26 +0200 Subject: [PATCH] parser.leg: mk_link, mk_list: use named return values --- parser.leg | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/parser.leg b/parser.leg index 2277f2c..0bddc22 100644 --- a/parser.leg +++ b/parser.leg @@ -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. * The reversing is necessary because cons adds to the head of a list. */ -func mk_list(key int, lst *element) *element { - result := mk_element(key) - result.children = reverse(lst) - return result +func mk_list(key int, lst *element) (el *element) { + el = mk_element(key) + el.children = reverse(lst) + return } /* mk_link - constructor for LINK element */ -func mk_link(label *element, url, title string) *element { - result := mk_element(LINK) - result.contents.link = &link{label: label, url: url, title: title} - return result +func mk_link(label *element, url, title string) (el *element) { + el = mk_element(LINK) + el.contents.link = &link{label: label, url: url, title: title} + return }