def java_linemap(fn, lines):

    res = []
    in_stupid_js = False

    for l in lines:

        if in_stupid_js:
            res.append(l)
            if l.find('""")') >= 0:
                in_stupid_js = False
            continue

        if l.find('JS("""') >= 0:
            in_stupid_js = True
            res.append(l)
            continue
    
        res.append(fn(l))

    return res
dataset/ETHPy150Open anandology/pyjamas/contrib/java2py.py/java_linemap/original