Add support for languages with multiple comment styles
treyhunner opened this issue · comments
Languages like PHP have multiple comment styles (//
and #
for single line comments). Currently the code only supports one single-line comment style and one multi-line comment style (optionally).
Two possible solutions:
-
Turn
"symbol"
definition into a List of symbol styles or allow a List to be specified optionally. PHP support could then be added like this:".php": { "name": "php", "symbol": ["//", "#"]}
-
Use regular expressions for
"symbol"
,"multistart"
, and"multiend"
. PHP support could then be added like this:".php": { "name": "php", "symbol": r"//|#"}
This would also allow both of python's very common docstring formats to be supported:
"""
3 double quotes
"""
'''
3 single quotes
'''
Currently on the first is supported, they are both equally valid.