internal FunctionSymbol( SourceFileSymbol declaringSourceFile, string name, FunctionDeclaration declaration) : base(declaringSourceFile, name, declaration) { var parameters = ImmutableArray <ParameterSymbol> .Empty; int paramCount = declaration.Parameters.Length; if (paramCount > 0) { var builder = ImmutableArray.CreateBuilder <ParameterSymbol>(paramCount); _parameterMap = new Dictionary <string, ParameterSymbol>(); foreach (Parameter paramSyntax in declaration.Parameters) { var parameter = new ParameterSymbol(this, paramSyntax.Name); builder.Add(parameter); _parameterMap.Add(parameter.Name, parameter); } parameters = builder.ToImmutable(); } Parameters = parameters; Declaration = declaration; }
internal SceneSymbol( SourceFileSymbol declaringSourceFile, string name, SceneDeclaration declaration) : base(declaringSourceFile, name, declaration) { Declaration = declaration; }
internal ChapterSymbol( SourceFileSymbol declaringSourceFile, string name, ChapterDeclaration declaration) : base(declaringSourceFile, name, declaration) { Declaration = declaration; }
public IEnumerator <object[]> GetEnumerator() { var ctx = new CompilationContext(); SourceFileSymbol file = ctx.TestModule.RootSourceFile; foreach (FunctionSymbol func in file.Functions) { if (func.Parameters.IsEmpty && !func.Declaration.Name.Value.StartsWith("priv_")) { yield return(new[] { file.Name, func.Name }); } } }
void WriteFile(SourceFileSymbol file) { }
private void DiagnoseFile(SourceFileSymbol file) { file.GetDiagnostics(_diagnostics); }