Reformatted parse_frag

This commit is contained in:
Devine Lu Linvega 2024-05-10 09:36:40 -07:00
parent f6d0cc8ece
commit 318a5fddf5
1 changed files with 6 additions and 6 deletions

View File

@ -223,16 +223,16 @@ apply_rule(Rule *r, char *s)
static char * static char *
parse_frag(char **side, char *s) parse_frag(char **side, char *s)
{ {
int wrapped;
char c, *cap; char c, *cap;
while((c = *s) && c == ' ') s++; while((c = *s) && c == ' ') s++;
if(c == ')' || (c == '<' && s[1] == '>')) { if(c == ')' || (c == '<' || c == '>'))
*side = &empty; *side = &empty;
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; return s;
} }