added list of tests

This commit is contained in:
Erik Frojdh
2019-11-25 12:53:45 +01:00
parent c951b10b0f
commit e00c5068af
4 changed files with 134 additions and 12 deletions

13
python/scripts/parse.py Normal file
View File

@ -0,0 +1,13 @@
import re
def remove_comments(text):
def replacer(match):
s = match.group(0)
if s.startswith('/'):
return " " # note: a space and not an empty string
else:
return s
pattern = re.compile(
r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"',
re.DOTALL | re.MULTILINE
)
return re.sub(pattern, replacer, text)