示例#1
0
def handle_method_declaration(s, l, t):
	event_handler = t[0] != 'function'
	if event_handler:
		names, args, code = t[0], t[1], t[2]
	else:
		names, args, code = t[1], t[2], t[3]

	return component(lang.Method(names, args, code, event_handler))
示例#2
0
def handle_method_declaration(s, l, t):
    event_handler = t[0] != 'function'
    if event_handler:
        name, args, code = t[0], t[1], t[2]
    else:
        name, args, code = t[1], t[2], t[3]
    return component(
        lang.Method(name, args, code, event_handler)
        if name != 'constructor' else lang.Constructor(args, code))