From 318a5fddf5333fd7d0374a898e9697640c8587ab Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Fri, 10 May 2024 09:36:40 -0700 Subject: [PATCH] Reformatted parse_frag --- src/modal.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/modal.c b/src/modal.c index c18da75..bdb77be 100644 --- a/src/modal.c +++ b/src/modal.c @@ -223,16 +223,16 @@ apply_rule(Rule *r, char *s) static char * parse_frag(char **side, char *s) { - int wrapped; char c, *cap; while((c = *s) && c == ' ') s++; - if(c == ')' || (c == '<' && s[1] == '>')) { + if(c == ')' || (c == '<' || c == '>')) *side = ∅ - return s; + else { + int wrapped; + *side = dict_, cap = walk(s), wrapped = c == '('; + if(wrapped) s++, cap--; + dict_ = copy(s, dict_, cap - s), s = cap + wrapped, *dict_++ = 0; } - *side = dict_, cap = walk(s), wrapped = c == '('; - if(wrapped) s++, cap--; - dict_ = copy(s, dict_, cap - s), s = cap + wrapped, *dict_++ = 0; return s; }