def split_comments(lines):
    content = []
    for line in lines:
        l, comment = preprocessor.separate_comment(line + "\n")
        # skip over labels? this should be in macro_values
        while ":" in l:
            l = l[l.index(":") + 1 :]
        content += [[l, comment]]
    return content
Esempio n. 2
0
def split_comments(lines):
    content = []
    for line in lines:
        l, comment = preprocessor.separate_comment(line + '\n')
        # skip over labels? this should be in macro_values
        while ':' in l:
            l = l[l.index(':') + 1:]
        content += [[l, comment]]
    return content
Esempio n. 3
0
def asm_at_label(asm, label):
    label_def = label + ':'
    lines = asm.split('\n')
    for line in lines:
        if line.startswith(label_def):
            lines = lines[lines.index(line):]
            lines[0] = lines[0][len(label_def):]
            break
    # go until the next label
    content = []
    for line in lines:
        l, comment = preprocessor.separate_comment(line + '\n')
        if ':' in l:
            break
        content += [[l, comment]]
    return content
def asm_at_label(asm, label):
    label_def = label + ':'
    lines = asm.split('\n')
    for line in lines:
        if line.startswith(label_def):
            lines = lines[lines.index(line):]
            lines[0] = lines[0][len(label_def):]
            break
    # go until the next label
    content = []
    for line in lines:
        l, comment = preprocessor.separate_comment(line + '\n')
        if ':' in l:
            break
        content += [[l, comment]]
    return content