aboutsummaryrefslogtreecommitdiffstats
path: root/tools/asn2wrs.py
diff options
context:
space:
mode:
authorTomas Kukosa <tomas.kukosa@siemens.com>2013-06-04 14:07:36 +0000
committerTomas Kukosa <tomas.kukosa@siemens.com>2013-06-04 14:07:36 +0000
commitfd5c1ddf5c7a01066f2c73e3f1148c87bb747695 (patch)
treed227ac5a42fb6115bcd8615ee3bae48a8194e4fd /tools/asn2wrs.py
parentf37f79b107d61ddda09f5efa024d589cf95f349e (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/asn2wrs.py')
-rwxr-xr-xtools/asn2wrs.py6
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