mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: add () for | and ^
This commit is contained in:
parent
50dabc8a49
commit
804d303487
@ -121,7 +121,7 @@ fn parse_args(args []string) (&pref.Preferences, string) {
|
||||
res.out_name = cmdline.option(args, '-o', '')
|
||||
i++
|
||||
}
|
||||
'-csource' {
|
||||
'-csource', 'backend' {
|
||||
i++ // TODO
|
||||
}
|
||||
else {
|
||||
|
@ -1382,7 +1382,7 @@ fn (g mut Gen) infix_expr(node ast.InfixExpr) {
|
||||
}
|
||||
}
|
||||
else {
|
||||
need_par := node.op == .amp // `x & y == 0` => `(x & y) == 0` in C
|
||||
need_par := node.op in [.amp, .pipe, .xor] // `x & y == 0` => `(x & y) == 0` in C
|
||||
if need_par {
|
||||
g.write('(')
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user