Skip to content

Commit 9384c1d

Browse files
authored
Make sexp instruction parser pass clang-tidy (#2088)
Our current clang-tidy setting requires {} after ifs. Unlike clang-format, I couldn't find any directives or options that allow us to exclude the generated inc file from clang-tidy. Anyway adding a pair of braces is all it takes to make it pass.
1 parent badcb40 commit 9384c1d

2 files changed

Lines changed: 396 additions & 396 deletions

File tree

scripts/gen-s-parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ def instruction_parser():
498498
printer.print_line("strncpy(op, s[0]->c_str(), {});".format(inst_length))
499499

500500
def print_leaf(expr, inst):
501-
printer.print_line("if (strcmp(op, \"{inst}\") == 0) return {expr};"
501+
printer.print_line("if (strcmp(op, \"{inst}\") == 0) {{ return {expr}; }}"
502502
.format(inst=inst, expr=expr))
503503
printer.print_line("goto parse_error;")
504504

0 commit comments

Comments
 (0)