/
EvilBeaver
/
OneScript
Обзор
Документация
Войти
/
EvilBeaver
/
OneScript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
src/OneScript.Native/Compiler/StatementsBlockRecord.cs
40 строк
1 KB
Andrey Ovsiankin
Первый подход к информации об исключениях
28 апр 2021, 14:40
28 апр 2021, 14:40
897a086
Код
Авторство
О чём код?
/*---------------------------------------------------------- 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 System.Linq.Expressions; namespace OneScript.Native.Compiler { public class StatementsBlockRecord { private readonly List<Expression> _statements = new List<Expression>(); private readonly JumpInformationRecord _jumpContext; private readonly Stack<Expression> _buildParts = new Stack<Expression>(); public StatementsBlockRecord() { _jumpContext = new JumpInformationRecord(); } public StatementsBlockRecord(JumpInformationRecord jumpTargets) { _jumpContext = jumpTargets; } public LabelTarget MethodReturn => _jumpContext.MethodReturn; public LabelTarget LoopContinue => _jumpContext.LoopContinue; public LabelTarget LoopBreak => _jumpContext.LoopBreak; public ParameterExpression CurrentException => _jumpContext.ExceptionInfo; public void Add(Expression statement) => _statements.Add(statement); public IList<Expression> GetStatements() => _statements; public Stack<Expression> BuildStack => _buildParts; } }