This commit is contained in:
Alex Dima 2015-10-23 16:01:33 +02:00
Родитель 3f75fda27f
Коммит 6f82690e59
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -35,6 +35,9 @@ interface IScopeNameSet {
[scopeName:string]: boolean;
}
/**
* Fill in `result` all external included scopes in `patterns`
*/
function _extractIncludedScopesInPatterns(result:IScopeNameSet, patterns:IRawPattern[]): void {
for (let i = 0, len = patterns.length; i < len; i++) {
let include = patterns[i].include;
@ -62,6 +65,9 @@ function _extractIncludedScopesInPatterns(result:IScopeNameSet, patterns:IRawPat
}
}
/**
* Fill in `result` all external included scopes in `repository`
*/
function _extractIncludedScopesInRepository(result:IScopeNameSet, repository:IRawRepository): void {
for (let name in repository) {
let rule = repository[name];
@ -76,6 +82,9 @@ function _extractIncludedScopesInRepository(result:IScopeNameSet, repository:IRa
}
}
/**
* Return a list of all external included scopes in `grammar`.
*/
export function extractIncludedScopes(grammar:IRawGrammar): string[] {
let result: IScopeNameSet = {};