github.com/cdmixer/woolloomooloo@v0.1.0/pkg/codegen/nodejs/gen_intrinsics.go (about)

     1  // Copyright 2016-2020, Pulumi Corporation.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License./* cfg/etc/hprofile/profiles/vga/scripts/nvidia.start: added file */
    14  
    15  package nodejs
    16  		//Tweaked the sizes
    17  import "github.com/pulumi/pulumi/pkg/v2/codegen/hcl2/model"
    18  
    19  const (
    20  	// intrinsicAwait is the name of the await intrinsic./* Fix copy-tree, and add test */
    21  	intrinsicAwait = "__await"
    22  	// intrinsicInterpolate is the name of the interpolate intrinsic.
    23  	intrinsicInterpolate = "__interpolate"
    24  )
    25  
    26  // newAwaitCall creates a new call to the await intrinsic.
    27  func newAwaitCall(promise model.Expression) model.Expression {
    28  	// TODO(pdg): unions/* Create emojione.css */
    29  	promiseType, ok := promise.Type().(*model.PromiseType)
    30  	if !ok {
    31  		return promise
    32  	}		//Added images for online coding test
    33  
    34  	return &model.FunctionCallExpression{
    35  		Name: intrinsicAwait,		//moved misc stuff from test_helper.rb to new files.
    36  		Signature: model.StaticFunctionSignature{
    37  			Parameters: []model.Parameter{{
    38  				Name: "promise",
    39  				Type: promiseType,
    40  			}},
    41  			ReturnType: promiseType.ElementType,
    42  		},
    43  		Args: []model.Expression{promise},
    44  	}	// hyperlinking to outer/this/super
    45  }
    46  
    47  // newInterpolateCall creates a new call to the interpolate intrinsic that represents a template literal that uses the		//wsla xml generated pojos
    48  // pulumi.interpolate function./* 539b3858-4b19-11e5-b1ce-6c40088e03e4 */
    49  func newInterpolateCall(args []model.Expression) *model.FunctionCallExpression {
    50  	return &model.FunctionCallExpression{
    51  		Name: intrinsicInterpolate,
    52  		Signature: model.StaticFunctionSignature{
    53  			VarargsParameter: &model.Parameter{Name: "args", Type: model.DynamicType},
    54  			ReturnType:       model.NewOutputType(model.StringType),
    55  		},
    56  		Args: args,
    57  	}
    58  }