Home
last modified time | relevance | path

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

12345678910>>...70

/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 && Enum.first == Enum.third)
22 enum Enum { first = 11, second = 11, third = 11 }
24 assert(Enum.first == Enum.second && Enum.second == Enum.third && Enum.first == Enum.third)
27 enum Enum { first = "A", second = "B", third = "A" }
29 assert(Enum.first != Enum.second && Enum.second != Enum.third && Enum.first == Enum.third)
32 enum Enum { first = "ABC", second = "ABC", third = "ABC" }
34 assert(Enum.first == Enum.second && Enum.second == Enum.third && Enum.first == Enum.third)
37 enum Enum { first, second, third = 0 }
38 let arr: Enum[] = [Enum.first, Enum.second, Enum.third]
[all …]
/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/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.json24 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)",
34 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)",
44 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)",
54 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)",
64 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)",
74 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)",
84 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)",
94 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)",
104 …an be initialized only with compile time expressions of the same type (arkts-no-enum-mixed-types)",
114 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)",
[all …]
Drule113.ts.autofix.json27 …"replacementText": "enum Color {\n RED,\n GREEN,\n YELLOW = 2,\n BLACK = 3,\n BLUE\…
41 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)",
54 …"replacementText": "enum Color {\n RED,\n GREEN,\n YELLOW = 2,\n BLACK = 3,\n BLUE\…
68 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)",
81 …"replacementText": "enum Color {\n RED,\n GREEN,\n YELLOW = 2,\n BLACK = 3,\n BLUE\…
95 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)",
105 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)",
115 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)",
125 "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)",
135 "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/ets_frontend/ets2panda/public/
Des2panda_lib_impl.inc.erb20 % Enums::enums&.each do |name, enum|
21 % if enum.flags&.length > 0
22 extern "C" __attribute__((unused)) <%= enum.namespace %><%= if enum.parent_class_name then "::" + e…
25 % if enum.type == 'unsigned'
26 % if enum.flags.length <= 32 || enum.type == "int"
27 …auto irFlags = (<%= enum.namespace %><%= if enum.parent_class_name then "::" + enum.parent_class_n…
29 % enum.flags&.each do |flag|
30 …irFlags |= (e2pFlags & Es2panda<%= name %>::<%= enum.name_to_upper_snake %>_<%= flag %>) != 0 ? <%…
31 if enum.parent_class_name then "::" + enum.parent_class_name
32 end %>::<%= name %>::<%= flag %> : (<%= enum.namespace %><%= if enum.parent_class_name then "::" +
[all …]
Des2panda_lib_enums.inc.erb20 % Enums::enums&.each do |name, enum|
21 % if enum.flags.length > 0
22 % if enum.flags.length <= 32 || enum.type == "int"
23 enum Es2panda<%= name %> {
24 % enum.flags&.each_with_index do |flag, index|
25 % if enum.type == 'unsigned'
27 <%= enum.name_to_upper_snake %>_<%= flag %> = 0U,
29 <%= enum.name_to_upper_snake %>_<%= flag %> = 1U << <%= index - 1%>U,
32 <%= enum.name_to_upper_snake %>_<%= flag %>,
35 % enum.flag_unions&.each do |union_name, flags|
[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/tests/ets-templates/07.expressions/24.relational_expressions/05.enumeration_relational_operators/
Denum2_neg.params.yaml17 enum Color1 { Red, Green, Blue }
18 enum Color2 { Red, Green, Blue }
30 // different enum types
34 enum Color { Red, Green, Blue }
35 enum Size { XS, S, M, L, XL, XXL }
37 // different enum types
41 enum Color { Red = "1", Green = "2", Blue = "3" }
42 enum Size { XS = "0", S = "1", M = "2", L = "3", XL = "4", XXL = "5" }
45 // string values, different enum types
49 enum Size { XS, S, M, L, XL, XXL }
[all …]
/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 '}'
40 type enum
44 ``const enum`` is supported for source-level compatibility with |TS|,
45 and ``const`` is skipped as it has no impact on ``enum`` semantics in
53 enum Color { Red, Green, Blue }
69 enum constant
70 const enum
72 The value of an enum constant can be set explicitly to a numeric constant
75 the constant expression is omitted, then the value of the enum constant
[all …]
/arkcompiler/ets_frontend/ets2panda/test/test-lists/ets-runtime/
Dets-runtime-ignored-AMD64-CPP-OL2-FULLASTV.txt152 enum-conditional-expr-type-inference.sts
153 enum-equality-operators.sts
154 enum-extended-conditional-expressions.sts
155 enum-int-min.sts
156 enum-methods.sts
157 enum-numeric-operator-context.sts
158 enum-operations.sts
159 enum-parameter.sts
160 enum-relational-operators.sts
161 enum-string-operator-context.sts
[all …]
/arkcompiler/ets_frontend/ets2panda/test/ast/parser/ets/
Denum2.sts17 private /* @@ label */enum Colors {
22 protected /* @@ label1 */enum Size {
27 public /* @@ label2 */enum Direction {
33 /* @@ label3 */enum Operator {
41 /* @@@ label Error SyntaxError: Local type declaration (class, struct, interface and enum) support …
42 /* @@@ label1 Error SyntaxError: Local type declaration (class, struct, interface and enum) support…
43 /* @@@ label2 Error SyntaxError: Local type declaration (class, struct, interface and enum) support…
44 /* @@@ label3 Error SyntaxError: Local type declaration (class, struct, interface and enum) support…
/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.h21 enum class ClassRO : uint32 {
38 enum StaticFieldName {
44 enum class ClassProperty : uint32 {
63 enum class MethodProperty : uint32 {
78 enum class MethodInfoCompact : uint32 { kVtabIndex, kPaddrData };
80 enum class FieldProperty : uint32 {
92 enum class FieldPropertyCompact : uint32 { kPOffset, kMod, kTypeName, kIndex, kName, kAnnotation };
94 enum class MethodSignatureProperty : uint32 { kSignatureOffset, kParameterTypes };
/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")

12345678910>>...70