summaryrefslogtreecommitdiffstats
path: root/tools/event_log_tags.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/event_log_tags.py')
-rw-r--r--tools/event_log_tags.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/event_log_tags.py b/tools/event_log_tags.py
index 81e8b39..645839e 100644
--- a/tools/event_log_tags.py
+++ b/tools/event_log_tags.py
@@ -90,6 +90,14 @@ class TagFile(object):
else:
description = None
+ if description:
+ # EventLog.java checks that the description field is
+ # surrounded by parens, so we should too (to avoid a runtime
+ # crash from badly-formatted descriptions).
+ if not re.match(r"\(.*\)\s*$", description):
+ self.AddError("tag \"%s\" has unparseable description" % (tagname,))
+ continue
+
self.tags.append(Tag(tag, tagname, description,
self.filename, self.linenum))
except (IOError, OSError), e: