From a9fae49671891ae524a78740fb29d7b383f34515 Mon Sep 17 00:00:00 2001 From: sogaiu <983021772@users.noreply.github.com> Date: Sun, 30 Apr 2023 21:55:43 +0900 Subject: [PATCH] Tweak long-string|bytes peg in test suite files --- test/suite0003.janet | 3 ++- test/suite0007.janet | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/suite0003.janet b/test/suite0003.janet index f94b1b58..17c9d2d1 100644 --- a/test/suite0003.janet +++ b/test/suite0003.janet @@ -349,7 +349,7 @@ (def janet-longstring ~{:delim (some "`") :open (capture :delim :n) - :close (cmt (* (not (> -1 "`")) (-> :n) (<- :delim)) ,=) + :close (cmt (* (not (> -1 "`")) (-> :n) (<- (backmatch :n))) ,=) :main (* :open (any (if-not :close 1)) :close -1)}) (check-match janet-longstring "`john" false) @@ -359,6 +359,7 @@ (check-match janet-longstring "`` ``" true) (check-match janet-longstring "``` `` ```" true) (check-match janet-longstring "`` ```" false) +(check-match janet-longstring "`a``b`" false) # Line and column capture diff --git a/test/suite0007.janet b/test/suite0007.janet index 3d682678..48889298 100644 --- a/test/suite0007.janet +++ b/test/suite0007.janet @@ -60,7 +60,7 @@ :buffer (/ '(* "@" :bytes) (constant :string)) :long-bytes {:delim (some "`") :open (capture :delim :n) - :close (cmt (* (not (> -1 "`")) (-> :n) ':delim) ,=) + :close (cmt (* (not (> -1 "`")) (-> :n) '(backmatch :n)) ,=) :main (drop (* :open (any (if-not :close 1)) :close))} :long-string (/ ':long-bytes (constant :string)) :long-buffer (/ '(* "@" :long-bytes) (constant :string))