Ejemplo n.º 1
0
        public virtual IEnumerable <RazorDiagnostic> GetAllDiagnostics()
        {
            if (_allDiagnostics == null)
            {
                var attributeDiagnostics = Attributes.SelectMany(attribute => attribute.Diagnostics);
                var combinedDiagnostics  = Diagnostics.Concat(attributeDiagnostics);
                _allDiagnostics = combinedDiagnostics.ToArray();
            }

            return(_allDiagnostics);
        }
Ejemplo n.º 2
0
        public DiagnosticReport Emit(string outputPath)
        {
            if (Diagnostics.HasErrors)
            {
                return(Diagnostics);
            }

            var emitter = new Emiter(program);

            emitter.Emit();
            emitter.WriteTo(outputPath);
            return(new DiagnosticReport(Diagnostics.Concat(emitter.GetDiagnostics())));
        }