vppapigen: fix incorrect comments in json

Type: fix

Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: I241cefbbce98cf6fef83f36bd87ae2c1f4b067f0
This commit is contained in:
Ondrej Fabry
2023-02-03 11:33:39 +01:00
parent 905ec87977
commit a4f994f31e
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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)