Changeset View
Changeset View
Standalone View
Standalone View
duchain/builders/declarationbuilder.cpp
Show First 20 Lines • Show All 248 Lines • ▼ Show 20 Line(s) | 232 | { | |||
---|---|---|---|---|---|
249 | DUChainWriteLocker lock; | 249 | DUChainWriteLocker lock; | ||
250 | lastContext()->setType(DUContext::Function); | 250 | lastContext()->setType(DUContext::Function); | ||
251 | decl->setInternalFunctionContext(lastContext()); //inner block context | 251 | decl->setInternalFunctionContext(lastContext()); //inner block context | ||
252 | decl->setKind(Declaration::Instance); | 252 | decl->setKind(Declaration::Instance); | ||
253 | } | 253 | } | ||
254 | closeContext(); //body wrapper context | 254 | closeContext(); //body wrapper context | ||
255 | } | 255 | } | ||
256 | 256 | | |||
257 | void DeclarationBuilder::visitPrimaryExpr(go::PrimaryExprAst *node) | ||||
258 | { | ||||
259 | if(node->signature && !node->convArg) // func type literal and not conversion. | ||||
260 | { | ||||
261 | buildFunction(node->signature, node->body); | ||||
262 | } | ||||
263 | else | ||||
264 | { | ||||
265 | go::DefaultVisitor::visitPrimaryExpr(node); | ||||
266 | } | ||||
267 | } | ||||
268 | | ||||
257 | void DeclarationBuilder::visitMethodDeclaration(go::MethodDeclarationAst* node) | 269 | void DeclarationBuilder::visitMethodDeclaration(go::MethodDeclarationAst* node) | ||
258 | { | 270 | { | ||
259 | Declaration* declaration=0; | 271 | Declaration* declaration=0; | ||
260 | if(node->methodRecv) | 272 | if(node->methodRecv) | ||
261 | { | 273 | { | ||
262 | go::IdentifierAst* actualtype=0; | 274 | go::IdentifierAst* actualtype=0; | ||
263 | if(node->methodRecv->ptype) | 275 | if(node->methodRecv->ptype) | ||
264 | actualtype = node->methodRecv->ptype; | 276 | actualtype = node->methodRecv->ptype; | ||
▲ Show 20 Lines • Show All 350 Lines • Show Last 20 Lines |