From 6c3cc9687c83fd794f28a8683b097a0333f08e77 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sat, 3 Dec 2022 18:42:02 -0600 Subject: [PATCH] Fix bug found by random testing related to #14 --- syntax-color-lib/syntax-color/scribble-lexer.rkt | 2 +- syntax-color-test/tests/syntax-color/scribble-lexer.rkt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/syntax-color-lib/syntax-color/scribble-lexer.rkt b/syntax-color-lib/syntax-color/scribble-lexer.rkt index 1db28ff..97b4928 100644 --- a/syntax-color-lib/syntax-color/scribble-lexer.rkt +++ b/syntax-color-lib/syntax-color/scribble-lexer.rkt @@ -192,7 +192,7 @@ (byte-rx #"^[|]" re-opener #"{") (byte-rx #".*?(?:(?=[|]" re-opener - #"[" (regexp-quote at-bytes) #"{])|(?=" + #"(" (regexp-quote at-bytes) #"|{))|(?=" closer #")|(?=[\r\n])|$)") '|{| ;; Better complex paren? diff --git a/syntax-color-test/tests/syntax-color/scribble-lexer.rkt b/syntax-color-test/tests/syntax-color/scribble-lexer.rkt index 6e7c315..48ce2bb 100644 --- a/syntax-color-test/tests/syntax-color/scribble-lexer.rkt +++ b/syntax-color-test/tests/syntax-color/scribble-lexer.rkt @@ -276,3 +276,5 @@ (4 parenthesis))) (test/chars '(#\^) "\\" '((1 text))) + +(test/chars (remove #\\ chars) "@|{|\\" '((3 parenthesis) (2 text)))