Housekeeping
This commit is contained in:
parent
ad4738bce1
commit
2b7b68d713
14
src/modal.c
14
src/modal.c
|
@ -38,7 +38,7 @@ plode(char *s)
|
||||||
/* implode */
|
/* implode */
|
||||||
if(s[0] == '(') {
|
if(s[0] == '(') {
|
||||||
ss = walk(s);
|
ss = walk(s);
|
||||||
while(s < ss && (c = *(s++)))
|
while(s < ss && (c = *s++))
|
||||||
if(!spacer(c)) *outp_++ = c;
|
if(!spacer(c)) *outp_++ = c;
|
||||||
}
|
}
|
||||||
/* explode */
|
/* explode */
|
||||||
|
@ -78,12 +78,12 @@ put_reg(char r)
|
||||||
if(r == ':') {
|
if(r == ':') {
|
||||||
if(*s == '(') s++, --ss;
|
if(*s == '(') s++, --ss;
|
||||||
while(s < ss) {
|
while(s < ss) {
|
||||||
char c = *(s++);
|
char c = *s++;
|
||||||
if(c == '\\' && *(s++) == 'n') c = 0xa;
|
if(c == '\\' && *s++ == 'n') c = 0xa;
|
||||||
putc(c, stdout);
|
putc(c, stdout);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
while((s < ss)) *outp_++ = *s++;
|
while(s < ss) *outp_++ = *s++;
|
||||||
} else
|
} else
|
||||||
*outp_++ = r;
|
*outp_++ = r;
|
||||||
}
|
}
|
||||||
|
@ -145,7 +145,7 @@ parse_frag(char *s)
|
||||||
while((c = *s) && c <= ' ') s++;
|
while((c = *s) && c <= ' ') s++;
|
||||||
ss = walk(s);
|
ss = walk(s);
|
||||||
if(*s == '(') s++, ss--;
|
if(*s == '(') s++, ss--;
|
||||||
while((s < ss)) *dict_++ = *s++;
|
while(s < ss) *dict_++ = *s++;
|
||||||
*dict_++ = 0;
|
*dict_++ = 0;
|
||||||
s++;
|
s++;
|
||||||
return s;
|
return s;
|
||||||
|
@ -175,8 +175,8 @@ rewrite(void)
|
||||||
return commit_rule(r, s, 1);
|
return commit_rule(r, s, 1);
|
||||||
}
|
}
|
||||||
if(s[0] == '?' && s[1] == '(') {
|
if(s[0] == '?' && s[1] == '(') {
|
||||||
cap = walk(s+1);
|
r = &lambda, cap = walk(s + 1);
|
||||||
r = &lambda, create_rule(&lambda, -1, s), s = cap;
|
create_rule(&lambda, -1, s), s = cap;
|
||||||
while((c = *s) && c <= ' ') s++;
|
while((c = *s) && c <= ' ') s++;
|
||||||
if((res = match_rule(&lambda, s)) != NULL)
|
if((res = match_rule(&lambda, s)) != NULL)
|
||||||
return write_rule(&lambda, last, res);
|
return write_rule(&lambda, last, res);
|
||||||
|
|
Loading…
Reference in New Issue