Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private IEnumerable<Declaration> CurrentScopeDeclarations()
- {
- return _declarations.Where(item =>
- item.DeclarationType == DeclarationType.UserDefinedType
- && item.Project == _currentScope.Project
- && item.ComponentName == _currentScope.ComponentName);
- }
- private IEnumerable<Declaration> CurrentProjectDeclarations()
- {
- return _declarations.Where(item =>
- _moduleTypes.Contains(item.DeclarationType)
- && item.Project == _currentScope.Project);
- }
- private IEnumerable<Declaration> CurrentModuleDeclarations()
- {
- return _declarations.Where(item =>
- _moduleTypes.Contains(item.DeclarationType));
- }
- private Declaration ResolveType(Declaration parent)
- {
- if (parent == null || parent.AsTypeName == null)
- return null;
- var identifier = parent.AsTypeName.Split('.').Last();
- var declarationIsIdentifierPredicate = new Func<Declaration, bool>(d => d.IdentifierName == identifier);
- return
- CurrentScopeDeclarations().SingleOrDefault(declarationIsIdentifierPredicate) ??
- CurrentProjectDeclarations().SingleOrDefault(declarationIsIdentifierPredicate) ??
- CurrentModuleDeclarations().SingleOrDefault(declarationIsIdentifierPredicate);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement