コード例 #1
0
            private static IVariableInternal CreateParameter(IFunctionScopeInternal scope, ParameterSyntax parameter)
            {
                var name = parameter.Kind() switch
                {
                    SyntaxKind.NamedParameter => ((NamedParameterSyntax)parameter).Name,
                    SyntaxKind.VarArgParameter => "...",
                    _ => throw new InvalidOperationException($"{parameter.Kind()} is not a known parameter kind.")
                };

                return(scope.AddParameter(name, parameter));
            }
コード例 #2
0
 private static IVariableInternal CreateParameter(
     IFunctionScopeInternal scope,
     string name) =>
 scope.AddParameter(name, null);