/
smwwiki
/
OneScript_fork
Обзор
Документация
Войти
/
smwwiki
/
OneScript_fork
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/OneScript.Core/Compilation/Binding/BindingExtensions.cs
44 строки
1 KB
Andrei Ovsiankin
Более правильный наследник для биндинга скоупа
02 июн 2024, 21:43
02 июн 2024, 21:43
25a5afa
Код
Авторство
О чём код?
/*---------------------------------------------------------- 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 OneScript.Contexts; using OneScript.Runtime.Binding; using OneScript.Values; namespace OneScript.Compilation.Binding { public static class BindingExtensions { public static SymbolScope PushObject(this SymbolTable table, BslObjectValue target) { var scope = SymbolScope.FromObject(target); table.PushScope(scope, (IAttachableContext)target); return scope; } public static SymbolScope PushContext(this SymbolTable table, IAttachableContext target) { var scope = SymbolScope.FromContext(target); table.PushScope(scope, target); return scope; } public static IMethodSymbol ToSymbol(this BslMethodInfo info) { return new BslMethodSymbol { Method = info }; } public static IPropertySymbol ToSymbol(this BslPropertyInfo info) { return new BslPropertySymbol { Property = info }; } public static IFieldSymbol ToSymbol(this BslFieldInfo info) { return new BslFieldSymbol { Field = info }; } } }