From a4f994f31e566cc5e6512d3aebf627a6e3ce2cc7 Mon Sep 17 00:00:00 2001 From: Ondrej Fabry Date: Fri, 3 Feb 2023 11:33:39 +0100 Subject: vppapigen: fix incorrect comments in json Type: fix Signed-off-by: Ondrej Fabry Change-Id: I241cefbbce98cf6fef83f36bd87ae2c1f4b067f0 --- src/tools/vppapigen/vppapigen.py | 2 ++ src/tools/vppapigen/vppapigen_json.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tools/vppapigen/vppapigen.py b/src/tools/vppapigen/vppapigen.py index ce05cbe9b3f..2b0ce9999d7 100755 --- a/src/tools/vppapigen/vppapigen.py +++ b/src/tools/vppapigen/vppapigen.py @@ -752,6 +752,7 @@ class VPPAPIParser: """define : DEFINE ID '{' block_statements_opt '}' ';'""" self.fields = [] p[0] = Define(p[2], [], p[4], self.last_comment) + self.last_comment = None def p_define_flist(self, p): """define : flist DEFINE ID '{' block_statements_opt '}' ';'""" @@ -763,6 +764,7 @@ class VPPAPIParser: ) else: p[0] = Define(p[3], p[1], p[5], self.last_comment) + self.last_comment = None def p_flist(self, p): """flist : flag diff --git a/src/tools/vppapigen/vppapigen_json.py b/src/tools/vppapigen/vppapigen_json.py index ba32e284d81..0a1a3d37373 100644 --- a/src/tools/vppapigen/vppapigen_json.py +++ b/src/tools/vppapigen/vppapigen_json.py @@ -77,7 +77,8 @@ def walk_defs(s, is_message=False): c = {} c["crc"] = "{0:#0{1}x}".format(t.crc, 10) c["options"] = t.options - c["comment"] = t.comment + if t.comment: + c["comment"] = t.comment d.append(c) r.append(d) -- cgit 1.2.3-korg