Blamite.Blam.Scripting.Compiler.ScriptCompiler.EnterBranch C# (CSharp) Метод

EnterBranch() публичный Метод

public EnterBranch ( HS_Gen1Parser.BranchContext context ) : void
context HS_Gen1Parser.BranchContext
Результат void
        public override void EnterBranch(HS_Gen1Parser.BranchContext context)
        {
            if (_debug)
            {
                _logger.Branch(context, CompilerContextAction.Enter);
            }

            LinkDatum();
            _ = _expectedTypes.PopType();    // Just ignore the type for now.

            // Branch always has two parameters.
            if (context.expression().Count() != 2)
            {
                throw new CompilerException($"\"Branch\" accepts two arguments. The compiler found {context.expression().Count() }.", context);
            }

            _expectedTypes.PushTypes("boolean", TypeHelper.ScriptReference);
            FunctionInfo info = _opcodes.GetFunctionInfo("branch").First();
            CreateFunctionCall(info, _opcodes.GetTypeInfo("void").Opcode, context.GetCorrectTextPosition(_missingCarriageReturnPositions), GetLineNumber(context));

            _branchBoolIndex = _currentIndex.Index;
        }