diff options
author | Tomas Kukosa <tkeksa@gmail.com> | 2021-05-05 17:30:07 +0200 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-05-06 07:36:08 +0000 |
commit | 5af925e013d57e262f8056200623dcaf31dfca51 (patch) | |
tree | 0ade827d6c923b8fc9f92fce82788b7ca13c24e9 /tools | |
parent | be6aff9e11d6dda4ab4fa020c91f1c3ff7560208 (diff) |
ITS: fix asn2wrs #.NO_EMIT
asn2wrs accepts #.NO_EMIT using module specific $Module$TypeName identifier
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/asn2wrs.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/asn2wrs.py b/tools/asn2wrs.py index f2696f6193..df90c4471b 100755 --- a/tools/asn2wrs.py +++ b/tools/asn2wrs.py @@ -921,7 +921,7 @@ class EthCtx: self.type_dep[type].append(dep) #--- eth_reg_type ----------------------------------------------------------- - def eth_reg_type(self, ident, val): + def eth_reg_type(self, ident, val, mod=None): #print "eth_reg_type(ident='%s', type='%s')" % (ident, val.type) if ident in self.type: if self.type[ident]['import'] and (self.type[ident]['import'] == self.Module()) : @@ -938,11 +938,18 @@ class EthCtx: self.type[ident]['tname'] = val.eth_tname() else: self.type[ident]['tname'] = asn2c(ident) + if mod : + mident = "$%s$%s" % (mod, ident) + else: + mident = None self.type[ident]['export'] = self.conform.use_item('EXPORTS', ident) self.type[ident]['enum'] = self.conform.use_item('MAKE_ENUM', ident) self.type[ident]['vals_ext'] = self.conform.use_item('USE_VALS_EXT', ident) self.type[ident]['user_def'] = self.conform.use_item('USER_DEFINED', ident) - self.type[ident]['no_emit'] = self.conform.use_item('NO_EMIT', ident) + if mident and self.conform.check_item('NO_EMIT', mident) : + self.type[ident]['no_emit'] = self.conform.use_item('NO_EMIT', mident) + else: + self.type[ident]['no_emit'] = self.conform.use_item('NO_EMIT', ident) self.type[ident]['tname'] = self.conform.use_item('TYPE_RENAME', ident, val_dflt=self.type[ident]['tname']) self.type[ident]['ethname'] = '' if (val.type == 'Type_Ref') or (val.type == 'TaggedType') or (val.type == 'SelectionType') : @@ -3286,7 +3293,7 @@ class Type (Node): else: trnm = self.val else: - ectx.eth_reg_type(nm, self) + ectx.eth_reg_type(nm, self, mod = ectx.Module()) trnm = nm if ectx.conform.check_item('VIRTUAL_ASSGN', nm): vnm = ectx.conform.use_item('VIRTUAL_ASSGN', nm) |