parser.leg: mk_link, mk_list: use named return values
This commit is contained in:
parent
91a38d3048
commit
ef0f35c8b2
16
parser.leg
16
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
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user