From 7e147d41e046fe246be4110fc2972a47baacce37 Mon Sep 17 00:00:00 2001 From: Ed Ching Date: Wed, 16 Feb 2022 21:11:14 -0800 Subject: [PATCH 01/13] Emit C++ classes for TypeScript generator and generator functions in .h file. --- src/MapleFE/ast2cpp/include/cpp_declaration.h | 1 + src/MapleFE/ast2cpp/include/helper.h | 5 +- src/MapleFE/ast2cpp/src/cpp_declaration.cpp | 34 +++++++-- src/MapleFE/ast2cpp/src/helper.cpp | 70 ++++++++++++++++++- 4 files changed, 103 insertions(+), 7 deletions(-) diff --git a/src/MapleFE/ast2cpp/include/cpp_declaration.h b/src/MapleFE/ast2cpp/include/cpp_declaration.h index f782d0a8f8..60c89f45b8 100644 --- a/src/MapleFE/ast2cpp/include/cpp_declaration.h +++ b/src/MapleFE/ast2cpp/include/cpp_declaration.h @@ -37,6 +37,7 @@ public: } std::string GenFunctionClass(FunctionNode* node); + std::string GenGeneratorClass(FunctionNode* node); void AddImportedModule(const std::string& module); bool IsImportedModule(const std::string& module); diff --git a/src/MapleFE/ast2cpp/include/helper.h b/src/MapleFE/ast2cpp/include/helper.h index 71ae151b5f..0949edd54b 100644 --- a/src/MapleFE/ast2cpp/include/helper.h +++ b/src/MapleFE/ast2cpp/include/helper.h @@ -34,12 +34,15 @@ extern std::unordered_mapTypeIdToJSType; extern std::unordered_mapTypeIdToJSTypeCXX; extern TypeId hlpGetTypeId(TreeNode* node); extern std::string GenClassFldAddProp(std::string, std::string, std::string, std::string, std::string); -extern std::string GenFuncClass(std::string retType, std::string funcName, std::string params, std::string args); +extern std::string FunctionTemplate(std::string retType, std::string funcName, std::string params, std::string args); +extern std::string GeneratorTemplate(std::string funcName, std::vector>&args); extern std::string tab(int n); extern bool IsClassMethod(TreeNode* node); extern std::string GetClassOfAssignedFunc(TreeNode* node); extern std::string GenAnonFuncName(TreeNode* node); inline std::string ClsName(std::string func) { return "Cls_"s + func; } +inline std::string GeneratorName(std::string func) { return "Generator_"s + func; } +inline std::string GeneratorFuncName(std::string func) { return "GeneratorFunc_"s + func; } extern void HandleThisParam(unsigned nParams, TreeNode* node, std::string& params, std::string&args); extern std::string hlpGetJSValTypeStr(TypeId typeId); extern std::string ArrayCtorName(int dim, std::string type); diff --git a/src/MapleFE/ast2cpp/src/cpp_declaration.cpp b/src/MapleFE/ast2cpp/src/cpp_declaration.cpp index ab6ea0c89a..a2653fe1ff 100644 --- a/src/MapleFE/ast2cpp/src/cpp_declaration.cpp +++ b/src/MapleFE/ast2cpp/src/cpp_declaration.cpp @@ -346,7 +346,23 @@ std::string CppDecl::GenFunctionClass(FunctionNode* node) { if (node->GetParamsNum() == 0) HandleThisParam(0, nullptr, params, args); - return GenFuncClass(GetTypeString(node->GetType(), nullptr), GetIdentifierName(node), params, args); + return FunctionTemplate(GetTypeString(node->GetType(), nullptr), GetIdentifierName(node), params, args); +} + +std::string CppDecl::GenGeneratorClass(FunctionNode* node) { + std::string captureVars, callOpArgs, funcArgs, params; + + std::vector> args; + for (unsigned i = 0; i < node->GetParamsNum(); ++i) { + if (auto n = node->GetParam(i)) { + // build vector of string pairs of argument types and names + std::string name = GetIdentifierName(n); + std::string type = GetTypeString(n, n->IsIdentifier()? static_cast(n)->GetType(): nullptr); + type.erase(type.find_last_not_of(' ')+1); // strip trailing spaces + args.push_back(std::pair(type, name)); + } + } + return GeneratorTemplate(GetIdentifierName(node), args); } std::string CppDecl::EmitModuleNode(ModuleNode *node) { @@ -388,19 +404,24 @@ namespace )""" + module + R"""( { CfgFunc *func = mod->GetNestedFuncAtIndex(i); TreeNode *node = func->GetFuncNode(); if (!IsClassMethod(node)) { + bool isGenerator = static_cast(node)->IsGenerator(); std::string ns = GetNamespace(node); if (!ns.empty()) str += "namespace "s + ns + " {\n"s; - str += GenFunctionClass(static_cast(node)); // gen func cls for each top level func + if (isGenerator) + str += GenGeneratorClass(static_cast(node)); // gen generator and generator funcs + else + str += GenFunctionClass(static_cast(node)); // gen func cls for each top level func if (!mHandler->IsFromLambda(node)) { // top level funcs instantiated here as function objects from their func class // top level lamda funcs instantiated later in assignment stmts - std::string funcinit = ClsName(node->GetName()) + "* "s + node->GetName() + " = new "s + ClsName(node->GetName()) + "();\n"s; + std::string typeName = isGenerator? GeneratorFuncName(node->GetName()): ClsName(node->GetName()); + std::string funcinit = typeName + "* "s + node->GetName() + " = new "s + typeName + "();\n"s; if (ns.empty()) AddDefinition(funcinit); else AddDefinition("namespace "s + ns + " {\n"s + funcinit + "\n}\n"s); - str += "extern "s + ClsName(node->GetName()) + "* "s + node->GetName() + ";\n"s; + str += "extern "s + typeName + "* "s + node->GetName() + ";\n"s; } if (!ns.empty()) str += "\n} // namespace " + ns + '\n'; @@ -684,6 +705,11 @@ std::string CppDecl::GetTypeString(TreeNode *node, TreeNode *child) { if (str != "none"s) return str + " "s; } + if (mHandler->IsGeneratorUsed(node->GetNodeId())) { + // check if generator type + if (auto func = mHandler->GetGeneratorUsed(node->GetNodeId())) + return GeneratorName(GetIdentifierName(func)) + "*"s; + } } return "t2crt::JS_Val "s; } diff --git a/src/MapleFE/ast2cpp/src/helper.cpp b/src/MapleFE/ast2cpp/src/helper.cpp index 281e3558b8..a037e4db8e 100644 --- a/src/MapleFE/ast2cpp/src/helper.cpp +++ b/src/MapleFE/ast2cpp/src/helper.cpp @@ -108,9 +108,9 @@ std::string GenClassFldAddProp(std::string objName, // for ctor(), it calls _body() but ignores return val from _body(), and instead returns _this // per TS/JS spec. -std::string GenFuncClass(std::string retType, std::string funcName, std::string params, std::string args) { +std::string FunctionTemplate(std::string retType, std::string funcName, std::string params, std::string args) { std::string str; - std::string clsName = "Cls_" + funcName; + std::string clsName = ClsName(funcName); std::string functorArgs = args; std::string functorParams = params; std::string thisType; @@ -146,6 +146,72 @@ class )""" + clsName + R"""( : public t2crt::Function { return str; } +// Template for generating Generators and Generator Functions: +// For each TS generator function, 2 C++ classes: generator and generator function are emitted. +// The generator function has only a single instance. It is called to create generator instances. +std::string GeneratorTemplate(std::string funcName, std::vector>& args) { + std::string str; + std::string generatorName = GeneratorName(funcName); + std::string generatorFuncName = GeneratorFuncName(funcName); + + // Different formats of arg list as needed by generator and generator function interfaces: + // - args for function class functor and generation class constructor + // () - generator class constructor field init list + // & - args passed by reference to generation function _body method + // ; - generator class fields for capturing closure + std::string functorArgs, ctorArgs, refArgs, initList, captureFields; + + for (bool hasArg=false; auto elem : args) { + if (!hasArg) + hasArg = true; + else { + functorArgs += ", "s; + refArgs += ", "s; + initList += ", "s; + } + std::string type = elem.first, name = elem.second; + functorArgs += type + " " + name; + refArgs += type + "& "+ name; + initList += name + "("s+ name + ")"s; + captureFields += tab(1) + type + " " + name + ";\n"s; + } + if (!refArgs.empty()) + refArgs = ", " + refArgs; + if (!initList.empty()) + initList = ", " + initList; + ctorArgs = functorArgs.empty()? std::string(): (", "s + functorArgs); + + str = R"""( +// )""" + funcName + R"""( generators +class )""" + generatorName + R"""( : public t2crt::GeneratorProto { +public: + )""" + generatorName + R"""((t2crt::Function* ctor, t2crt::Object* proto)""" + ctorArgs + R"""() : t2crt::GeneratorProto(ctor, proto))""" + initList + R"""( {} + ~)""" + generatorName + R"""(() {} + + // capture data +)""" + captureFields + R"""( + // iterator interface + t2crt::IteratorResult _next(t2crt::JS_Val* arg) override; + t2crt::IteratorResult _return(t2crt::JS_Val* val) override; + t2crt::IteratorResult _throw(t2crt::Error exception) override; +}; + +// )""" + funcName + R"""( generator function +class )""" + generatorFuncName + R"""( : public t2crt::GeneratorFuncPrototype { +public: + )""" + generatorFuncName + R"""(() : t2crt::GeneratorFuncPrototype(&t2crt::GeneratorFunction, &t2crt::Generator, t2crt::GeneratorPrototype) {} + ~)""" + generatorFuncName + R"""(() {} + + // Overload call op to return generator instances + )""" + generatorName + R"""(* operator()()""" + functorArgs + R"""(); + // Generator function body + t2crt::IteratorResult _body(t2crt::Object* _this, void*& yield)""" + refArgs + R"""(); +}; + +)"""; + return str; +} + bool IsClassMethod(TreeNode* node) { return(node->IsFunction() && node->GetParent() && node->GetParent()->IsClass()); } -- Gitee From 985a197309a469fb76c16da1e7bf5286e7e0b53d Mon Sep 17 00:00:00 2001 From: Ed Ching Date: Thu, 17 Feb 2022 00:44:43 -0800 Subject: [PATCH 02/13] Moved iterator interface _return method override from generator function classes to parent class GeneratorProto. --- src/MapleFE/ast2cpp/runtime/include/builtins.h | 11 +++++++++++ src/MapleFE/ast2cpp/src/helper.cpp | 10 ++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/MapleFE/ast2cpp/runtime/include/builtins.h b/src/MapleFE/ast2cpp/runtime/include/builtins.h index d5aa30f5ec..9b5b07ed8f 100644 --- a/src/MapleFE/ast2cpp/runtime/include/builtins.h +++ b/src/MapleFE/ast2cpp/runtime/include/builtins.h @@ -182,6 +182,17 @@ public: bool _finished = false; // flag if generator is in finished state bool _firstNext = true; // flag if first next has been called on iterator (27.5.1.2) JS_Val _retval = undefined; // save optional arg from iterator's return(arg) method + + IteratorResult _return(JS_Val* arg) override { + IteratorResult res; + _finished = true; + if (arg != nullptr) { + _retval = *arg; + res._value = *arg; + } + return res; + } + }; // 27.3.1 GeneratorFunction Constructor diff --git a/src/MapleFE/ast2cpp/src/helper.cpp b/src/MapleFE/ast2cpp/src/helper.cpp index a037e4db8e..643f5910c4 100644 --- a/src/MapleFE/ast2cpp/src/helper.cpp +++ b/src/MapleFE/ast2cpp/src/helper.cpp @@ -188,12 +188,10 @@ public: )""" + generatorName + R"""((t2crt::Function* ctor, t2crt::Object* proto)""" + ctorArgs + R"""() : t2crt::GeneratorProto(ctor, proto))""" + initList + R"""( {} ~)""" + generatorName + R"""(() {} - // capture data + // closure capture fields )""" + captureFields + R"""( - // iterator interface + // iterator interface (override _return and _throw when needed) t2crt::IteratorResult _next(t2crt::JS_Val* arg) override; - t2crt::IteratorResult _return(t2crt::JS_Val* val) override; - t2crt::IteratorResult _throw(t2crt::Error exception) override; }; // )""" + funcName + R"""( generator function @@ -202,9 +200,9 @@ public: )""" + generatorFuncName + R"""(() : t2crt::GeneratorFuncPrototype(&t2crt::GeneratorFunction, &t2crt::Generator, t2crt::GeneratorPrototype) {} ~)""" + generatorFuncName + R"""(() {} - // Overload call op to return generator instances + // call operator returns generator instances )""" + generatorName + R"""(* operator()()""" + functorArgs + R"""(); - // Generator function body + // generator function body t2crt::IteratorResult _body(t2crt::Object* _this, void*& yield)""" + refArgs + R"""(); }; -- Gitee From 3bcd0d9e7aad1c1d565a123e1872d50e2abb0bb1 Mon Sep 17 00:00:00 2001 From: Ed Ching Date: Thu, 17 Feb 2022 13:09:29 -0800 Subject: [PATCH 03/13] Add document for Javascript buiit-in objects and constructors. --- src/MapleFE/docs/builtin-constructors.md | 84 ++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 src/MapleFE/docs/builtin-constructors.md diff --git a/src/MapleFE/docs/builtin-constructors.md b/src/MapleFE/docs/builtin-constructors.md new file mode 100644 index 0000000000..b123d9b113 --- /dev/null +++ b/src/MapleFE/docs/builtin-constructors.md @@ -0,0 +1,84 @@ + +## JavaScript built-in objects + +JavaScript built-in object info is available at: + +### 1. ECMA-262 standard +https://262.ecma-international.org/12.0/#sec-ecmascript-standard-built-in-objects +``` +Under sections: + 19 The Global Object + 20 Fundamental Objects + 21 Numbers and Dates + 22 Text Processing + 23 Indexed Collections + 24 Keyed Collections + 25 Structured Data +``` + +### 2. Mozilla Developer docs +https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference under Built-in objects + +## JavaScript built-in object constructors + +Not all built-in objects work as object constructors. The following is a list of +JavaScript built-in objects that works as object constructors to create objects +of corresponding built-in type: + +## List of JavaScript built-in object constructors +``` + 1 AggregateError + 2 Array + 3 ArrayBuffer + 4 AsyncFunction + 5 BigInt64Array + 6 BigUint64Array + 7 Boolean + 8 DataView + 9 Date + 10 Error + 11 EvalError + 12 FinalizationRegistry + 13 Float32Array + 14 Float64Array + 15 Function + 16 Generator + 17 GeneratorFunction + 18 Int16Array + 19 Int32Array + 20 Int8Array + 21 InternalError (Mozilla only) + 22 Map + 23 Math + 24 Number + 25 Object + 26 Promise + 27 Proxy + 28 RangeError + 29 ReferenceError + 30 RegExp + 31 Set + 32 SharedArrayBuffer + 33 String + 34 Symbol + 35 SyntaxError + 36 TypeError + 37 Uint16Array + 38 Uint32Array + 39 Uint8Array + 40 Uint8ClampedArray + 41 URIError + 42 WeakMap + 43 WeakRef + 44 WeakSet +``` + +## TypeScript types + +Note that Record and Tuple currently are TypeScript only types. They are +not ECMA-262 standard yet, but has been proposed and undergoing standardization. + +- https://tc39.es/proposal-record-tuple +- https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types +- https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type + -- Gitee From f82536331efcf503cf837bf58e78a3ed947028bf Mon Sep 17 00:00:00 2001 From: Ed Ching Date: Thu, 17 Feb 2022 15:23:38 -0800 Subject: [PATCH 04/13] Update document with Iteratble and Iterator types. --- src/MapleFE/docs/builtin-constructors.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/MapleFE/docs/builtin-constructors.md b/src/MapleFE/docs/builtin-constructors.md index b123d9b113..b38060c8ad 100644 --- a/src/MapleFE/docs/builtin-constructors.md +++ b/src/MapleFE/docs/builtin-constructors.md @@ -75,10 +75,21 @@ of corresponding built-in type: ## TypeScript types -Note that Record and Tuple currently are TypeScript only types. They are +Additionally these TypeScript types will be treated as built-in object types too: +- Record +- Tuple +- Iterable +- Iterator + +### 1. Record and Tuple types +Record and Tuple currently are TypeScript only types. They are not ECMA-262 standard yet, but has been proposed and undergoing standardization. - https://tc39.es/proposal-record-tuple - https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types - https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type +### 2. Iterable and Iterator types +These are TypeScript types +- https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-6.html#stricter-generators +- https://www.typescriptlang.org/docs/handbook/iterators-and-generators.html#iterable-interface -- Gitee From 7b00e5359808b2d655008a20a6faee379b0ae0bd Mon Sep 17 00:00:00 2001 From: Wen HU Date: Thu, 17 Feb 2022 17:25:31 -0500 Subject: [PATCH 05/13] add stringpool dump() --- src/MapleFE/shared/include/stringpool.h | 2 ++ src/MapleFE/shared/src/stringpool.cpp | 7 +++++++ src/MapleFE/shared/src/typetable.cpp | 1 + 3 files changed, 10 insertions(+) diff --git a/src/MapleFE/shared/include/stringpool.h b/src/MapleFE/shared/include/stringpool.h index db2efeee63..3330a7f832 100644 --- a/src/MapleFE/shared/include/stringpool.h +++ b/src/MapleFE/shared/include/stringpool.h @@ -75,6 +75,8 @@ public: MASSERT(idx < mStringTable.size() && "string index out of range"); return mStringTable[idx]; } + + void Dump(); }; // Lexing, Parsing, AST Building and IR Building all share one global diff --git a/src/MapleFE/shared/src/stringpool.cpp b/src/MapleFE/shared/src/stringpool.cpp index 63b957481f..243f06273c 100644 --- a/src/MapleFE/shared/src/stringpool.cpp +++ b/src/MapleFE/shared/src/stringpool.cpp @@ -172,5 +172,12 @@ unsigned StringPool::GetStrIdx(const char *str, size_t len) { s.assign(str, len); return mMap->LookupEntryFor(s)->GetStrIdx(); } + +void StringPool::Dump() { + std::cout << "===================== StringTable =====================" << std::endl; + for (unsigned idx = 1; idx < mStringTable.size(); idx++) { + std::cout << " " << idx << " : " << mStringTable[idx] << std::endl; + } +} } diff --git a/src/MapleFE/shared/src/typetable.cpp b/src/MapleFE/shared/src/typetable.cpp index 90b0e4ac60..2164723bca 100644 --- a/src/MapleFE/shared/src/typetable.cpp +++ b/src/MapleFE/shared/src/typetable.cpp @@ -154,6 +154,7 @@ void TypeTable::Dump() { AstDump::GetEnumTypeId(tid) << " " << "(typeid " << tid << ") " << "(typeidx " << node->GetTypeIdx() << ") " << + "(stridx " << node->GetStrIdx() << ") " << "(nodeid " << node->GetNodeId() << ")" << std::endl; } std::cout << "===================== End TypeTable =====================" << std::endl; -- Gitee From 05d5e9270bc5a0752f2672c136850316080a7440 Mon Sep 17 00:00:00 2001 From: Wen HU Date: Thu, 17 Feb 2022 19:09:18 -0500 Subject: [PATCH 06/13] UpdateGeneratorUsed return bool --- src/MapleFE/astopt/include/ast_handler.h | 2 +- src/MapleFE/astopt/src/ast_handler.cpp | 4 +++- src/MapleFE/astopt/src/ast_ti.cpp | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/MapleFE/astopt/include/ast_handler.h b/src/MapleFE/astopt/include/ast_handler.h index fdeaa249df..0f4b46c1b2 100644 --- a/src/MapleFE/astopt/include/ast_handler.h +++ b/src/MapleFE/astopt/include/ast_handler.h @@ -252,7 +252,7 @@ class Module_Handler { void AddGeneratorUsed(unsigned nid, FunctionNode *func); bool IsGeneratorUsed(unsigned nid); FunctionNode *GetGeneratorUsed(unsigned nid); - void UpdateGeneratorUsed(unsigned target, unsigned src); + bool UpdateGeneratorUsed(unsigned target, unsigned src); // API to check a node is c++ field which satisfy both: // 1. direct field diff --git a/src/MapleFE/astopt/src/ast_handler.cpp b/src/MapleFE/astopt/src/ast_handler.cpp index 205cb110c6..38d6cdaa89 100644 --- a/src/MapleFE/astopt/src/ast_handler.cpp +++ b/src/MapleFE/astopt/src/ast_handler.cpp @@ -302,10 +302,12 @@ FunctionNode *Module_Handler::GetGeneratorUsed(unsigned nid) { return NULL; } -void Module_Handler::UpdateGeneratorUsed(unsigned target, unsigned src) { +bool Module_Handler::UpdateGeneratorUsed(unsigned target, unsigned src) { if (mGeneratorUsedMap.find(src) != mGeneratorUsedMap.end()) { mGeneratorUsedMap[target] = mGeneratorUsedMap[src]; + return true; } + return false; } bool Module_Handler::IsFromLambda(TreeNode *node) { diff --git a/src/MapleFE/astopt/src/ast_ti.cpp b/src/MapleFE/astopt/src/ast_ti.cpp index d69b053d62..80983f1b38 100644 --- a/src/MapleFE/astopt/src/ast_ti.cpp +++ b/src/MapleFE/astopt/src/ast_ti.cpp @@ -31,6 +31,7 @@ void TypeInfer::TypeInference() { ModuleNode *module = mHandler->GetASTModule(); if (mFlags & FLG_trace_3) { + gStringPool.Dump(); gTypeTable.Dump(); } @@ -1256,6 +1257,7 @@ DeclNode *TypeInferVisitor::VisitDeclNode(DeclNode *node) { TypeId elemTypeId = TY_None; unsigned elemTypeIdx = 0; bool isArray = false; + bool isFromGenerator = false; if (init) { merged = MergeTypeId(merged, init->GetTypeId()); mergedtidx = MergeTypeIdx(mergedtidx, init->GetTypeIdx()); @@ -1264,8 +1266,8 @@ DeclNode *TypeInferVisitor::VisitDeclNode(DeclNode *node) { elemTypeIdx = GetArrayElemTypeIdx(init); isArray = (elemTypeId != TY_None); // pass IsGeneratorUsed - mHandler->UpdateGeneratorUsed(node->GetNodeId(), init->GetNodeId()); - if (var) { + isFromGenerator = mHandler->UpdateGeneratorUsed(node->GetNodeId(), init->GetNodeId()); + if (var && isFromGenerator) { mHandler->UpdateGeneratorUsed(var->GetNodeId(), init->GetNodeId()); } } -- Gitee From c9bab54907a3b9936c3ea610efb3590372c3282c Mon Sep 17 00:00:00 2001 From: Wen HU Date: Thu, 17 Feb 2022 19:20:58 -0500 Subject: [PATCH 07/13] add builtin object types --- src/MapleFE/astopt/include/ast_info.h | 6 ++ src/MapleFE/astopt/src/ast_info.cpp | 28 ++++++++ .../typescript/include/lang_builtin.def | 67 +++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 src/MapleFE/typescript/include/lang_builtin.def diff --git a/src/MapleFE/astopt/include/ast_info.h b/src/MapleFE/astopt/include/ast_info.h index e94aeaf224..038834aa1e 100644 --- a/src/MapleFE/astopt/include/ast_info.h +++ b/src/MapleFE/astopt/include/ast_info.h @@ -46,6 +46,7 @@ class AST_INFO { std::unordered_set mWithTypeParamNodeSet; std::unordered_set mWithThisFuncSet;; std::unordered_set mFromLambda; + std::unordered_map mStrIdx2TypeIdxMap; void AddField(unsigned nid, TreeNode *node); @@ -106,6 +107,11 @@ class AST_INFO { void AddFromLambda(unsigned nid) { mFromLambda.insert(nid); } bool IsFromLambda(unsigned nid) { return mFromLambda.find(nid) != mFromLambda.end(); } + + void AddBuiltInTypes(); + bool IsBuiltInType(TreeNode *node); + unsigned GetBuiltInTypeIdx(unsigned stridx); + unsigned GetBuiltInTypeIdx(TreeNode *node); }; class FillNodeInfoVisitor : public AstVisitor { diff --git a/src/MapleFE/astopt/src/ast_info.cpp b/src/MapleFE/astopt/src/ast_info.cpp index 81c9dfd12a..5a2cc989f4 100644 --- a/src/MapleFE/astopt/src/ast_info.cpp +++ b/src/MapleFE/astopt/src/ast_info.cpp @@ -32,6 +32,8 @@ void AST_INFO::CollectInfo() { it->SetParent(module); } + AddBuiltInTypes(); + // collect import/export info MSGNOLOC0("============== XXport info =============="); mHandler->GetASTXXport()->CollectXXportInfo(mHandler->GetHidx()); @@ -67,6 +69,32 @@ void AST_INFO::CollectInfo() { visitor.Visit(module); } +void AST_INFO::AddBuiltInTypes() { + // add language builtin types + TreeNode *node = NULL; +#define BUILTIN(T) \ + node = gTypeTable.CreateBuiltinType(#T, TY_Class);\ + gTypeTable.AddType(node);\ + mStrIdx2TypeIdxMap[node->GetStrIdx()] = node->GetTypeIdx(); +#include "lang_builtin.def" +} + +bool AST_INFO::IsBuiltInType(TreeNode *node) { + return mStrIdx2TypeIdxMap.find(node->GetStrIdx()) != mStrIdx2TypeIdxMap.end(); +} + +unsigned AST_INFO::GetBuiltInTypeIdx(unsigned stridx) { + if (mStrIdx2TypeIdxMap.find(stridx) != mStrIdx2TypeIdxMap.end()) { + return mStrIdx2TypeIdxMap[stridx]; + } + return 0; +} + +unsigned AST_INFO::GetBuiltInTypeIdx(TreeNode *node) { + unsigned stridx = node->GetStrIdx(); + return GetBuiltInTypeIdx(stridx); +} + TypeId AST_INFO::GetTypeId(TreeNode *node) { return node->GetTypeId(); } diff --git a/src/MapleFE/typescript/include/lang_builtin.def b/src/MapleFE/typescript/include/lang_builtin.def new file mode 100644 index 0000000000..f6be7fb416 --- /dev/null +++ b/src/MapleFE/typescript/include/lang_builtin.def @@ -0,0 +1,67 @@ +// Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. +// +// OpenArkFE is licensed under the Mulan PSL v2. +// You can use this software according to the terms and conditions of the Mulan PSL v2. +// You may obtain a copy of Mulan PSL v2 at: +// +// http://license.coscl.org.cn/MulanPSL2 +// +// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR +// FIT FOR A PARTICULAR PURPOSE. +// See the Mulan PSL v2 for more details. +// + +// refer to docs/builtin-constructors.md + +// javascript builtin object types +BUILTIN(AggregateError) +BUILTIN(Array) +BUILTIN(ArrayBuffer) +BUILTIN(AsyncFunction) +BUILTIN(BigInt64Array) +BUILTIN(BigUint64Array) +BUILTIN(Boolean) +BUILTIN(DataView) +BUILTIN(Date) +BUILTIN(Error) +BUILTIN(EvalError) +BUILTIN(FinalizationRegistry) +BUILTIN(Float32Array) +BUILTIN(Float64Array) +BUILTIN(Function) +BUILTIN(Generator) +BUILTIN(GeneratorFunction) +BUILTIN(Int16Array) +BUILTIN(Int32Array) +BUILTIN(Int8Array) +BUILTIN(InternalError (Mozilla only)) +BUILTIN(Map) +BUILTIN(Math) +BUILTIN(Number) +BUILTIN(Object) +BUILTIN(Promise) +BUILTIN(Proxy) +BUILTIN(RangeError) +BUILTIN(ReferenceError) +BUILTIN(RegExp) +BUILTIN(Set) +BUILTIN(SharedArrayBuffer) +BUILTIN(String) +BUILTIN(Symbol) +BUILTIN(SyntaxError) +BUILTIN(TypeError) +BUILTIN(Uint16Array) +BUILTIN(Uint32Array) +BUILTIN(Uint8Array) +BUILTIN(Uint8ClampedArray) +BUILTIN(URIError) +BUILTIN(WeakMap) +BUILTIN(WeakRef) +BUILTIN(WeakSet) + +// typescript builtin object types +BUILTIN(Record) +BUILTIN(Tuple) +BUILTIN(Iterable) +BUILTIN(Iterator) -- Gitee From 1fd4a03d681e8bf72d7ae7c76374c81182d0437b Mon Sep 17 00:00:00 2001 From: eching Date: Fri, 18 Feb 2022 11:40:45 -0800 Subject: [PATCH 08/13] No need to save the optional arg to return() method. Per spec, it is returned by the return() method only. --- src/MapleFE/ast2cpp/runtime/include/builtins.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/MapleFE/ast2cpp/runtime/include/builtins.h b/src/MapleFE/ast2cpp/runtime/include/builtins.h index 9b5b07ed8f..8f25d93c64 100644 --- a/src/MapleFE/ast2cpp/runtime/include/builtins.h +++ b/src/MapleFE/ast2cpp/runtime/include/builtins.h @@ -162,8 +162,8 @@ public: IteratorProto(Function* ctor, Object* proto) : Object(ctor, proto) { } ~IteratorProto() { } // note: the arg on an iterator's 1st next() call is ignored per spec 27.5.1.2 - virtual IteratorResult _next(JS_Val* arg) { return IteratorResult(); } - virtual IteratorResult _return(JS_Val* val) { return IteratorResult(); } + virtual IteratorResult _next (JS_Val* arg = nullptr) { return IteratorResult(); } + virtual IteratorResult _return(JS_Val* val = nullptr) { return IteratorResult(); } virtual IteratorResult _throw(Error exception) { return IteratorResult(); } // TODO: %IteratorPrototype%[Symbol.iterator]() = this (current iterator instance) @@ -181,18 +181,15 @@ public: void* _yield = nullptr; // pointer to yield label to resume execution bool _finished = false; // flag if generator is in finished state bool _firstNext = true; // flag if first next has been called on iterator (27.5.1.2) - JS_Val _retval = undefined; // save optional arg from iterator's return(arg) method - IteratorResult _return(JS_Val* arg) override { + IteratorResult _return(JS_Val* arg = nullptr) override { IteratorResult res; _finished = true; if (arg != nullptr) { - _retval = *arg; res._value = *arg; } return res; } - }; // 27.3.1 GeneratorFunction Constructor -- Gitee From ff66536e539d2d0dfda44ca0ca44135e546fba6d Mon Sep 17 00:00:00 2001 From: Wen HU Date: Fri, 18 Feb 2022 16:08:09 -0500 Subject: [PATCH 09/13] handle builtin types; insert type for nodes from Generator --- src/MapleFE/astopt/src/ast_info.cpp | 20 ++++++++++++++++++-- src/MapleFE/astopt/src/ast_ti.cpp | 24 +++++++++++++++++------- 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/src/MapleFE/astopt/src/ast_info.cpp b/src/MapleFE/astopt/src/ast_info.cpp index 5a2cc989f4..56759e0851 100644 --- a/src/MapleFE/astopt/src/ast_info.cpp +++ b/src/MapleFE/astopt/src/ast_info.cpp @@ -422,8 +422,10 @@ IdentifierNode *AST_INFO::CreateIdentifierNode(unsigned stridx) { } UserTypeNode *AST_INFO::CreateUserTypeNode(unsigned stridx, ASTScope *scope) { + unsigned tidx = GetBuiltInTypeIdx(stridx); IdentifierNode *node = CreateIdentifierNode(stridx); SetTypeId(node, TY_Class); + SetTypeIdx(node, tidx); if (scope) { node->SetScope(scope); } @@ -432,6 +434,7 @@ UserTypeNode *AST_INFO::CreateUserTypeNode(unsigned stridx, ASTScope *scope) { utype->SetId(node); utype->SetStrIdx(stridx); SetTypeId(utype, TY_Class); + SetTypeIdx(utype, tidx); node->SetParent(utype); return utype; } @@ -666,6 +669,11 @@ FunctionNode *FillNodeInfoVisitor::VisitFunctionNode(FunctionNode *node) { if (type) { mInfo->SetTypeId(node, type->GetTypeId()); mInfo->SetTypeIdx(node, type->GetTypeIdx()); + } else if (node->IsGenerator()) { + unsigned stridx = gStringPool.GetStrIdx("Generator"); + unsigned tidx = mInfo->GetBuiltInTypeIdx(stridx); + UserTypeNode *ut = mInfo->CreateUserTypeNode(stridx); + node->SetType(ut); } return node; } @@ -728,8 +736,16 @@ PrimTypeNode *FillNodeInfoVisitor::VisitPrimTypeNode(PrimTypeNode *node) { UserTypeNode *FillNodeInfoVisitor::VisitUserTypeNode(UserTypeNode *node) { (void) AstVisitor::VisitUserTypeNode(node); TreeNode *id = node->GetId(); - if (id && !id->IsTypeIdNone()) { - mInfo->SetTypeId(node, id->GetTypeId()); + if (id) { + unsigned tidx = mInfo->GetBuiltInTypeIdx(id); + if (tidx) { + mInfo->SetTypeId(id, TY_Class); + mInfo->SetTypeIdx(id, tidx); + } + if (!id->IsTypeIdNone()) { + mInfo->SetTypeId(node, id->GetTypeId()); + mInfo->SetTypeIdx(node, id->GetTypeIdx()); + } } return node; } diff --git a/src/MapleFE/astopt/src/ast_ti.cpp b/src/MapleFE/astopt/src/ast_ti.cpp index 80983f1b38..890c5fd1d9 100644 --- a/src/MapleFE/astopt/src/ast_ti.cpp +++ b/src/MapleFE/astopt/src/ast_ti.cpp @@ -134,7 +134,7 @@ FieldLiteralNode *BuildIdDirectFieldVisitor::VisitFieldLiteralNode(FieldLiteralN IdentifierNode *field = static_cast(name); TreeNode *decl = mHandler->FindDecl(field); TreeNode *vtype = GetParentVarClass(decl); - if (vtype) { + if (vtype && !mHandler->GetINFO()->IsBuiltInType(vtype)) { // check if decl is a field of vtype // note: vtype could be in different module Module_Handler *h = mHandler->GetModuleHandler(vtype); @@ -1274,6 +1274,12 @@ DeclNode *TypeInferVisitor::VisitDeclNode(DeclNode *node) { if (var) { // normal cases if(var->IsIdentifier()) { + IdentifierNode *idvar = static_cast(var); + if (isFromGenerator) { + unsigned stridx = gStringPool.GetStrIdx("Generator"); + UserTypeNode *ut = mInfo->CreateUserTypeNode(stridx, var->GetScope()); + idvar->SetType(ut); + } merged = MergeTypeId(merged, var->GetTypeId()); mergedtidx = MergeTypeIdx(mergedtidx, var->GetTypeIdx()); bool isFunc = UpdateVarTypeWithInit(var, init); @@ -1559,8 +1565,10 @@ IdentifierNode *TypeInferVisitor::VisitIdentifierNode(IdentifierNode *node) { TreeNode *uptype = gTypeTable.GetTypeFromTypeIdx(upper->GetTypeIdx()); if (uptype) { scope = uptype->GetScope(); - node->SetScope(scope); - decl = mHandler->FindDecl(node, true); + if (scope) { + node->SetScope(scope); + decl = mHandler->FindDecl(node, true); + } } } else { NOTYETIMPL("node not in field"); @@ -1721,10 +1729,12 @@ ReturnNode *TypeInferVisitor::VisitReturnNode(ReturnNode *node) { type->SetPrimType(TY_None); func->SetType(type); } - UpdateFuncRetTypeId(func, node->GetTypeId(), node->GetTypeIdx()); - if (res) { - // use res to update function's return type - UpdateTypeUseNode(func->GetType(), res); + if (!func->IsGenerator() && !func->IsIterator()) { + UpdateFuncRetTypeId(func, node->GetTypeId(), node->GetTypeIdx()); + if (res) { + // use res to update function's return type + UpdateTypeUseNode(func->GetType(), res); + } } } return node; -- Gitee From bcae99f860f8459f93cd78c22b9978cae2717f4c Mon Sep 17 00:00:00 2001 From: Wen HU Date: Fri, 18 Feb 2022 16:18:56 -0500 Subject: [PATCH 10/13] keep original type even for what from generator --- src/MapleFE/astopt/src/ast_ti.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MapleFE/astopt/src/ast_ti.cpp b/src/MapleFE/astopt/src/ast_ti.cpp index 890c5fd1d9..02da3097fa 100644 --- a/src/MapleFE/astopt/src/ast_ti.cpp +++ b/src/MapleFE/astopt/src/ast_ti.cpp @@ -1275,7 +1275,7 @@ DeclNode *TypeInferVisitor::VisitDeclNode(DeclNode *node) { // normal cases if(var->IsIdentifier()) { IdentifierNode *idvar = static_cast(var); - if (isFromGenerator) { + if (isFromGenerator && !idvar->GetType()) { unsigned stridx = gStringPool.GetStrIdx("Generator"); UserTypeNode *ut = mInfo->CreateUserTypeNode(stridx, var->GetScope()); idvar->SetType(ut); -- Gitee From 146feddc21825b9c5b4a7de61d9ac99c74e0c5e8 Mon Sep 17 00:00:00 2001 From: eching Date: Fri, 18 Feb 2022 15:08:12 -0800 Subject: [PATCH 11/13] Added common interface to collect, store and retrive function arguments in interanl function table. Migrate related code to use the interface. --- src/MapleFE/ast2cpp/include/cpp_declaration.h | 3 ++- src/MapleFE/ast2cpp/include/helper.h | 14 +++++++++++++- src/MapleFE/ast2cpp/src/cpp_declaration.cpp | 17 +++++++++-------- src/MapleFE/ast2cpp/src/helper.cpp | 2 +- 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/MapleFE/ast2cpp/include/cpp_declaration.h b/src/MapleFE/ast2cpp/include/cpp_declaration.h index 60c89f45b8..2e8007fb97 100644 --- a/src/MapleFE/ast2cpp/include/cpp_declaration.h +++ b/src/MapleFE/ast2cpp/include/cpp_declaration.h @@ -37,7 +37,6 @@ public: } std::string GenFunctionClass(FunctionNode* node); - std::string GenGeneratorClass(FunctionNode* node); void AddImportedModule(const std::string& module); bool IsImportedModule(const std::string& module); @@ -77,6 +76,8 @@ public: std::string EmitArrayLiteral(ArrayLiteralNode *node, int dim, std::string type); std::string EmitTSEnum(StructNode *node); std::string EmitInterface(StructNode *node); + + void CollectFuncArgInfo(TreeNode* node); }; inline bool IsVarInitStructLiteral(DeclNode* node) { diff --git a/src/MapleFE/ast2cpp/include/helper.h b/src/MapleFE/ast2cpp/include/helper.h index 0949edd54b..3d5bd76cdc 100644 --- a/src/MapleFE/ast2cpp/include/helper.h +++ b/src/MapleFE/ast2cpp/include/helper.h @@ -35,7 +35,7 @@ extern std::unordered_mapTypeIdToJSTypeCXX; extern TypeId hlpGetTypeId(TreeNode* node); extern std::string GenClassFldAddProp(std::string, std::string, std::string, std::string, std::string); extern std::string FunctionTemplate(std::string retType, std::string funcName, std::string params, std::string args); -extern std::string GeneratorTemplate(std::string funcName, std::vector>&args); +extern std::string GenGeneratorClass(std::string funcName, std::vector>args); extern std::string tab(int n); extern bool IsClassMethod(TreeNode* node); extern std::string GetClassOfAssignedFunc(TreeNode* node); @@ -54,6 +54,9 @@ private: std::set ImportedFields; std::set StaticMembers; + // map of FunctionNode node id to vector of function arg info (pair of arg type and name) + std::unordered_map>> args; + public: FuncTable() {} ~FuncTable() {} @@ -96,6 +99,15 @@ public: bool IsStaticMember(std::string& field) { return(StaticMembers.find(field) != StaticMembers.end()); } + + // Function arg info + void AddArgInfo(unsigned nodeId, std::string type, std::string name) { + args[nodeId].push_back(std::pair(type, name)); + } + std::vector> GetArgInfo(unsigned nodeId) { + return args[nodeId]; + } + }; extern FuncTable hFuncTable; diff --git a/src/MapleFE/ast2cpp/src/cpp_declaration.cpp b/src/MapleFE/ast2cpp/src/cpp_declaration.cpp index a2653fe1ff..3e20bc7e6c 100644 --- a/src/MapleFE/ast2cpp/src/cpp_declaration.cpp +++ b/src/MapleFE/ast2cpp/src/cpp_declaration.cpp @@ -349,20 +349,20 @@ std::string CppDecl::GenFunctionClass(FunctionNode* node) { return FunctionTemplate(GetTypeString(node->GetType(), nullptr), GetIdentifierName(node), params, args); } -std::string CppDecl::GenGeneratorClass(FunctionNode* node) { - std::string captureVars, callOpArgs, funcArgs, params; +void CppDecl::CollectFuncArgInfo(TreeNode* node) { + if (!node->IsFunction()) + return; - std::vector> args; - for (unsigned i = 0; i < node->GetParamsNum(); ++i) { - if (auto n = node->GetParam(i)) { + FunctionNode* func = static_cast(node); + for (unsigned i = 0; i < func->GetParamsNum(); ++i) { + if (auto n = func->GetParam(i)) { // build vector of string pairs of argument types and names std::string name = GetIdentifierName(n); std::string type = GetTypeString(n, n->IsIdentifier()? static_cast(n)->GetType(): nullptr); type.erase(type.find_last_not_of(' ')+1); // strip trailing spaces - args.push_back(std::pair(type, name)); + hFuncTable.AddArgInfo(func->GetNodeId(), type, name); } } - return GeneratorTemplate(GetIdentifierName(node), args); } std::string CppDecl::EmitModuleNode(ModuleNode *node) { @@ -405,11 +405,12 @@ namespace )""" + module + R"""( { TreeNode *node = func->GetFuncNode(); if (!IsClassMethod(node)) { bool isGenerator = static_cast(node)->IsGenerator(); + CollectFuncArgInfo(node); std::string ns = GetNamespace(node); if (!ns.empty()) str += "namespace "s + ns + " {\n"s; if (isGenerator) - str += GenGeneratorClass(static_cast(node)); // gen generator and generator funcs + str += GenGeneratorClass(GetIdentifierName(node), hFuncTable.GetArgInfo(node->GetNodeId())); else str += GenFunctionClass(static_cast(node)); // gen func cls for each top level func if (!mHandler->IsFromLambda(node)) { diff --git a/src/MapleFE/ast2cpp/src/helper.cpp b/src/MapleFE/ast2cpp/src/helper.cpp index 643f5910c4..9dada4ac7c 100644 --- a/src/MapleFE/ast2cpp/src/helper.cpp +++ b/src/MapleFE/ast2cpp/src/helper.cpp @@ -149,7 +149,7 @@ class )""" + clsName + R"""( : public t2crt::Function { // Template for generating Generators and Generator Functions: // For each TS generator function, 2 C++ classes: generator and generator function are emitted. // The generator function has only a single instance. It is called to create generator instances. -std::string GeneratorTemplate(std::string funcName, std::vector>& args) { +std::string GenGeneratorClass(std::string funcName, std::vector> args) { std::string str; std::string generatorName = GeneratorName(funcName); std::string generatorFuncName = GeneratorFuncName(funcName); -- Gitee From be954cdb896926cb993189483f60f1e0b265bdf0 Mon Sep 17 00:00:00 2001 From: Wen HU Date: Sat, 19 Feb 2022 17:54:51 -0500 Subject: [PATCH 12/13] add dummy lang_builtin.def for c and java --- src/MapleFE/c/include/lang_builtin.def | 14 ++++++++++++++ src/MapleFE/java/include/lang_builtin.def | 14 ++++++++++++++ src/MapleFE/typescript/include/lang_builtin.def | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/MapleFE/c/include/lang_builtin.def create mode 100644 src/MapleFE/java/include/lang_builtin.def diff --git a/src/MapleFE/c/include/lang_builtin.def b/src/MapleFE/c/include/lang_builtin.def new file mode 100644 index 0000000000..8c127c72a4 --- /dev/null +++ b/src/MapleFE/c/include/lang_builtin.def @@ -0,0 +1,14 @@ +// Copyright (C) [2022] Futurewei Technologies, Inc. All rights reverved. +// +// OpenArkFE is licensed under the Mulan PSL v2. +// You can use this software according to the terms and conditions of the Mulan PSL v2. +// You may obtain a copy of Mulan PSL v2 at: +// +// http://license.coscl.org.cn/MulanPSL2 +// +// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR +// FIT FOR A PARTICULAR PURPOSE. +// See the Mulan PSL v2 for more details. +// + diff --git a/src/MapleFE/java/include/lang_builtin.def b/src/MapleFE/java/include/lang_builtin.def new file mode 100644 index 0000000000..8c127c72a4 --- /dev/null +++ b/src/MapleFE/java/include/lang_builtin.def @@ -0,0 +1,14 @@ +// Copyright (C) [2022] Futurewei Technologies, Inc. All rights reverved. +// +// OpenArkFE is licensed under the Mulan PSL v2. +// You can use this software according to the terms and conditions of the Mulan PSL v2. +// You may obtain a copy of Mulan PSL v2 at: +// +// http://license.coscl.org.cn/MulanPSL2 +// +// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR +// FIT FOR A PARTICULAR PURPOSE. +// See the Mulan PSL v2 for more details. +// + diff --git a/src/MapleFE/typescript/include/lang_builtin.def b/src/MapleFE/typescript/include/lang_builtin.def index f6be7fb416..3b529b2cbb 100644 --- a/src/MapleFE/typescript/include/lang_builtin.def +++ b/src/MapleFE/typescript/include/lang_builtin.def @@ -1,4 +1,4 @@ -// Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. +// Copyright (C) [2022] Futurewei Technologies, Inc. All rights reverved. // // OpenArkFE is licensed under the Mulan PSL v2. // You can use this software according to the terms and conditions of the Mulan PSL v2. -- Gitee From eb5ac7ce007764aa4de0619cddb207d3ab3b10e5 Mon Sep 17 00:00:00 2001 From: Wen HU Date: Sat, 19 Feb 2022 18:09:31 -0500 Subject: [PATCH 13/13] update license year --- src/MapleFE/ast2cpp/include/cpp_declaration.h | 2 +- src/MapleFE/ast2cpp/include/cpp_definition.h | 2 +- src/MapleFE/ast2cpp/include/cpp_emitter.h | 2 +- src/MapleFE/ast2cpp/include/emitter.h | 2 +- src/MapleFE/ast2cpp/include/helper.h | 2 +- src/MapleFE/ast2cpp/runtime/include/builtins.h | 2 +- src/MapleFE/ast2cpp/runtime/include/ts2cpp.h | 2 +- src/MapleFE/ast2cpp/src/a2c_util.cpp | 2 +- src/MapleFE/ast2cpp/src/cpp_declaration.cpp | 2 +- src/MapleFE/ast2cpp/src/cpp_definition.cpp | 2 +- src/MapleFE/ast2cpp/src/cpp_emitter.cpp | 2 +- src/MapleFE/ast2cpp/src/emitter.cpp | 2 +- src/MapleFE/ast2cpp/src/helper.cpp | 2 +- src/MapleFE/astopt/include/ast_adj.h | 2 +- src/MapleFE/astopt/include/ast_handler.h | 2 +- src/MapleFE/astopt/include/ast_info.h | 2 +- src/MapleFE/astopt/include/ast_scp.h | 2 +- src/MapleFE/astopt/include/ast_ti.h | 2 +- src/MapleFE/astopt/src/ast_adj.cpp | 2 +- src/MapleFE/astopt/src/ast_handler.cpp | 2 +- src/MapleFE/astopt/src/ast_info.cpp | 2 +- src/MapleFE/astopt/src/ast_scp.cpp | 2 +- src/MapleFE/astopt/src/ast_ti.cpp | 2 +- src/MapleFE/astopt/src/ast_xxport.cpp | 2 +- src/MapleFE/shared/include/ast.h | 2 +- src/MapleFE/shared/include/ast_module.h | 2 +- src/MapleFE/shared/include/ast_nk.def | 2 +- src/MapleFE/shared/include/ast_type.h | 2 +- src/MapleFE/shared/include/lexer.h | 2 +- src/MapleFE/shared/include/parser.h | 2 +- src/MapleFE/shared/include/ruletable.h | 2 +- src/MapleFE/shared/include/stringpool.h | 2 +- src/MapleFE/shared/include/supported_types.def | 2 +- src/MapleFE/shared/include/token.h | 2 +- src/MapleFE/shared/include/typetable.h | 2 +- src/MapleFE/shared/src/ast_module.cpp | 2 +- src/MapleFE/shared/src/ast_scope.cpp | 2 +- src/MapleFE/shared/src/ast_type.cpp | 2 +- src/MapleFE/shared/src/lexer.cpp | 2 +- src/MapleFE/shared/src/parser.cpp | 2 +- src/MapleFE/shared/src/stringpool.cpp | 2 +- src/MapleFE/shared/src/token.cpp | 2 +- src/MapleFE/shared/src/typetable.cpp | 2 +- src/MapleFE/shared/src/vfy.cpp | 2 +- 44 files changed, 44 insertions(+), 44 deletions(-) diff --git a/src/MapleFE/ast2cpp/include/cpp_declaration.h b/src/MapleFE/ast2cpp/include/cpp_declaration.h index 2e8007fb97..fcf6b61c32 100644 --- a/src/MapleFE/ast2cpp/include/cpp_declaration.h +++ b/src/MapleFE/ast2cpp/include/cpp_declaration.h @@ -1,5 +1,5 @@ /* - * Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. + * Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/ast2cpp/include/cpp_definition.h b/src/MapleFE/ast2cpp/include/cpp_definition.h index f4721648df..07dfec249e 100644 --- a/src/MapleFE/ast2cpp/include/cpp_definition.h +++ b/src/MapleFE/ast2cpp/include/cpp_definition.h @@ -1,5 +1,5 @@ /* - * Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. + * Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/ast2cpp/include/cpp_emitter.h b/src/MapleFE/ast2cpp/include/cpp_emitter.h index 601d341cd8..74d81734fd 100644 --- a/src/MapleFE/ast2cpp/include/cpp_emitter.h +++ b/src/MapleFE/ast2cpp/include/cpp_emitter.h @@ -1,5 +1,5 @@ /* - * Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. + * Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/ast2cpp/include/emitter.h b/src/MapleFE/ast2cpp/include/emitter.h index 99046a8705..7ad2b1e895 100644 --- a/src/MapleFE/ast2cpp/include/emitter.h +++ b/src/MapleFE/ast2cpp/include/emitter.h @@ -1,5 +1,5 @@ /* - * Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. + * Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/ast2cpp/include/helper.h b/src/MapleFE/ast2cpp/include/helper.h index 3d5bd76cdc..297d57f407 100644 --- a/src/MapleFE/ast2cpp/include/helper.h +++ b/src/MapleFE/ast2cpp/include/helper.h @@ -1,5 +1,5 @@ /* -* Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/ast2cpp/runtime/include/builtins.h b/src/MapleFE/ast2cpp/runtime/include/builtins.h index 8f25d93c64..8acac0e030 100644 --- a/src/MapleFE/ast2cpp/runtime/include/builtins.h +++ b/src/MapleFE/ast2cpp/runtime/include/builtins.h @@ -1,5 +1,5 @@ /* - * Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. + * Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/ast2cpp/runtime/include/ts2cpp.h b/src/MapleFE/ast2cpp/runtime/include/ts2cpp.h index 5318a3c22f..c94ea6fd2d 100644 --- a/src/MapleFE/ast2cpp/runtime/include/ts2cpp.h +++ b/src/MapleFE/ast2cpp/runtime/include/ts2cpp.h @@ -1,5 +1,5 @@ /* - * Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. + * Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/ast2cpp/src/a2c_util.cpp b/src/MapleFE/ast2cpp/src/a2c_util.cpp index 4b272e6859..f9bb62cadc 100644 --- a/src/MapleFE/ast2cpp/src/a2c_util.cpp +++ b/src/MapleFE/ast2cpp/src/a2c_util.cpp @@ -1,5 +1,5 @@ /* -* Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/ast2cpp/src/cpp_declaration.cpp b/src/MapleFE/ast2cpp/src/cpp_declaration.cpp index 3e20bc7e6c..96a1e654b0 100644 --- a/src/MapleFE/ast2cpp/src/cpp_declaration.cpp +++ b/src/MapleFE/ast2cpp/src/cpp_declaration.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. + * Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/ast2cpp/src/cpp_definition.cpp b/src/MapleFE/ast2cpp/src/cpp_definition.cpp index f8d5691caf..6ac4cfd415 100644 --- a/src/MapleFE/ast2cpp/src/cpp_definition.cpp +++ b/src/MapleFE/ast2cpp/src/cpp_definition.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. + * Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/ast2cpp/src/cpp_emitter.cpp b/src/MapleFE/ast2cpp/src/cpp_emitter.cpp index ba77a9c75c..ab730ccb84 100644 --- a/src/MapleFE/ast2cpp/src/cpp_emitter.cpp +++ b/src/MapleFE/ast2cpp/src/cpp_emitter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. + * Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/ast2cpp/src/emitter.cpp b/src/MapleFE/ast2cpp/src/emitter.cpp index 5de29d991d..e4926858fa 100644 --- a/src/MapleFE/ast2cpp/src/emitter.cpp +++ b/src/MapleFE/ast2cpp/src/emitter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. + * Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/ast2cpp/src/helper.cpp b/src/MapleFE/ast2cpp/src/helper.cpp index 9dada4ac7c..5ee7e1b5f9 100644 --- a/src/MapleFE/ast2cpp/src/helper.cpp +++ b/src/MapleFE/ast2cpp/src/helper.cpp @@ -1,5 +1,5 @@ /* -* Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/astopt/include/ast_adj.h b/src/MapleFE/astopt/include/ast_adj.h index 5674e6678d..36675d91eb 100644 --- a/src/MapleFE/astopt/include/ast_adj.h +++ b/src/MapleFE/astopt/include/ast_adj.h @@ -1,5 +1,5 @@ /* -* Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/astopt/include/ast_handler.h b/src/MapleFE/astopt/include/ast_handler.h index 0f4b46c1b2..42153f013f 100644 --- a/src/MapleFE/astopt/include/ast_handler.h +++ b/src/MapleFE/astopt/include/ast_handler.h @@ -1,5 +1,5 @@ /* -* Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/astopt/include/ast_info.h b/src/MapleFE/astopt/include/ast_info.h index 038834aa1e..4753f50dac 100644 --- a/src/MapleFE/astopt/include/ast_info.h +++ b/src/MapleFE/astopt/include/ast_info.h @@ -1,5 +1,5 @@ /* -* Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/astopt/include/ast_scp.h b/src/MapleFE/astopt/include/ast_scp.h index ba864fdd57..fd2dcb485d 100644 --- a/src/MapleFE/astopt/include/ast_scp.h +++ b/src/MapleFE/astopt/include/ast_scp.h @@ -1,5 +1,5 @@ /* -* Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/astopt/include/ast_ti.h b/src/MapleFE/astopt/include/ast_ti.h index a569b4d7a4..ece38d68dc 100644 --- a/src/MapleFE/astopt/include/ast_ti.h +++ b/src/MapleFE/astopt/include/ast_ti.h @@ -1,5 +1,5 @@ /* -* Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/astopt/src/ast_adj.cpp b/src/MapleFE/astopt/src/ast_adj.cpp index 3a36e80d0f..d7015ef214 100644 --- a/src/MapleFE/astopt/src/ast_adj.cpp +++ b/src/MapleFE/astopt/src/ast_adj.cpp @@ -1,5 +1,5 @@ /* -* Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/astopt/src/ast_handler.cpp b/src/MapleFE/astopt/src/ast_handler.cpp index 38d6cdaa89..d08f741507 100644 --- a/src/MapleFE/astopt/src/ast_handler.cpp +++ b/src/MapleFE/astopt/src/ast_handler.cpp @@ -1,5 +1,5 @@ /* -* Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/astopt/src/ast_info.cpp b/src/MapleFE/astopt/src/ast_info.cpp index 56759e0851..e841e0d65a 100644 --- a/src/MapleFE/astopt/src/ast_info.cpp +++ b/src/MapleFE/astopt/src/ast_info.cpp @@ -1,5 +1,5 @@ /* -* Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/astopt/src/ast_scp.cpp b/src/MapleFE/astopt/src/ast_scp.cpp index a1473f8a74..9179704ab7 100644 --- a/src/MapleFE/astopt/src/ast_scp.cpp +++ b/src/MapleFE/astopt/src/ast_scp.cpp @@ -1,5 +1,5 @@ /* -* Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/astopt/src/ast_ti.cpp b/src/MapleFE/astopt/src/ast_ti.cpp index 02da3097fa..22706289ed 100644 --- a/src/MapleFE/astopt/src/ast_ti.cpp +++ b/src/MapleFE/astopt/src/ast_ti.cpp @@ -1,5 +1,5 @@ /* -* Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/astopt/src/ast_xxport.cpp b/src/MapleFE/astopt/src/ast_xxport.cpp index 43e28d1173..3b828851ba 100644 --- a/src/MapleFE/astopt/src/ast_xxport.cpp +++ b/src/MapleFE/astopt/src/ast_xxport.cpp @@ -1,5 +1,5 @@ /* -* Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/shared/include/ast.h b/src/MapleFE/shared/include/ast.h index 6c3dd0640c..58d327ce4f 100644 --- a/src/MapleFE/shared/include/ast.h +++ b/src/MapleFE/shared/include/ast.h @@ -1,5 +1,5 @@ /* -* Copyright (C) [2020] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2020-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/shared/include/ast_module.h b/src/MapleFE/shared/include/ast_module.h index adc2467ed3..58e6b19e1a 100644 --- a/src/MapleFE/shared/include/ast_module.h +++ b/src/MapleFE/shared/include/ast_module.h @@ -1,5 +1,5 @@ /* -* Copyright (C) [2020] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2020-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/shared/include/ast_nk.def b/src/MapleFE/shared/include/ast_nk.def index 57c1e2b351..df99869326 100644 --- a/src/MapleFE/shared/include/ast_nk.def +++ b/src/MapleFE/shared/include/ast_nk.def @@ -1,5 +1,5 @@ /* -* Copyright (C) [2020] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2020-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/shared/include/ast_type.h b/src/MapleFE/shared/include/ast_type.h index 89254ee240..d120eafa87 100644 --- a/src/MapleFE/shared/include/ast_type.h +++ b/src/MapleFE/shared/include/ast_type.h @@ -1,5 +1,5 @@ /* -* Copyright (C) [2020] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2020-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/shared/include/lexer.h b/src/MapleFE/shared/include/lexer.h index 380d8ed41b..151f55b258 100644 --- a/src/MapleFE/shared/include/lexer.h +++ b/src/MapleFE/shared/include/lexer.h @@ -1,5 +1,5 @@ /* -* Copyright (C) [2020] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2020-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/shared/include/parser.h b/src/MapleFE/shared/include/parser.h index 2e35ad570c..a747c23656 100644 --- a/src/MapleFE/shared/include/parser.h +++ b/src/MapleFE/shared/include/parser.h @@ -1,5 +1,5 @@ /* -* Copyright (C) [2020] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2020-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/shared/include/ruletable.h b/src/MapleFE/shared/include/ruletable.h index f9d7d20c4e..2464e7c6ea 100644 --- a/src/MapleFE/shared/include/ruletable.h +++ b/src/MapleFE/shared/include/ruletable.h @@ -1,5 +1,5 @@ /* -* Copyright (C) [2020] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2020-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/shared/include/stringpool.h b/src/MapleFE/shared/include/stringpool.h index 3330a7f832..259e33e620 100644 --- a/src/MapleFE/shared/include/stringpool.h +++ b/src/MapleFE/shared/include/stringpool.h @@ -1,5 +1,5 @@ /* -* Copyright (C) [2020] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2020-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/shared/include/supported_types.def b/src/MapleFE/shared/include/supported_types.def index b2f6159eb8..c16bd4a934 100644 --- a/src/MapleFE/shared/include/supported_types.def +++ b/src/MapleFE/shared/include/supported_types.def @@ -1,5 +1,5 @@ /* -* Copyright (C) [2020] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2020-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/shared/include/token.h b/src/MapleFE/shared/include/token.h index d9132cc681..f2406ee14e 100644 --- a/src/MapleFE/shared/include/token.h +++ b/src/MapleFE/shared/include/token.h @@ -1,5 +1,5 @@ /* -* Copyright (C) [2020] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2020-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/shared/include/typetable.h b/src/MapleFE/shared/include/typetable.h index fa63b65482..2817fadd4e 100644 --- a/src/MapleFE/shared/include/typetable.h +++ b/src/MapleFE/shared/include/typetable.h @@ -1,5 +1,5 @@ /* -* Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/shared/src/ast_module.cpp b/src/MapleFE/shared/src/ast_module.cpp index 0d4c7e830a..9cab6e95aa 100644 --- a/src/MapleFE/shared/src/ast_module.cpp +++ b/src/MapleFE/shared/src/ast_module.cpp @@ -1,5 +1,5 @@ /* -* Copyright (C) [2020] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2020-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/shared/src/ast_scope.cpp b/src/MapleFE/shared/src/ast_scope.cpp index fc907786e9..7441ddac5e 100644 --- a/src/MapleFE/shared/src/ast_scope.cpp +++ b/src/MapleFE/shared/src/ast_scope.cpp @@ -1,5 +1,5 @@ /* -* Copyright (C) [2020] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2020-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/shared/src/ast_type.cpp b/src/MapleFE/shared/src/ast_type.cpp index 3a4d377468..48744a1850 100644 --- a/src/MapleFE/shared/src/ast_type.cpp +++ b/src/MapleFE/shared/src/ast_type.cpp @@ -1,5 +1,5 @@ /* -* Copyright (C) [2020] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2020-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/shared/src/lexer.cpp b/src/MapleFE/shared/src/lexer.cpp index 89460e331b..ccd8a5a255 100644 --- a/src/MapleFE/shared/src/lexer.cpp +++ b/src/MapleFE/shared/src/lexer.cpp @@ -1,5 +1,5 @@ /* -* Copyright (C) [2020] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2020-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/shared/src/parser.cpp b/src/MapleFE/shared/src/parser.cpp index a4736a6b93..12e8d953dc 100644 --- a/src/MapleFE/shared/src/parser.cpp +++ b/src/MapleFE/shared/src/parser.cpp @@ -1,5 +1,5 @@ /* -* Copyright (C) [2020] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2020-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/shared/src/stringpool.cpp b/src/MapleFE/shared/src/stringpool.cpp index 243f06273c..1c96f4553e 100644 --- a/src/MapleFE/shared/src/stringpool.cpp +++ b/src/MapleFE/shared/src/stringpool.cpp @@ -1,5 +1,5 @@ /* -* Copyright (C) [2020] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2020-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/shared/src/token.cpp b/src/MapleFE/shared/src/token.cpp index 2155b33687..39b20a15fe 100644 --- a/src/MapleFE/shared/src/token.cpp +++ b/src/MapleFE/shared/src/token.cpp @@ -1,5 +1,5 @@ /* -* Copyright (C) [2020] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2020-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/shared/src/typetable.cpp b/src/MapleFE/shared/src/typetable.cpp index 2164723bca..ad58543fd8 100644 --- a/src/MapleFE/shared/src/typetable.cpp +++ b/src/MapleFE/shared/src/typetable.cpp @@ -1,5 +1,5 @@ /* -* Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/MapleFE/shared/src/vfy.cpp b/src/MapleFE/shared/src/vfy.cpp index 4f771a5a7d..cb03fb5439 100644 --- a/src/MapleFE/shared/src/vfy.cpp +++ b/src/MapleFE/shared/src/vfy.cpp @@ -1,5 +1,5 @@ /* -* Copyright (C) [2020] Futurewei Technologies, Inc. All rights reverved. +* Copyright (C) [2020-2022] Futurewei Technologies, Inc. All rights reverved. * * OpenArkFE is licensed under the Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. -- Gitee