parser: add xor type check
parent
ab37081f02
commit
c607246218
|
@ -437,9 +437,9 @@ fn (p mut Parser) expression() string {
|
||||||
p.error('strings only support `+` operator')
|
p.error('strings only support `+` operator')
|
||||||
}
|
}
|
||||||
expr_type := p.term()
|
expr_type := p.term()
|
||||||
if (tok_op in [.pipe, .amp]) && !(is_integer_type(expr_type) &&
|
if (tok_op in [.pipe, .amp, .xor]) && !(is_integer_type(expr_type) &&
|
||||||
is_integer_type(typ)) {
|
is_integer_type(typ)) {
|
||||||
p.error('operators `&` and `|` are defined only on integer types')
|
p.error('operator ${tok_op.str()} is defined only on integer types')
|
||||||
}
|
}
|
||||||
p.check_types(expr_type, typ)
|
p.check_types(expr_type, typ)
|
||||||
if (is_str || is_ustr) && tok_op == .plus && !p.is_js {
|
if (is_str || is_ustr) && tok_op == .plus && !p.is_js {
|
||||||
|
|
Loading…
Reference in New Issue