/
EvilBeaver
/
OneScript
Обзор
Документация
Войти
/
EvilBeaver
/
OneScript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
v1.8.3
src/ScriptEngine/Compiler/DirectiveMultiResolver.cs
50 строк
1 KB
Andrei Ovsiankin
Удалены неиспользуемые директивы по проекту
05 янв 2020, 23:29
05 янв 2020, 23:29
4be0088
Код
Авторство
О чём код?
/*---------------------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. ----------------------------------------------------------*/ using System.Collections.Generic; using ScriptEngine.Environment; namespace ScriptEngine.Compiler { internal class DirectiveMultiResolver : List<IDirectiveResolver>, IDirectiveResolver { public ICodeSource Source { get { foreach (var resolver in this) { var result = resolver.Source; if (result != null) { return result; } } return null; } set { foreach (var resolver in this) { resolver.Source = value; } } } public bool Resolve(string directive, string value, bool codeEntered) { foreach (var resolver in this) { if (resolver.Resolve(directive, value, codeEntered)) return true; } return false; } } }