public static GMacMacroTreeBinding Create(AstMacro baseMacroInfo, GMacBindOutputToConstantBehavior outputToConstAction = GMacBindOutputToConstantBehavior.Prevent) { return(new GMacMacroTreeBinding(baseMacroInfo) { BindOutputToConstantAction = outputToConstAction }); }
/// <summary> /// Create an empty macro parameters list binding pattern /// </summary> /// <param name="baseMacro"></param> /// <param name="outputToConstAction"></param> /// <returns></returns> public static GMacMacroBinding Create(AstMacro baseMacro, GMacBindOutputToConstantBehavior outputToConstAction = GMacBindOutputToConstantBehavior.BindToVariable) { return(new GMacMacroBinding(baseMacro) { BindOutputToConstantBehavior = outputToConstAction }); }
/// <summary> /// Create a macro parameters list binding pattern from a tree pattern /// </summary> /// <param name="macroTreeBinding"></param> /// <param name="outputToConstAction"></param> /// <returns></returns> public static GMacMacroBinding Create(GMacMacroTreeBinding macroTreeBinding, GMacBindOutputToConstantBehavior outputToConstAction) { var listPattern = new GMacMacroBinding(macroTreeBinding.BaseMacro) { BindOutputToConstantBehavior = outputToConstAction }; return(listPattern.BindUsing(macroTreeBinding)); }