/*! *****************************************************************************
Copyright (C) Microsoft. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */

/**
 * @license
 * Lodash <https://lodash.com/>
 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
 * Released under MIT license <https://lodash.com/license>
 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
 */

//!

//!     ..

//!     let x = a + b;

//!     let y = "c.0" + "c.1";

//!     let y = c.0 + c.1;

//! # Example

//! // Call

//! // Original block

//! // Rewritten as a function + call expression (assume `variant` is `AsyncFunction` here)

//! The original block is then reconstructed with all symbol references

//! This pass analyzes symbol accesses inside the block, determines which

//! Transforms a captured `Block` into a standalone async `Function` plus a

//! ```

//! ```leo

//! and call-site arguments. Tuple and tuple-field accesses are normalized so

//! async function generated_async(a: i32, b: i32, "c.0": i32, "c.1": i32) {

//! corresponding call expression.

//! generated_async(a, b, c.0, c.1);

//! let a: i32 = 1;

//! let b: i32 = 2;

//! let c: (i32, i32) = (3, 4);

//! reconstruction when needed.

//! replaced by these synthesized parameters. The result is a function

//! that each accessed element becomes a unique parameter, with full-tuple

//! that encapsulates the block's logic and a call expression that invokes it.

//! variables must become parameters, and synthesizes the necessary `Input`s

//! {

//! }
