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

View File

@ -10,18 +10,18 @@ import re
import subprocess
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)
# 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)
def extract_enums(lines):
line_iter = iter(lines)