mirror of
https://github.com/Mbed-TLS/mbedtls-framework.git
synced 2026-08-02 17:27:47 +00:00
Fix parsing of C line comments
Fix // comments stopping on 'n' instead of newlines. Also allow backslash-newline in // comments. Signed-off-by: Gilles Peskine <[email protected]>
This commit is contained in:
@@ -76,7 +76,7 @@ class FunctionInfo:
|
||||
# Match one C comment.
|
||||
# Note that we match both comment types, so things like // in a /*...*/
|
||||
# comment are handled correctly.
|
||||
_C_COMMENT_RE = re.compile(r'//[^n]*|/\*.*?\*/', re.S)
|
||||
_C_COMMENT_RE = re.compile(r'//(?:[^\n]|\\\n)*|/\*.*?\*/', re.S)
|
||||
_NOT_NEWLINES_RE = re.compile(r'[^\n]+')
|
||||
|
||||
def read_logical_lines(filename: str) -> Iterator[Tuple[int, str]]:
|
||||
|
||||
Reference in New Issue
Block a user