@@ -57,9 +57,9 @@ namespace pl::core::ast {
5757 [[maybe_unused]] auto context = evaluator->updateRuntime (this );
5858 auto evaluatedTemplateArguments = this ->evaluateTemplateArguments (evaluator);
5959 auto evaluatedType = std::make_unique<ASTNodeTypeApplication>(this ->m_type );
60- if (this ->m_type == nullptr ) {
60+ if (this ->m_type == nullptr ) {
6161 auto & templateTypeParameters = evaluator->getTypeTemplateParameters ();
62- if (this ->m_templateParameterIndex >= templateTypeParameters.size ()) {
62+ if (this ->m_templateParameterIndex >= templateTypeParameters.size ()) {
6363 err::E0004 .throwError (" Template parameter index out of bounds." , {}, this ->getLocation ());
6464 } else {
6565 evaluatedType->m_type = templateTypeParameters[this ->m_templateParameterIndex ];
@@ -78,14 +78,14 @@ namespace pl::core::ast {
7878 void ASTNodeTypeApplication::createPatterns (Evaluator *evaluator, std::vector<std::shared_ptr<ptrn::Pattern>> &resultPatterns) const {
7979 [[maybe_unused]] auto context = evaluator->updateRuntime (this );
8080 auto actualType = this ->m_type ;
81- if (actualType == nullptr ) {
81+ if (actualType == nullptr ) {
8282 auto & templateTypeParameters = evaluator->getTypeTemplateParameters ();
83- if (this ->m_templateParameterIndex >= templateTypeParameters.size ()) {
83+ if (this ->m_templateParameterIndex >= templateTypeParameters.size ()) {
8484 err::E0004 .throwError (" Template parameter index out of bounds." , {}, this ->getLocation ());
8585 }
8686 actualType = templateTypeParameters[this ->m_templateParameterIndex ];
8787
88- if (actualType.get () == this ) {
88+ if (actualType.get () == this ) {
8989 err::E0004 .throwError (" Recursive type definition detected." , {}, this ->getLocation ());
9090 }
9191 }
@@ -101,9 +101,9 @@ namespace pl::core::ast {
101101 for (auto & pattern : resultPatterns) {
102102 if (!pattern->hasOverriddenEndian ())
103103 pattern->setEndian (evaluator->getDefaultEndian ());
104- if (auto typeDecl = dynamic_cast <ASTNodeTypeDecl*>(actualType.get ()); typeDecl != nullptr ) {
104+ if (auto typeDecl = dynamic_cast <ASTNodeTypeDecl*>(actualType.get ()); typeDecl != nullptr ) {
105105 if (!typeDecl->getName ().empty ()) {
106- if (this ->m_templateArguments .empty ()) {
106+ if (this ->m_templateArguments .empty ()) {
107107 pattern->setTypeName (typeDecl->getName ());
108108 } else {
109109 pattern->setTypeName (fmt::format (" {}<{}>" , typeDecl->getName (), templateTypeString));
@@ -114,13 +114,13 @@ namespace pl::core::ast {
114114 }
115115
116116 const ast::ASTNode* ASTNodeTypeApplication::getTypeDefinition (Evaluator *evaluator) const {
117- if (this ->m_type == nullptr ) {
117+ if (this ->m_type == nullptr ) {
118118 auto & templateTypeParameters = evaluator->getTypeTemplateParameters ();
119- if (this ->m_templateParameterIndex >= templateTypeParameters.size ()) {
119+ if (this ->m_templateParameterIndex >= templateTypeParameters.size ()) {
120120 err::E0004 .throwError (" Template parameter index out of bounds." , {}, this ->getLocation ());
121121 }
122122 auto type = templateTypeParameters[this ->m_templateParameterIndex ].get ();
123- if (auto typeApp = dynamic_cast <ASTNodeTypeApplication*>(type); typeApp != nullptr ) {
123+ if (auto typeApp = dynamic_cast <ASTNodeTypeApplication*>(type); typeApp != nullptr ) {
124124 return typeApp->getTypeDefinition (evaluator);
125125 }
126126 }
@@ -138,7 +138,7 @@ namespace pl::core::ast {
138138 [[nodiscard]] const std::string ASTNodeTypeApplication::getTypeName () const {
139139 if (auto typeDecl = dynamic_cast <const ASTNodeTypeDecl*>(this ->m_type .get ()); typeDecl != nullptr ) {
140140 std::string typeName = typeDecl->getName ();
141- if (this ->m_templateArguments .empty ()) {
141+ if (this ->m_templateArguments .empty ()) {
142142 return typeName;
143143 } else {
144144 return fmt::format (" {}<{}>" , typeName, computeTemplateTypeString (this ->m_templateArguments ));
0 commit comments