diff options
author | Tomas Kukosa <tomas.kukosa@siemens.com> | 2013-06-04 14:07:36 +0000 |
---|---|---|
committer | Tomas Kukosa <tomas.kukosa@siemens.com> | 2013-06-04 14:07:36 +0000 |
commit | fd5c1ddf5c7a01066f2c73e3f1148c87bb747695 (patch) | |
tree | d227ac5a42fb6115bcd8615ee3bae48a8194e4fd /tools | |
parent | f37f79b107d61ddda09f5efa024d589cf95f349e (diff) |
Allow C directives in #.FN_HDR, #.FN_FTR, #.FN_BODY, they have to start with ##
svn path=/trunk/; revision=49763
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/asn2wrs.py | 6 |
1 files changed, 5 insertions, 1 deletions
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<name>[A-Z_][A-Z_0-9]*)(\s+|$)') + cdirective = re.compile(r'^\s*##') report = re.compile(r'^TABLE(?P<num>\d*)_(?P<type>HDR|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 |