1 /** 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef ES2PANDA_COMPILER_TYPESCRIPT_TYPE_MAPPING_H 17 #define ES2PANDA_COMPILER_TYPESCRIPT_TYPE_MAPPING_H 18 19 #include "typeFlag.h" 20 21 #define TYPE_MAPPING(_) \ 22 _(TypeFlag::ARRAY, ArrayType) \ 23 _(TypeFlag::ANY, AnyType) \ 24 _(TypeFlag::BIGINT_LITERAL, BigintLiteralType) \ 25 _(TypeFlag::NUMBER, NumberType) \ 26 _(TypeFlag::STRING, StringType) \ 27 _(TypeFlag::SYMBOL, SymbolType) \ 28 _(TypeFlag::BOOLEAN, BooleanType) \ 29 _(TypeFlag::VOID, VoidType) \ 30 _(TypeFlag::NULL_TYPE, NullType) \ 31 _(TypeFlag::UNDEFINED, UndefinedType) \ 32 _(TypeFlag::UNKNOWN, UnknownType) \ 33 _(TypeFlag::NEVER, NeverType) \ 34 _(TypeFlag::UNION, UnionType) \ 35 _(TypeFlag::OBJECT, ObjectType) \ 36 _(TypeFlag::BIGINT, BigintType) \ 37 _(TypeFlag::BOOLEAN_LITERAL, BooleanLiteralType) \ 38 _(TypeFlag::NUMBER_LITERAL, NumberLiteralType) \ 39 _(TypeFlag::STRING_LITERAL, StringLiteralType) \ 40 _(TypeFlag::ENUM, EnumType) \ 41 _(TypeFlag::ENUM_LITERAL, EnumLiteralType) \ 42 _(TypeFlag::TYPE_PARAMETER, TypeParameter) \ 43 _(TypeFlag::TYPE_REFERENCE, TypeReference) \ 44 _(TypeFlag::NON_PRIMITIVE, NonPrimitiveType) 45 46 #define OBJECT_TYPE_MAPPING(_) \ 47 _(ObjectType::ObjectTypeKind::FUNCTION, FunctionType) \ 48 _(ObjectType::ObjectTypeKind::TUPLE, TupleType) \ 49 _(ObjectType::ObjectTypeKind::LITERAL, ObjectLiteralType) \ 50 _(ObjectType::ObjectTypeKind::INTERFACE, InterfaceType) 51 52 #endif /* TYPE_MAPPING_H */ 53