/
EvilBeaver
/
OneScript
Обзор
Документация
Войти
/
EvilBeaver
/
OneScript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
src/ScriptEngine/Machine/Core.cs
184 строки
3 KB
Sergey Batanov
Убрана завязка на константы образа.
31 авг 2025, 19:27
31 авг 2025, 19:27
a2fa4ea
Код
Авторство
О чём код?
/*---------------------------------------------------------- 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; namespace ScriptEngine.Machine { [Serializable] public enum OperationCode { Nop, PushVar, PushConst, PushInt, PushBool, PushUndef, PushNull, PushLoc, PushRef, LoadVar, LoadLoc, AssignRef, Add, Sub, Mul, Div, Mod, Neg, Equals, Less, Greater, LessOrEqual, GreaterOrEqual, NotEqual, Not, And, Or, CallFunc, CallProc, ArgNum, PushDefaultArg, ResolveProp, ResolveMethodProc, ResolveMethodFunc, Jmp, JmpFalse, PushIndexed, Return, JmpCounter, Inc, NewInstance, NewFunc, PushIterator, IteratorNext, StopIterator, BeginTry, EndTry, RaiseException, LineNum, MakeRawValue, MakeBool, PushTmp, PopTmp, Execute, AddHandler, RemoveHandler, ExitTry, // built-in functions Eval, Bool, Number, Str, Date, Type, ValType, StrLen, TrimL, TrimR, TrimLR, Left, Right, Mid, StrPos, UCase, LCase, TCase, Chr, ChrCode, EmptyStr, StrReplace, StrGetLine, StrLineCount, StrEntryCount, Year, Month, Day, Hour, Minute, Second, BegOfWeek, BegOfYear, BegOfMonth, BegOfDay, BegOfHour, BegOfMinute, BegOfQuarter, EndOfWeek, EndOfYear, EndOfMonth, EndOfDay, EndOfHour, EndOfMinute, EndOfQuarter, WeekOfYear, DayOfYear, DayOfWeek, AddMonth, CurrentDate, Integer, Round, Log, Log10, Sin, Cos, Tan, ASin, ACos, ATan, Exp, Pow, Sqrt, Min, Max, Format, ExceptionInfo, ExceptionDescr, ModuleInfo } [Serializable] public struct Command { public OperationCode Code; public int Argument; public override string ToString() { return Enum.GetName(typeof(OperationCode), Code) + ":" + Argument.ToString(); } } [Serializable] public enum DataType { Undefined, String, Number, Date, Boolean, Null } [Serializable] public struct ConstDefinition : IEquatable<ConstDefinition> { public DataType Type; public string Presentation; public override string ToString() { return Enum.GetName(typeof(DataType), Type) + ":" + Presentation; } public bool Equals(ConstDefinition other) { return Type == other.Type && string.Equals(Presentation, other.Presentation, StringComparison.Ordinal); } } }