36 #define ATEOS() (v->now >= v->stop)
37 #define HAVE(n) (v->stop - v->now >= (n))
38 #define NEXT1(c) (!ATEOS() && *v->now == CHR(c))
39 #define NEXT2(a,b) (HAVE(2) && *v->now == CHR(a) && *(v->now+1) == CHR(b))
40 #define NEXT3(a,b,c) (HAVE(3) && *v->now == CHR(a) && \
41 *(v->now+1) == CHR(b) && \
42 *(v->now+2) == CHR(c))
43 #define SET(c) (v->nexttype = (c))
44 #define SETV(c, n) (v->nexttype = (c), v->nextvalue = (n))
45 #define RET(c) return (SET(c), 1)
46 #define RETV(c, n) return (SETV(c, n), 1)
47 #define FAILW(e) return (ERR(e), 0)
48 #define LASTTYPE(t) (v->lasttype == (t))
60 #define INTOCON(c) (v->lexcon = (c))
61 #define INCON(con) (v->lexcon == (con))
64 #define ENDOF(array) ((array) + sizeof(array)/sizeof(chr))
107 switch (*(v->
now + 3))
541 *(v->
now + 1) ==
CHR(
':') &&
542 (*(v->
now + 2) ==
CHR(
'<') ||
543 *(v->
now + 2) ==
CHR(
'>')) &&
544 *(v->
now + 3) ==
CHR(
':') &&
545 *(v->
now + 4) ==
CHR(
']') &&
546 *(v->
now + 5) ==
CHR(
']'))
551 RET((
c ==
CHR(
'<')) ?
'<' :
'>');
604 static const chr alert[] = {
607 static const chr esc[] = {
618 if (!(
'a' <=
c &&
c <=
'z') &&
619 !(
'A' <=
c &&
c <=
'Z') &&
620 !(
'0' <=
c &&
c <=
'9'))
738 if (v->
now == save || ((
int)
c > 0 && (
int)
c <= v->nsubexp))
846 n = n * ub + (
uchr) d;
873 *(v->
now + 1) ==
CHR(
':') &&
874 (*(v->
now + 2) ==
CHR(
'<') ||
875 *(v->
now + 2) ==
CHR(
'>')) &&
876 *(v->
now + 3) ==
CHR(
':') &&
877 *(v->
now + 4) ==
CHR(
']') &&
878 *(v->
now + 5) ==
CHR(
']'))
883 RET((
c ==
CHR(
'<')) ?
'<' :
'>');
911 if (
NEXT2(
'\\',
')'))
#define errsave(context,...)
static int lexescape(struct vars *v)
static void skip(struct vars *v)
static chr lexdigits(struct vars *v, int base, int minlen, int maxlen)
static int brenext(struct vars *v, chr c)
static void lexstart(struct vars *v)
static void prefixes(struct vars *v)
static chr chrnamed(struct vars *v, const chr *startp, const chr *endp, chr lastresort)
static int next(struct vars *v)
static struct cvec * range(struct vars *v, chr a, chr b, int cases)
static chr element(struct vars *v, const chr *startp, const chr *endp)
#define CHR_IS_IN_RANGE(c)
#define LATYPE_BEHIND_POS
#define LATYPE_BEHIND_NEG