/// <summary> /// Determines if the specified variables ID refers to a read-only variable. /// </summary> /// <param name="varId">ID of the variable to check.</param> /// <returns>If true, the variable is read-only.</returns> internal bool IsReadOnly(int varId) { if (ByteCodes.IsGlobalVariable(varId)) { return(Variables[ByteCodes.GetVariableIndex(varId)].CompilerFlags.HasFlag(CompilerFlag.ReadOnly)); } return(false); }
private Variable GetVariable(int varId) { if (ByteCodes.IsGlobalVariable(varId)) { return(Variables[ByteCodes.GetVariableIndex(varId)]); } var context = GetFunctionContext(); if (ByteCodes.IsLocalVariable(varId)) { return(context.Variables[ByteCodes.GetVariableIndex(varId)]); } // Function parameter return(context.Parameters[ByteCodes.GetVariableIndex(varId)]); }