Added logic to remove bash and shell comments

This commit is contained in:
Kevin Veen-Birkenbach 2024-07-21 09:22:53 +02:00
parent c950a42ca9
commit 095701e304

View File

@ -9,6 +9,8 @@ class CodeProcessor:
C = ".c"
CPP = ".cpp"
H = ".h"
BASH = ".sh"
SHELL = ".bash"
@staticmethod
def remove_comments(content, file_type):
@ -34,6 +36,12 @@ class CodeProcessor:
CodeProcessor.H: [
(r'\s*//.*', '',0),
(r'/\*.*?\*/', '',0)
],
CodeProcessor.BASH: [
(r'\s*#.*', '', 0)
],
CodeProcessor.SHELL: [
(r'\s*#.*', '', 0)
]
}