Changeset View
Changeset View
Standalone View
Standalone View
duchain/builders/contextbuilder.cpp
Show First 20 Lines • Show All 527 Lines • ▼ Show 20 Line(s) | 527 | if ( declarationType == ClassDeclarationType || declarationType == FunctionDeclarationType ) { | |||
---|---|---|---|---|---|
528 | id = identifierPairForNode(node).second; | 528 | id = identifierPairForNode(node).second; | ||
529 | } else { | 529 | } else { | ||
530 | id = identifierForNode(node); | 530 | id = identifierForNode(node); | ||
531 | } | 531 | } | ||
532 | return findDeclarationImportHelper(currentContext(), id, declarationType); | 532 | return findDeclarationImportHelper(currentContext(), id, declarationType); | ||
533 | } | 533 | } | ||
534 | 534 | | |||
535 | DeclarationPointer ContextBuilder::findDeclarationImport(DeclarationType declarationType, | 535 | DeclarationPointer ContextBuilder::findDeclarationImport(DeclarationType declarationType, | ||
536 | SemiReservedIdentifierAst* node) | 536 | SemiReservedIdentifierAst* node, | ||
537 | DeclarationScope declarationScope) | ||||
537 | { | 538 | { | ||
538 | QualifiedIdentifier id; | 539 | QualifiedIdentifier id; | ||
539 | if ( declarationType == ClassDeclarationType || declarationType == FunctionDeclarationType ) { | 540 | if ( declarationType == ClassDeclarationType || declarationType == FunctionDeclarationType ) { | ||
540 | id = identifierPairForNode(node).second; | 541 | id = identifierPairForNode(node).second; | ||
541 | } else { | 542 | } else { | ||
542 | id = identifierForNode(node); | 543 | id = identifierForNode(node); | ||
543 | } | 544 | } | ||
545 | | ||||
546 | if (declarationScope == GlobalScope) { | ||||
547 | id.setExplicitlyGlobal(true); | ||||
548 | } | ||||
549 | | ||||
544 | return findDeclarationImportHelper(currentContext(), id, declarationType); | 550 | return findDeclarationImportHelper(currentContext(), id, declarationType); | ||
545 | } | 551 | } | ||
546 | 552 | | |||
547 | DeclarationPointer ContextBuilder::findDeclarationImport(DeclarationType declarationType, | 553 | DeclarationPointer ContextBuilder::findDeclarationImport(DeclarationType declarationType, | ||
548 | VariableIdentifierAst* node) | 554 | VariableIdentifierAst* node) | ||
549 | { | 555 | { | ||
550 | return findDeclarationImportHelper(currentContext(), identifierForNode(node), declarationType); | 556 | return findDeclarationImportHelper(currentContext(), identifierForNode(node), declarationType); | ||
551 | } | 557 | } | ||
552 | 558 | | |||
553 | DeclarationPointer ContextBuilder::findDeclarationImport(DeclarationType declarationType, | 559 | DeclarationPointer ContextBuilder::findDeclarationImport(DeclarationType declarationType, | ||
554 | const QualifiedIdentifier &identifier) | 560 | const QualifiedIdentifier &identifier) | ||
555 | { | 561 | { | ||
556 | return findDeclarationImportHelper(currentContext(), identifier, declarationType); | 562 | return findDeclarationImportHelper(currentContext(), identifier, declarationType); | ||
557 | } | 563 | } | ||
558 | 564 | | |||
559 | } | 565 | } |