use b_plain use cz/vars use cz/tok cz_pc() for_vec(function, functions, vec*) cstr *line_out = vec0(*function) int pc = 1 for_vec(line_p, *function, cstr) cstr line = *line_p if strstr(line, "b__pc") new(b, buffer, 256) char *p = line int could_be_blank = 0 while *p char *p0 = p token_t t = token(&p) int replaced = 0 if t == NAME && *p0 == 'b' && cstr_begins_with(p0, "b__pc") if tok_eq(p0, p, "b__pc") buffer_cat_int(b, pc) replaced = 1 eif tok_eq(p0, p, "b__pc_next") buffer_cat_int(b, pc+1) replaced = 1 eif tok_eq(p0, p, "b__pc_inc") ++pc replaced = 1 could_be_blank = 1 if !replaced buffer_cat_range(b, p0, p) line = *line_p = buffer_to_cstr(b) if could_be_blank && !*cstr_not_chr(line, '\t') continue # skip blank line from b__pc_inc *line_out++ = line vec_set_size(*function, line_out - (cstr *)vec0(*function))