| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/07.expressions/25.equality_expressions/05.enumeration_equality_operators/ |
| D | enum_equality.params.yaml | 17 enum Enum { first, second, third = 0 } 19 … assertTrue(Enum.first != Enum.second && Enum.second != Enum.third && Enum.first == Enum.third) 22 enum Enum { first = 11, second = 11, third = 11 } 24 … assertTrue(Enum.first == Enum.second && Enum.second == Enum.third && Enum.first == Enum.third) 27 enum Enum { first = "A", second = "B", third = "A" } 29 … assertTrue(Enum.first != Enum.second && Enum.second != Enum.third && Enum.first == Enum.third) 32 enum Enum { first = "ABC", second = "ABC", third = "ABC" } 34 … assertTrue(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/ |
| D | enum_int.params.yaml | 17 enum Enum { first, second, third } 19 assertEQ( Enum.first.valueOf(), 0 ) 20 assertEQ( Enum.second.valueOf(), 1 ) 21 assertEQ( Enum.third.valueOf(), 2 ) 24 enum Enum { first, second = -2147483648, third} 26 assertEQ( Enum.first.valueOf(), 0 ) 27 assertEQ( Enum.second.valueOf(), -2147483648 ) 28 assertEQ( Enum.third.valueOf(), -2147483647 ) 31 enum Enum { first = 0x7fffffff - 2, second, third } 33 assertEQ( Enum.first.valueOf(), 2147483645 ) [all …]
|
| D | enum_int_n.params.yaml | 20 enum Enum { first = a, second = b, third = c } 22 assertEQ( Enum.first.valueOf(), a ) 23 assertEQ( Enum.second.valueOf(), b ) 24 assertEQ( Enum.third.valueOf(), c ) 27 enum Enum { first = 1.0, second, third } // wrong init type 29 assertEQ( Enum.first.valueOf(), 1.0 ) 32 enum Enum { first = 10e1, second, third } // wrong init type 34 assertEQ( 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/ |
| D | enum_str.params.yaml | 17 enum Enum { first = "A", second = "B", third = "B" } 19 assertEQ(Enum.first.valueOf(), "A") 20 assertEQ(Enum.second.valueOf(), "B") 21 assertEQ(Enum.third.valueOf(), "B") 24 enum Enum { _first = "A", _second = "B", _third = "B" } 26 assertEQ(Enum._first.toString(), "A") 27 assertEQ(Enum._second.toString(), "B") 28 assertEQ(Enum._third.toString(), "B") 31 enum Enum { first = "A", second = "B", third = "B" } 32 let e1 = Enum.first [all …]
|
| D | enum_str_n.params.yaml | 17 enum Enum { first = "a", second, third } // strings must be set explicitly 19 assertEQ(Enum.first.toString(), "a") 22 … enum Enum { first = 11, second = "12", third = 13 } // cannot combine string and int values 24 assertEQ(Enum.second.toString(), "12") 27 enum Enum { first = "11", second = null, third = "13" } // cannot use null 29 assertEQ(Enum.first.toString(), "11") 32 enum Enum { first = "11", second = undefined, third = "13" } // cannot use undefined 34 assertEQ(Enum.first.toString(), "11") 38 enum Enum { e1 = a, e2 = "DEF" } 40 assertEQ(Enum.e1.toString(), "ABC") [all …]
|
| /arkcompiler/runtime_core/static_core/verification/util/tests/ |
| D | flags.cpp | 24 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/test/parser/ts/ |
| D | test-enum-declaration-expected.txt | 14 "program": "test-enum-declaration.ts" 19 "program": "test-enum-declaration.ts" 34 "program": "test-enum-declaration.ts" 39 "program": "test-enum-declaration.ts" 47 "program": "test-enum-declaration.ts" 52 "program": "test-enum-declaration.ts" 66 "program": "test-enum-declaration.ts" 71 "program": "test-enum-declaration.ts" 85 "program": "test-enum-declaration.ts" 90 "program": "test-enum-declaration.ts" [all …]
|
| D | test-enum-declaration1-expected.txt | 14 "program": "test-enum-declaration1.ts" 19 "program": "test-enum-declaration1.ts" 34 "program": "test-enum-declaration1.ts" 39 "program": "test-enum-declaration1.ts" 47 "program": "test-enum-declaration1.ts" 52 "program": "test-enum-declaration1.ts" 66 "program": "test-enum-declaration1.ts" 71 "program": "test-enum-declaration1.ts" 82 "program": "test-enum-declaration1.ts" 87 "program": "test-enum-declaration1.ts" [all …]
|
| /arkcompiler/runtime_core/static_core/verification/util/ |
| D | enum_tag.h | 27 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 …]
|
| D | saturated_enum.h | 34 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 …]
|
| /arkcompiler/ets_frontend/ets2panda/linter/test/rules/ |
| D | rule113.ets.json | 24 "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 …]
|
| D | rule113.ets.autofix.json | 27 …"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 …]
|
| D | rule113.ets | 18 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/ets_frontend/es2panda/test/compiler/sendable/ |
| D | sendable-field-type-5.ts | 16 // 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/ |
| D | events.yaml | 16 …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 53 …enum: [success, fail, fail_resolve, fail_megamorphic, unsuitable, noinline, lost_single_impl, limi… 62 type: enum [all …]
|
| /arkcompiler/runtime_core/static_core/libpandabase/events/ |
| D | events.yaml | 16 …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, dynamic_monomorphic… 52 type: enum 53 …enum: [success, fail, fail_resolve, fail_megamorphic, unsuitable, noinline, lost_single_impl, limi… 62 type: enum [all …]
|
| /arkcompiler/ets_frontend/ets2panda/linter/docs/rules/ |
| D | recipe113.md | 1 # ``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/33.constant_expression/ |
| D | constant_expression.params.yaml | 16 enum Num { One, Two } 18 enum Str { Str1 = "abc", Str2 = "cde" } 20 enum Num { One = 1, Two = 2 } 22 enum Num { One = 1.0 as int, Two = 2.0 as int } 24 enum Bool { False = !true ? 1 : 2, True = !false ? 3 : 4 } 26 enum Unary { Plus = +3, Minus = -3, Tilda = ~3 } 28 enum Binary { Sum = 3 + 3, Sub = 3 - 3, Mul = 3 * 3, Div = 3 / 3, Mod = 3 % 3 } 30 enum Shift { Left = 3 << 3, Right = 3 >> 3, Unsigned = 3 >>> 3 } 32 …enum Comp { Less = 3 < 3 ? 1 : 2, Greater = 3 > 3 ? 3 : 4, EQGreater = 3 >= 3 ? 5 : 6, EQLess = 3 … 33 enum Comp2 { EQ = 3 == 3 ? 1 : 2, NotEQ = 3 != 3 ? 3 : 4 } [all …]
|
| /arkcompiler/ets_frontend/ets2panda/test/ast/parser/ets/ |
| D | enum29.ets | 16 enum Color { Red, Green, Blue } 18 enum ColorB { 22 enum ColorC { 26 enum ColorD { 30 enum ColorE { 33 enum ColorF { 37 enum ColorG { 41 enum ColorH { 45 enum ColorI { 48 enum Colorj { [all …]
|
| /arkcompiler/ets_frontend/ets2panda/public/ |
| D | es2panda_lib_enums.inc.erb | 20 % 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 …]
|
| D | es2panda_lib_impl.inc.erb | 20 % 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 …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/07.expressions/24.relational_expressions/05.enumeration_relational_operators/ |
| D | enum2.params.yaml | 17 enum Color1 { Red, Green, Blue } 18 enum Color2 { Red, Green, Blue } 31 // different enum types 35 enum Color { Red, Green, Blue } 36 enum Size { XS, S, M, L, XL, XXL } 39 // different enum types 43 enum Color { Red = "1", Green = "2", Blue = "3" } 44 enum Size { XS = "0", S = "1", M = "2", L = "3", XL = "4", XXL = "5" } 48 // string values, different enum types 52 enum Size { XS, S, M, L, XL, XXL } [all …]
|
| /arkcompiler/runtime_core/taihe/test/ani_enum/idl/ |
| D | enum_test.taihe | 15 enum Color: String { 25 enum Weekday: i32 { 40 enum Flags: f64 { 45 enum NumTypeI8: i8 { 53 enum NumTypeI16: i16 { 61 enum NumTypeI32: i32 { 69 enum NumTypeI64: i64 { 77 enum EnumString: String { 86 enum FlagsI8: i8 { 93 enum FlagsI16: i16 { [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/doc/spec/ |
| D | 11_enums.rst | 21 Enumeration type ``enum`` specifies a distinct user-defined type with an 29 'const'? 'enum' identifier (':' type)? '{' enumConstantList? '}' 42 type enum 47 Type ``const enum`` is supported for source-level compatibility with |TS|. 48 Type ``const`` is skipped as it has no impact on ``enum`` semantics in 60 enum Color { Red, Green, Blue } 63 enum Flags { Read, Write, ReadWrite = Read | Write } 75 const enum 82 enum constant 83 const enum [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ani/tests/namespace_ops/ |
| D | namespace_combinatorial_test.ets | 21 enum Enum { 40 enum Color { 46 enum ColorA { 52 enum ColorB { 81 enum Color { 87 enum ColorA { 93 enum ColorB { 122 enum Color { 128 enum ColorA { 134 enum ColorB { [all …]
|