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)
30
30
extent . EndColumnNumber ) ;
31
31
}
32
32
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
+
33
45
/// <summary>
34
46
/// Get the parameter Asts from a function definition Ast.
35
47
///
@@ -41,6 +53,8 @@ public static IEnumerable<ParameterAst> GetParameterAsts(
41
53
this FunctionDefinitionAst functionDefinitionAst ,
42
54
out ParamBlockAst paramBlockAst )
43
55
{
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.
44
58
paramBlockAst = null ;
45
59
if ( functionDefinitionAst . Parameters != null )
46
60
{
@@ -114,6 +128,16 @@ public static NamedAttributeArgumentAst GetSupportsShouldProcessAst(this Attribu
114
128
return null ;
115
129
}
116
130
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
+
117
141
/// <summary>
118
142
/// Return the boolean value of a named attribute argument.
119
143
/// </summary>
You can’t perform that action at this time.
0 commit comments