From a308cf9fd8d116e1235bc5933b9a759f2224ebc9 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 17 Mar 2019 11:22:29 -0700 Subject: Use hand-rolled scanner for thematic break. Keep track of the last position where a thematic break failed to match on a line, to avoid rescanning unnecessarily. See commonmark/cmark#284. --- src/scanners.re | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'src/scanners.re') diff --git a/src/scanners.re b/src/scanners.re index 4c72cde..447147b 100644 --- a/src/scanners.re +++ b/src/scanners.re @@ -253,21 +253,6 @@ bufsize_t _scan_setext_heading_line(const unsigned char *p) */ } -// Scan a thematic break line: "...three or more hyphens, asterisks, -// or underscores on a line by themselves. If you wish, you may use -// spaces between the hyphens or asterisks." -bufsize_t _scan_thematic_break(const unsigned char *p) -{ - const unsigned char *marker = NULL; - const unsigned char *start = p; -/*!re2c - ([*][ \t]*){3,} [ \t]* [\r\n] { return (bufsize_t)(p - start); } - ([_][ \t]*){3,} [ \t]* [\r\n] { return (bufsize_t)(p - start); } - ([-][ \t]*){3,} [ \t]* [\r\n] { return (bufsize_t)(p - start); } - * { return 0; } -*/ -} - // Scan an opening code fence. bufsize_t _scan_open_code_fence(const unsigned char *p) { -- cgit v1.2.3