summaryrefslogtreecommitdiffstats
path: root/clang/docs/tools/dump_format_style.py
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2016-02-23 16:11:55 +0000
committerAlexander Kornienko <alexfh@google.com>2016-02-23 16:11:55 +0000
commit32718b6a0c54e77f9f0100a827a03965573ce69d (patch)
treefff1ba1dbdeeed6417967689df98d83cbe73ee8a /clang/docs/tools/dump_format_style.py
parent1e048236b9fe37b2c7400db1fcf8966fcb029362 (diff)
downloadbcm5719-llvm-32718b6a0c54e77f9f0100a827a03965573ce69d.tar.gz
bcm5719-llvm-32718b6a0c54e77f9f0100a827a03965573ce69d.zip
Support language selection for \code blocks.
llvm-svn: 261644
Diffstat (limited to 'clang/docs/tools/dump_format_style.py')
-rwxr-xr-xclang/docs/tools/dump_format_style.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/docs/tools/dump_format_style.py b/clang/docs/tools/dump_format_style.py
index 42e957044fd..6e149394981 100755
--- a/clang/docs/tools/dump_format_style.py
+++ b/clang/docs/tools/dump_format_style.py
@@ -79,7 +79,7 @@ class Enum:
class EnumValue:
def __init__(self, name, comment):
self.name = name
- self.comment = comment.strip()
+ self.comment = comment
def __str__(self):
return '* ``%s`` (in configuration: ``%s``)\n%s' % (
@@ -88,8 +88,12 @@ class EnumValue:
doxygen2rst(indent(self.comment, 2)))
def clean_comment_line(line):
- if line == '/// \\code':
- return '\n.. code-block:: c++\n\n'
+ match = re.match(r'^/// \\code(\{.(\w+)\})?$', line)
+ if match:
+ lang = match.groups()[1]
+ if not lang:
+ lang = 'c++'
+ return '\n.. code-block:: %s\n\n' % lang
if line == '/// \\endcode':
return ''
return line[4:] + '\n'
OpenPOWER on IntegriCloud