- "%s:2:expect second line to be '#define %.*s'.\n",
- f->name, (int)id_len, id);
+ "%s:%u:expected '#define %s'.\n",
+ f->name, i+1, line_info[i].cond->symbol);
+ }
+ sym = get_symbol_token(f, &line);
+ if (!sym || !streq(sym, line_info[i].cond->symbol)) {
+ return talloc_asprintf_append(sofar,
+ "%s:%u:expected '#define %s'.\n",
+ f->name, i+1, line_info[i].cond->symbol);
+ }
+
+ /* Rest of code should all be covered by that conditional. */
+ for (i++; i < f->num_lines; i++) {
+ unsigned int val = 0;
+ if (line_info[i].type == DOC_LINE
+ || line_info[i].type == COMMENT_LINE)
+ continue;
+ if (get_ccan_line_pp(line_info[i].cond, sym, &val, NULL)
+ != NOT_COMPILED)
+ return talloc_asprintf_append(sofar,
+ "%s:%u:code outside idempotent region.\n",
+ f->name, i+1);
+ }