/
EvilBeaver
/
OneScript
Обзор
Документация
Войти
/
EvilBeaver
/
OneScript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
v2.0.1
src/Tests/OneScript.Language.Tests/SourceCodeHelper.cs
35 строк
985 B
EvilBeaver
fixes #1540 Предупреждение о неявных импортах
01 дек 2025, 12:27
01 дек 2025, 12:27
9ef7b18
Код
Авторство
О чём код?
/*---------------------------------------------------------- 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.Language.Sources; using OneScript.Sources; namespace OneScript.Language.Tests { public static class SourceCodeHelper { public static SourceCode FromString(string code) { return SourceCodeBuilder.Create() .FromSource(new StringSource(code)) .Build(); } private class StringSource : ICodeSource { private readonly string _code; public StringSource(string code) { _code = code; } public string Location => _code; public string GetSourceCode() => _code; } } }