From fd5c1ddf5c7a01066f2c73e3f1148c87bb747695 Mon Sep 17 00:00:00 2001 From: Tomas Kukosa Date: Tue, 4 Jun 2013 14:07:36 +0000 Subject: Allow C directives in #.FN_HDR, #.FN_FTR, #.FN_BODY, they have to start with ## svn path=/trunk/; revision=49763 --- tools/asn2wrs.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tools/asn2wrs.py') diff --git a/tools/asn2wrs.py b/tools/asn2wrs.py index faedbfd2c7..c7f2ca4090 100755 --- a/tools/asn2wrs.py +++ b/tools/asn2wrs.py @@ -2352,8 +2352,9 @@ class EthCnf: lineno = 0 is_import = False directive = re.compile(r'^\s*#\.(?P[A-Z_][A-Z_0-9]*)(\s+|$)') + cdirective = re.compile(r'^\s*##') report = re.compile(r'^TABLE(?P\d*)_(?PHDR|BODY|FTR)$') - comment = re.compile(r'^\s*#[^.]') + comment = re.compile(r'^\s*#[^.#]') empty = re.compile(r'^\s*$') ctx = None name = '' @@ -2710,6 +2711,9 @@ class EthCnf: else: self.add_item(ctx, par[0], pars=par[1], fn=fn, lineno=lineno) elif ctx in ('FN_HDR', 'FN_FTR', 'FN_BODY'): + result = cdirective.search(line) + if result: # directive + line = '#' + line[result.end():] self.add_fn_line(name, ctx, line, fn=fn, lineno=lineno) elif ctx == 'CLASS': if empty.match(line): continue -- cgit v1.2.3