Files
carbon-lang/core/prelude/operators/bitwise.carbon
T
Richard Smith 23f9065949 Implement proposal #3927. (#3963)
Change syntax for package declaration to put the `impl` keyword at the
start and remove the `api` keyword.

To support this, rearrange processing of package, library, and import
declarations to use the general modifier handling support in declaration
parsing rather than special-case logic.

There is an ambiguity in `impl package.Foo as Bar`, which we resolve by
treating `package` as an introducer after a modifier only if it's not
followed by `.`.
2024-05-21 00:36:03 +00:00

61 lines
1.3 KiB
Plaintext

// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
package Core library "prelude/operators/bitwise";
// Bit complement: `^a`.
interface BitComplement {
fn Op[self: Self]() -> Self;
}
// Bitwise AND: `a & b`.
interface BitAnd {
fn Op[self: Self](other: Self) -> Self;
}
// Bitwise AND with assignment: `a &= b`.
interface BitAndAssign {
fn Op[addr self: Self*](other: Self);
}
// Bitwise OR: `a | b`.
interface BitOr {
fn Op[self: Self](other: Self) -> Self;
}
// Bitwise OR with assignment: `a |= b`.
interface BitOrAssign {
fn Op[addr self: Self*](other: Self);
}
// Bitwise XOR: `a ^ b`.
interface BitXor {
fn Op[self: Self](other: Self) -> Self;
}
// Bitwise XOR with assignment: `a ^= b`.
interface BitXorAssign {
fn Op[addr self: Self*](other: Self);
}
// Left shift: `a << b`.
interface LeftShift {
fn Op[self: Self](other: Self) -> Self;
}
// Left shift with assignment: `a <<= b`.
interface LeftShiftAssign {
fn Op[addr self: Self*](other: Self);
}
// Right shift: `a >> b`.
interface RightShift {
fn Op[self: Self](other: Self) -> Self;
}
// Right shift with assignment: `a >>= b`.
interface RightShiftAssign {
fn Op[addr self: Self*](other: Self);
}