Home
last modified time | relevance | path

Searched full:enum (Results 1 – 25 of 1552) sorted by relevance

12345678910>>...63

/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/11.enumerations/01.enumeration_integer_values/
Denum_int.params.yaml17 enum Enum { first, second, third }
19 assert Enum.first.valueOf() == 0
20 assert Enum.second.valueOf() == 1
21 assert Enum.third.valueOf() == 2
24 enum Enum { first, second = -2147483648, third}
26 assert Enum.first.valueOf() == 0
27 assert Enum.second.valueOf() == -2147483648
28 assert Enum.third.valueOf() == -2147483647
31 enum Enum { first = 0x7fffffff - 2, second, third }
33 assert Enum.first.valueOf() == 2147483645
[all …]
Denum_int_n.params.yaml20 enum Enum { first = a, second = b, third = c }
22 assert Enum.first.valueOf() == a
23 assert Enum.second.valueOf() == b
24 assert Enum.third.valueOf() == c
27 enum Enum { first = 1.0, second, third } // wrong init type
29 assert Enum.first.valueOf() == 1.0
32 enum Enum { first = 10e1, second, third } // wrong init type
34 assert Enum.first.valueOf() == 100
37 enum Enum { first = true, second = false } // wrong init type
42 enum Enum1 { first = 42, second }
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/11.enumerations/02.enumeration_string_values/
Denum_str.params.yaml17 enum Enum { first = "A", second = "B", third = "B" }
19 assert Enum.first.valueOf() == "A"
20 assert Enum.second.valueOf() == "B"
21 assert Enum.third.valueOf() == "B"
24 enum Enum { _first = "A", _second = "B", _third = "B" }
26 assert Enum._first.toString() == "A"
27 assert Enum._second.toString() == "B"
28 assert Enum._third.toString() == "B"
31 enum Enum { first = "A", second = "B", third = "B" }
32 let e1 = Enum.first
[all …]
Denum_str_n.params.yaml17 enum Enum { first = "a", second, third } // strings must be set explicitly
19 assert Enum.first.toString() == "a"
22enum Enum { first = 11, second = "12", third = 13 } // cannot combine string and int values
24 assert Enum.second.toString() == "12"
27 enum Enum { first = "11", second = null, third = "13" } // cannot use null
29 assert Enum.first.toString() == "11"
32 enum Enum { first = "11", second = undefined, third = "13" } // cannot use undefined
34 assert Enum.first.toString() == "11"
38 enum Enum { e1 = a, e2 = "DEF" }
40 assert Enum.e1.toString() == "ABC"
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/07.expressions/25.equality_expressions/05.enumeration_equality_operators/
Denum_equality.params.yaml17 enum Enum { first, second, third = 0 }
19 assert Enum.first != Enum.second && Enum.second != Enum.third
22 enum Enum { first = 11, second = 11, third = 11 }
24 assert Enum.first == Enum.second && Enum.second == Enum.third
27 enum Enum { first = "A", second = "B", third = "A" }
29 assert Enum.first != Enum.second && Enum.second != Enum.third
32 enum Enum { first = "ABC", second = "ABC", third = "ABC" }
34 assert Enum.first == Enum.second && Enum.second == Enum.third
/arkcompiler/runtime_core/static_core/verification/util/tests/
Dflags.cpp24 enum class Enum { E1, E2, E3 }; in TEST() enum
25 using F = ark::verifier::FlagsForEnum<size_t, Enum, Enum::E1, Enum::E2, Enum::E3>; in TEST()
28 flags[Enum::E2] = true; in TEST()
29 EXPECT_TRUE(flags[Enum::E2]); in TEST()
30 EXPECT_FALSE(flags[Enum::E1]); in TEST()
31 EXPECT_FALSE(flags[Enum::E3]); in TEST()
32 flags[Enum::E2] = false; in TEST()
33 EXPECT_FALSE(flags[Enum::E1]); in TEST()
34 EXPECT_FALSE(flags[Enum::E2]); in TEST()
35 EXPECT_FALSE(flags[Enum::E3]); in TEST()
[all …]
/arkcompiler/ets_frontend/ets2panda/linter/test_rules/
Drule113.ts.json22 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)"
29 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)"
36 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)"
43 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)"
50 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)"
57 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)"
64 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)"
71 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)"
78 …can be initialized only with compile time expressions of the same type (arkts-no-enum-mixed-types)"
85 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)"
[all …]
Drule113.ts.autofix.json25 …"replacementText": "enum Color {\n RED,\n GREEN,\n YELLOW = 2,\n BLACK = 3,\n BLUE\…
39 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)"
49 …"replacementText": "enum Color {\n RED,\n GREEN,\n YELLOW = 2,\n BLACK = 3,\n BLUE\…
63 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)"
73 …"replacementText": "enum Color {\n RED,\n GREEN,\n YELLOW = 2,\n BLACK = 3,\n BLUE\…
87 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)"
94 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)"
101 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)"
108 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)"
115 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)"
[all …]
Drule113.sts18 enum Color {
22 enum Color {
25 enum Color {
32 enum C {
39 enum C{
47 enum D {
51 enum D{
57 enum Str {
62 enum Str{
69 enum Empty {
[all …]
/arkcompiler/runtime_core/static_core/verification/util/
Denum_tag.h27 template <size_t I_NUM, typename Enum, Enum... ITEMS>
32 static size_t GetIndexFor([[maybe_unused]] Enum /* unused */) in GetIndexFor() argument
37 static Enum GetValueFor([[maybe_unused]] size_t /* unused */) in GetValueFor()
44 template <size_t I_NUM, typename Enum, Enum I, Enum... ITEMS>
45 class TagForEnumNumerated<I_NUM, Enum, I, ITEMS...> : public TagForEnumNumerated<I_NUM + 1ULL, Enum
46 using Base = TagForEnumNumerated<I_NUM + 1ULL, Enum, ITEMS...>;
51 static size_t GetIndexFor(Enum e) in GetIndexFor()
59 static Enum GetValueFor(size_t tag) in GetValueFor()
68 template <typename Enum, Enum... ITEMS>
69 class TagForEnum : public TagForEnumNumerated<0ULL, Enum, ITEMS...> {
[all …]
Dsaturated_enum.h34 template <typename Enum, Enum...>
37 template <typename Enum, Enum E>
38 class SaturatedEnum<Enum, E> {
40 SaturatedEnum &operator=(Enum e)
46 SaturatedEnum &operator|=(Enum e)
52 bool operator[](Enum e) const
58 operator Enum() const in Enum() function
71 bool Check(Enum e, bool prevSet) const in Check()
73 bool Check([[maybe_unused]] Enum e, bool prevSet) const in Check()
76 // to catch missed enum members in Check()
[all …]
Dflags.h24 template <typename UInt, typename Enum, Enum...>
27 template <typename UInt, typename Enum, Enum FLAG>
28 class FlagsForEnum<UInt, Enum, FLAG> {
80 ConstBit operator[](Enum f) const
86 Bit operator[](Enum f)
92 ConstBit operator[](Enum /* unused */) const
97 Bit operator[](Enum /* unused */)
109 template <typename UInt, typename Enum, Enum FLAG, Enum... REST>
110 class FlagsForEnum<UInt, Enum, FLAG, REST...> : public FlagsForEnum<UInt, Enum, REST...> {
111 using Base = FlagsForEnum<UInt, Enum, REST...>;
[all …]
/arkcompiler/ets_frontend/es2panda/test/compiler/sendable/
Dsendable-field-type-5.ts16 // test const enum inside namespace
18 export const enum Enum { enum
27 prop1: Enum = 0;
31 const enum Enum1 {
42 prop1: Enum = 0;
60 static prop1: Enum = 0
61 prop2: Enum = 1
66 export const enum Enum { enum
75 // test merged enum and namespace
77 namespace Enum {}
[all …]
/arkcompiler/runtime_core/libpandabase/events/
Devents.yaml16 …ds that will be stored within event. The type of each field should be a real C++ type, except enum.
34 type: enum
35 enum: [after_cframe, after_iframe, top_frame]
37 type: enum
38 enum: [success, error]
49 type: enum
50 enum: [static, virtual, virtual_cha, virtual_monomorphic, virtual_polymorphic]
52 type: enum
53enum: [success, fail, fail_resolve, fail_megamorphic, unsuitable, noinline, lost_single_impl, limi…
62 type: enum
[all …]
/arkcompiler/runtime_core/static_core/libpandabase/events/
Devents.yaml16 …ds that will be stored within event. The type of each field should be a real C++ type, except enum.
34 type: enum
35 enum: [after_cframe, after_iframe, top_frame]
37 type: enum
38 enum: [success, error]
49 type: enum
50enum: [static, virtual, virtual_cha, virtual_monomorphic, virtual_polymorphic, dynamic_monomorphic…
52 type: enum
53enum: [success, fail, fail_resolve, fail_megamorphic, unsuitable, noinline, lost_single_impl, limi…
62 type: enum
[all …]
/arkcompiler/ets_frontend/ets2panda/linter/docs/rules/
Drecipe113.md1 # ``enum`` declaration merging is not supported
3 Rule ``arkts-no-enum-merging``
7 ArkTS does not support merging declarations for ``enum``. Keep the
8 declaration of each ``enum`` compact in the codebase.
16 enum Color {
20 enum Color {
23 enum Color {
35 enum Color {
/arkcompiler/runtime_core/static_core/plugins/ets/doc/spec/
D11_enums.rst21 An enumeration type ``enum`` specifies a distinct user-defined type with an
27 'const'? 'enum' identifier '{' enumConstantList '}'
42 ``const enum`` is supported for source-level compatibility with |TS|,
43 and ``const`` is skipped as it has no impact on ``enum`` semantics in
51 enum Color { Red, Green, Blue }
65 enum constant
68 The value of an enum constant can be set explicitly to a numeric constant
71 the constant expression is omitted, then the value of the enum constant
88 enum E1 { A, B = "hello" } // compile-time error
89 enum E2 { A = 5, B = "hello" } // compile-time error
[all …]
/arkcompiler/runtime_core/static_core/tests/tests-u-runner/runner/enum_types/
Dconfiguration_kind.py18 from enum import Enum
21 class ConfigurationKind(Enum):
30 class ArchitectureKind(Enum):
37 class SanitizerKind(Enum):
43 class OSKind(Enum):
49 class BuildTypeKind(Enum):
/arkcompiler/ets_runtime/ecmascript/compiler/codegen/maple/mpl2mpl/include/
Dreflection_analysis.h22 enum class ClassRO : uint32 {
39 enum StaticFieldName {
45 enum class ClassProperty : uint32 {
64 enum class MethodProperty : uint32 {
79 enum class MethodInfoCompact : uint32 { kVtabIndex, kPaddrData };
81 enum class FieldProperty : uint32 {
93 enum class FieldPropertyCompact : uint32 { kPOffset, kMod, kTypeName, kIndex, kName, kAnnotation };
95 enum class MethodSignatureProperty : uint32 { kSignatureOffset, kParameterTypes };
/arkcompiler/ets_frontend/es2panda/binder/
DvariableFlags.h40 _(ENUM, EnumDecl) \
43 enum class DeclType {
67 enum class ScopeType {
73 enum class ResolveBindingOptions : uint8_t {
82 enum class ResolveBindingFlags : uint8_t {
94 _(ENUM, EnumVariable) \
99 enum class VariableType {
105 enum class VariableKind {
113 enum class VariableFlags : uint64_t {
150 enum class LetOrConstStatus {
[all …]
/arkcompiler/ets_frontend/ets2panda/test/ast/parser/ets/
Dswitch_enum_string_case_duplicate.sts16 enum Enum {e1 = "A", e2 = "B", e3 = "C"}
19 let v = Enum.e3
21 case Enum.e1: break;
22 case Enum.e1: break;
23 case Enum.e3: break;
/arkcompiler/ets_frontend/ets2panda/test/parser/ets/
Dswitch_enum_string_case.sts16 enum Enum {e1 = "A", e2 = "B", e3 = "C"}
19 let v = Enum.e3
21 case Enum.e2: assert false; break;
22 case Enum.e1: assert false; break;
23 case Enum.e3: break;
/arkcompiler/ets_frontend/ets2panda/test/runtime/ets/
Denum-string-operator-context.sts16 enum Color { Red, Green, Blue }
17 enum Commands { Open = "fopen", Close = "fclose" }
19 let s1 = "Enum:"+ Color.Green;
20 assert(s1 == "Enum:1")
21 let s2 = "String enum:"+ Commands.Open;
22 assert(s2 == "String enum:fopen")
/arkcompiler/runtime_core/static_core/libpandabase/templates/
Dlogger_enum_gen.h.erb20 enum class Level : uint8_t {
22 <%= l.enum %> = <%= l.value %>,
27 enum Component : uint32_t {
29 <%= c.enum %>,
34 enum class LogDfxComponent : uint8_t {
36 <%= c.enum %>,
/arkcompiler/runtime_core/libpandabase/templates/
Dlogger_enum_gen.h.erb18 enum class Level : uint8_t {
20 <%= l.enum %> = <%= l.value %>,
25 enum Component : uint32_t {
27 <%= c.enum %>,
32 enum class LogDfxComponent : uint8_t {
34 <%= c.enum %>,

12345678910>>...63