Skip to content

Commit

Permalink
Revert regex change
Browse files Browse the repository at this point in the history
  • Loading branch information
Schamper committed Aug 4, 2023
1 parent e7c1c7f commit 4574ea3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dissect/cstruct/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def _names(self, tokens: TokenConsumer) -> List[str]:
@staticmethod
def _remove_comments(string: str) -> str:
# https://stackoverflow.com/a/18381470
pattern = r"([\"\'].*?[\"\'])|(/\*.*?\*/|//[^\r\n]*$)"
pattern = r"(\".*?\"|\'.*?\')|(/\*.*?\*/|//[^\r\n]*$)"
# first group captures quoted strings (double or single)
# second group captures comments (//single-line or /* multi-line */)
regex = re.compile(pattern, re.MULTILINE | re.DOTALL)
Expand Down

0 comments on commit 4574ea3

Please sign in to comment.