Faster parse frag
This commit is contained in:
parent
318a5fddf5
commit
3cbd3d196d
10
src/modal.c
10
src/modal.c
|
@ -228,10 +228,12 @@ parse_frag(char **side, char *s)
|
|||
if(c == ')' || (c == '<' || c == '>'))
|
||||
*side = ∅
|
||||
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;
|
||||
cap = walk(s), *side = dict_;
|
||||
if(c == '(')
|
||||
dict_ = copy(s + 1, dict_, cap - s - 2);
|
||||
else
|
||||
dict_ = copy(s, dict_, cap - s);
|
||||
s = cap, *dict_++ = 0;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue