process comments

This commit is contained in:
Elan Ruusamäe 2012-09-17 00:26:47 +02:00
parent a7759d6974
commit bae8b03c6a

View file

@ -248,6 +248,25 @@ class Formatter(FormatterBase):
# not supported # not supported
return '' return ''
def comment(self, text):
# real comments (lines with two hash marks)
if text[0:2] == '##':
return "/* %s */" % text[2:]
# some kind of macro
tokens = text.lstrip('#').split(None, 1)
if tokens[0] in ('language'):
return ''
if tokens[0] == 'acl':
# TODO: fill acl.auth.php
return ''
if tokens[0] == 'pragma':
return "/* pragma: %s */" % " ".join(tokens[1:])
return "/* %s */" % text.lstrip('#')
def macro(self, macro_obj, name, args): def macro(self, macro_obj, name, args):
def email(args): def email(args):
mail = args.replace(' AT ', '@') mail = args.replace(' AT ', '@')