Changeset View
Changeset View
Standalone View
Standalone View
duchain/builders/declarationbuilder.h
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Line(s) | 36 | public: | |||
---|---|---|---|---|---|
60 | * this handles variable declaration in select statements, e.g. | 60 | * this handles variable declaration in select statements, e.g. | ||
61 | * select { case i := <-mychan: bla bla... } | 61 | * select { case i := <-mychan: bla bla... } | ||
62 | * NOTE: right hand side expression must be a receive operator, returning two values */ | 62 | * NOTE: right hand side expression must be a receive operator, returning two values */ | ||
63 | virtual void visitCommCase(go::CommCaseAst* node); | 63 | virtual void visitCommCase(go::CommCaseAst* node); | ||
64 | virtual void visitCommClause(go::CommClauseAst* node); | 64 | virtual void visitCommClause(go::CommClauseAst* node); | ||
65 | 65 | | |||
66 | virtual void visitTypeDecl(go::TypeDeclAst* node); | 66 | virtual void visitTypeDecl(go::TypeDeclAst* node); | ||
67 | 67 | | |||
68 | /** | ||||
69 | * A shortcut for ExpressionVisitor to build function type | ||||
70 | **/ | ||||
71 | go::GoFunctionDeclaration* buildFunction(go::SignatureAst* node, go::BlockAst* block = nullptr, go::IdentifierAst* name = nullptr, const QByteArray& comment = {}); | ||||
mwolff: nitpicks here and below: please try to follow our coding style and add spaces around operators… | |||||
68 | 72 | | |||
69 | /*struct GoImport{ | 73 | /*struct GoImport{ | ||
70 | GoImport(bool anon, KDevelop::TopDUContext* ctx) : anonymous(anon), context(ctx) {} | 74 | GoImport(bool anon, KDevelop::TopDUContext* ctx) : anonymous(anon), context(ctx) {} | ||
71 | bool anonymous; | 75 | bool anonymous; | ||
72 | KDevelop::TopDUContext* context; | 76 | KDevelop::TopDUContext* context; | ||
73 | };*/ | 77 | };*/ | ||
74 | 78 | | |||
75 | private: | 79 | private: | ||
Show All 17 Lines | |||||
93 | **/ | 97 | **/ | ||
94 | virtual void declareVariable(go::IdentifierAst* id, const AbstractType::Ptr& type) override; | 98 | virtual void declareVariable(go::IdentifierAst* id, const AbstractType::Ptr& type) override; | ||
95 | 99 | | |||
96 | /** | 100 | /** | ||
97 | * Declares GoFunction and assigns contexts to it. | 101 | * Declares GoFunction and assigns contexts to it. | ||
98 | * Called from typebuilder when building functions and methods | 102 | * Called from typebuilder when building functions and methods | ||
99 | **/ | 103 | **/ | ||
100 | virtual go::GoFunctionDeclaration* declareFunction(go::IdentifierAst* id, const go::GoFunctionType::Ptr& type, | 104 | virtual go::GoFunctionDeclaration* declareFunction(go::IdentifierAst* id, const go::GoFunctionType::Ptr& type, | ||
101 | DUContext* paramContext, DUContext* retparamContext, const QByteArray& comment=QByteArray()) override; | 105 | DUContext* paramContext, DUContext* retparamContext, const QByteArray& comment = {}, DUContext* bodyContext = nullptr) override; | ||
mwolff: dito, see above | |||||
102 | 106 | | |||
103 | void importThisPackage(); | 107 | void importThisPackage(); | ||
104 | void importBuiltins(); | 108 | void importBuiltins(); | ||
105 | bool m_export; | 109 | bool m_export; | ||
106 | 110 | | |||
107 | //QHash<QString, TopDUContext*> m_anonymous_imports; | 111 | //QHash<QString, TopDUContext*> m_anonymous_imports; | ||
108 | 112 | | |||
109 | bool m_preBuilding; | 113 | bool m_preBuilding; | ||
110 | QList<AbstractType::Ptr> m_constAutoTypes; | 114 | QList<AbstractType::Ptr> m_constAutoTypes; | ||
111 | QualifiedIdentifier m_thisPackage; | 115 | QualifiedIdentifier m_thisPackage; | ||
112 | QualifiedIdentifier m_switchTypeVariable; | 116 | QualifiedIdentifier m_switchTypeVariable; | ||
113 | QByteArray m_lastTypeComment, m_lastConstComment; | 117 | QByteArray m_lastTypeComment, m_lastConstComment; | ||
114 | }; | 118 | }; | ||
115 | 119 | | |||
116 | #endif | 120 | #endif | ||
117 | No newline at end of file | 121 | No newline at end of file |
nitpicks here and below: please try to follow our coding style and add spaces around operators (such as the = here
also, you can use = {} to reduce some typing repetition here for the comment