add logical or and logical and
This commit is contained in:
14
lex.c
14
lex.c
@@ -218,6 +218,20 @@ TokList lex(const char *s) {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case '&':
|
||||
consume(&pos, *(s++));
|
||||
if (s[0] == '&') {
|
||||
emit(&toks, &pos, (Tok){ .kind = TokOp, .Op = OpAnd });
|
||||
} else
|
||||
continue;
|
||||
break;
|
||||
case '|':
|
||||
consume(&pos, *(s++));
|
||||
if (s[0] == '|') {
|
||||
emit(&toks, &pos, (Tok){ .kind = TokOp, .Op = OpOr });
|
||||
} else
|
||||
continue;
|
||||
break;
|
||||
case '{':
|
||||
case '}':
|
||||
case '(':
|
||||
|
||||
Reference in New Issue
Block a user