summaryrefslogtreecommitdiff
path: root/scripts/gen-s-parser.py
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2019-05-06 18:20:03 -0700
committerGitHub <noreply@github.com>2019-05-06 18:20:03 -0700
commit9384c1d52a8176666e0412b23d9a32ccbc4a8f44 (patch)
tree5535007fc705d994d60f35f1b79ef2adf8d7ca9d /scripts/gen-s-parser.py
parentbadcb4098c9f5fc1700d994366600171e71270a2 (diff)
downloadbinaryen-9384c1d52a8176666e0412b23d9a32ccbc4a8f44.tar.gz
binaryen-9384c1d52a8176666e0412b23d9a32ccbc4a8f44.tar.bz2
binaryen-9384c1d52a8176666e0412b23d9a32ccbc4a8f44.zip
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.
Diffstat (limited to 'scripts/gen-s-parser.py')
-rwxr-xr-xscripts/gen-s-parser.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/gen-s-parser.py b/scripts/gen-s-parser.py
index 262c0aeaf..9dcfb3dd3 100755
--- a/scripts/gen-s-parser.py
+++ b/scripts/gen-s-parser.py
@@ -498,7 +498,7 @@ def instruction_parser():
printer.print_line("strncpy(op, s[0]->c_str(), {});".format(inst_length))
def print_leaf(expr, inst):
- printer.print_line("if (strcmp(op, \"{inst}\") == 0) return {expr};"
+ printer.print_line("if (strcmp(op, \"{inst}\") == 0) {{ return {expr}; }}"
.format(inst=inst, expr=expr))
printer.print_line("goto parse_error;")