Highlight comments

This commit is contained in:
Mikaël Bouillot 2017-02-05 11:27:37 +01:00
parent 8ad62ba1b6
commit 4135084a0f
3 changed files with 4 additions and 4 deletions

4
lib.py
View file

@ -21,8 +21,8 @@ def scriptLines (*args):
def unescape (bstr):
subs = (
('<','/*'),
('>','*/'),
('<','\033[32m/*'),
('>','*/\033[0m'),
('\1','\n'),
('\2','<'),
('\3','>'))

View file

@ -25,7 +25,6 @@ elif cmd == 'file':
if ext == '.c' or ext == '.h':
tokens = scriptLines ('tokenize-file', version, path)
del tokens[-1]
toBe = True
for tok in tokens:
toBe = not toBe

View file

@ -51,7 +51,8 @@ case $cmd in
tr '\n<>' '\1\2\3' |
sed 's/\/\*/</g' |
sed 's/\*\//>/g' |
sed -r 's/(\W*)(<[^>]*>)?(\w*)/\1\2\n\3\n/g'
sed -r 's/(\W*)(<[^>]*>)?(\w*)/\1\2\n\3\n/g' |
head -n -1
;;
untokenize)