From 0f4d29d3662c4acb67df31481c2919c34ffb22f4 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 12 Sep 2017 20:42:02 -0700 Subject: regex: bug printing #/abc(def|ghi)/ This was broken by the July 16 commit "regex: don't print superfluous parens around classes", 2411f779f47c441659720ad0ddcabf91df1d2529. * regex.c (print_rec): If an (or ...) appears as a compound element, it must be rendered in parentheses; or_s must be handled here just like and_s. Prior to the faulty commit, this was implicitly true because the logic was inverted and wasn't ruling out or_s. --- regex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'regex.c') diff --git a/regex.c b/regex.c index aa57a326..31076795 100644 --- a/regex.c +++ b/regex.c @@ -2352,7 +2352,7 @@ static void print_rec(val exp, val stream, int *semi_flag) for (; args; args = cdr(args)) { val arg = car(args); if (consp(arg) && (car(arg) == compl_s || car(arg) == and_s || - car(arg) == nongreedy_s)) + car(arg) == or_s || car(arg) == nongreedy_s)) paren_print_rec(arg, stream, semi_flag); else print_rec(arg, stream, semi_flag); -- cgit v1.2.3