blob: 0916992a38f94dc838cc1298633b657e788f0c3f [file] [log] [blame]
library test.constants;
const UINT8 uint8 = 0b100;
const UINT16 uint16 = 0b100;
const UINT32 uint32 = 0b100;
const UINT64 uint64 = 0b100;
const INT8 int8 = 0b100;
const INT16 int16 = 0b100;
const INT32 int32 = 0b100;
const INT64 int64 = 0b100;
const FLOAT32 float32 = 3.14159;
const FLOAT64 float64 = 3.14159;
const BOOL bool = true;
const STRING string = "string";
type EnumType = strict enum : int32 {
VALUE = 1 | 2;
SECOND_VALUE = UINT32;
};
const enumVal EnumType = EnumType.VALUE;
const enumPrimitiveVal int32 = EnumType.VALUE;
type BitsType = strict bits : uint32 {
VALUE = 0x00000001;
SECOND_VALUE = UINT32;
THIRD_VALUE = 0x2 | 0;
};
const bitsVal BitsType = BitsType.VALUE;
const bitsPrimitiveVal uint32 = BitsType.VALUE;
const orResult BitsType = BitsType.VALUE | BitsType.SECOND_VALUE | BitsType.THIRD_VALUE;
const orResultPrimitiveVal uint32 = BitsType.VALUE | BitsType.SECOND_VALUE;
type Enum = strict enum {
E = 0b10101010;
};
type Bits = strict bits {
B = 0x8;
};
type Struct = struct {
@allow_deprecated_struct_defaults
int64_with_default int64 = 007;
@allow_deprecated_struct_defaults
string_with_default string = "stuff";
@allow_deprecated_struct_defaults
bool_with_default bool = true;
@allow_deprecated_struct_defaults
enum_with_default Enum = Enum.E;
@allow_deprecated_struct_defaults
bits_with_default Bits = Bits.B;
};