File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,18 @@ public static Range ToRange(this IScriptExtent extent)
3030 extent . EndColumnNumber ) ;
3131 }
3232
33+ /// <summary>
34+ /// Get the parameter Asts from a function definition Ast.
35+ ///
36+ /// If not parameters are found, return null.
37+ /// </summary>
38+ public static IEnumerable < ParameterAst > GetParameterAsts (
39+ this FunctionDefinitionAst functionDefinitionAst )
40+ {
41+ ParamBlockAst paramBlockAst ;
42+ return functionDefinitionAst . GetParameterAsts ( out paramBlockAst ) ;
43+ }
44+
3345 /// <summary>
3446 /// Get the parameter Asts from a function definition Ast.
3547 ///
@@ -41,6 +53,8 @@ public static IEnumerable<ParameterAst> GetParameterAsts(
4153 this FunctionDefinitionAst functionDefinitionAst ,
4254 out ParamBlockAst paramBlockAst )
4355 {
56+ // todo instead of returning null return an empty enumerator if no parameter is found
57+ // this removes the burden from the user for null checking.
4458 paramBlockAst = null ;
4559 if ( functionDefinitionAst . Parameters != null )
4660 {
@@ -114,6 +128,16 @@ public static NamedAttributeArgumentAst GetSupportsShouldProcessAst(this Attribu
114128 return null ;
115129 }
116130
131+
132+ /// <summary>
133+ /// Return the boolean value of a named attribute argument.
134+ /// </summary>
135+ public static bool GetValue ( this NamedAttributeArgumentAst attrAst )
136+ {
137+ ExpressionAst argumentAst ;
138+ return attrAst . GetValue ( out argumentAst ) ;
139+ }
140+
117141 /// <summary>
118142 /// Return the boolean value of a named attribute argument.
119143 /// </summary>
You can’t perform that action at this time.
0 commit comments