Blamite.Blam.Scripting.Compiler.ScriptCompiler.CreateInitialBegin C# (CSharp) Method

CreateInitialBegin() private method

private CreateInitialBegin ( string returnType, uint textPosition ) : void
returnType string
textPosition uint
return void
        private void CreateInitialBegin(string returnType, uint textPosition)
        {
            FunctionInfo info = _opcodes.GetFunctionInfo("begin").First();

            // Create the begin call.
            var beginCall = new ScriptExpression
            {
                Index = _currentIndex,
                Opcode = info.Opcode,
                ReturnType = _opcodes.GetTypeInfo(returnType).Opcode,
                Type = ScriptExpressionType.Group,
                Next = DatumIndex.Null,
                StringOffset = textPosition,
                Value = new LongExpressionValue(_currentIndex.Next),
                LineNumber = 0
            };
            AddExpressionIncrement(beginCall);

            // Create the function name.
            var beginName = new ScriptExpression
            {
                Index = _currentIndex,
                Opcode = info.Opcode,
                ReturnType = _opcodes.GetTypeInfo("function_name").Opcode,
                Type = ScriptExpressionType.Expression,
                Next = DatumIndex.Null,
                StringOffset = _strings.Cache(info.Name),
                Value = new LongExpressionValue(0),
                LineNumber = 0
            };
            OpenDatumAddExpressionIncrement(beginName);
        }