Jurassic.Compiler.Scope.GenerateScopeCreation C# (CSharp) Method

GenerateScopeCreation() abstract private method

Generates code that creates a new scope.
abstract private GenerateScopeCreation ( ILGenerator generator, OptimizationInfo optimizationInfo ) : void
generator ILGenerator The generator to output the CIL to.
optimizationInfo OptimizationInfo Information about any optimizations that should be performed.
return void
        internal abstract void GenerateScopeCreation(ILGenerator generator, OptimizationInfo optimizationInfo);

Usage Example

Example #1
0
        /// <summary>
        /// Generates CIL for the statement.
        /// </summary>
        /// <param name="generator"> The generator to output the CIL to. </param>
        /// <param name="optimizationInfo"> Information about any optimizations that should be performed. </param>
        public override void GenerateCode(ILGenerator generator, OptimizationInfo optimizationInfo)
        {
            // Generate code for the start of the statement.
            var statementLocals = new StatementLocals()
            {
                NonDefaultSourceSpanBehavior = true
            };

            GenerateStartOfStatement(generator, optimizationInfo, statementLocals);

            // Generate scope creation.
            Scope.GenerateScopeCreation(generator, optimizationInfo);
            Scope.GenerateHoistedDeclarations(generator, optimizationInfo);

            foreach (var statement in this.Statements)
            {
                // Generate code for the statement.
                statement.GenerateCode(generator, optimizationInfo);
            }

            // Generate code for the end of the statement.
            GenerateEndOfStatement(generator, optimizationInfo, statementLocals);
        }
All Usage Examples Of Jurassic.Compiler.Scope::GenerateScopeCreation