Example #1
0
        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;
        }
Example #2
0
 internal SceneSymbol(
     SourceFileSymbol declaringSourceFile,
     string name,
     SceneDeclaration declaration)
     : base(declaringSourceFile, name, declaration)
 {
     Declaration = declaration;
 }
Example #3
0
 internal ChapterSymbol(
     SourceFileSymbol declaringSourceFile,
     string name,
     ChapterDeclaration declaration)
     : base(declaringSourceFile, name, declaration)
 {
     Declaration = declaration;
 }
Example #4
0
        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)
 {
 }
Example #6
0
 private void DiagnoseFile(SourceFileSymbol file)
 {
     file.GetDiagnostics(_diagnostics);
 }