def processfile(filename):
    start = None
    curr = None
    nbytes = None
    data = {}
    for (i, line) in enumerate(open(filename)):
        if (line.startswith(('function ', 'define ', ' (func ')) and ('}' not in line)):
            start = i
            curr = line
            nbytes = len(line)
        elif (line.startswith(('}', ' )')) and curr):
            nlines = (i - start)
            data[curr] = (nlines, (nbytes + 1))
            curr = None
            start = None
        elif curr:
            nbytes += len(line)
    return data
def processfile(filename):
    start = None
    curr = None
    nbytes = None
    data = {}
    for (i, line) in enumerate(open(filename)):
        if (line.startswith(('function ', 'define ', ' (func ')) and ('}' not in line)):
            start = i
            curr = line
            nbytes = len(line)
        elif (line.startswith(('}', ' )')) and curr):
            nlines = (i - start)
            data[curr] = (nlines, (nbytes + 1))
            curr = None
            start = None
        elif curr:
            nbytes += len(line)
    return data