~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/addins/TextTemplating/MonoDevelop.TextTemplating/Parser/T4Parser.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
using MonoDevelop.Ide.TypeSystem;
31
31
using ICSharpCode.NRefactory.TypeSystem;
32
32
using MonoDevelop.Projects;
 
33
using System.Collections.Generic;
33
34
 
34
35
namespace MonoDevelop.TextTemplating.Parser
35
36
{
36
 
        public class T4Parser : AbstractTypeSystemParser
 
37
        public class T4Parser : TypeSystemParser
37
38
        {
38
39
                public override ParsedDocument Parse (bool storeAst, string fileName, TextReader content, Project project = null)
39
40
                {
44
45
                        } catch (ParserException ex) {
45
46
                                template.LogError (ex.Message, ex.Location);
46
47
                        }
47
 
                        
48
 
                        T4ParsedDocument doc = new T4ParsedDocument (fileName, template.RawSegments);
 
48
 
 
49
                        var errors = new List<Error> ();
 
50
                        foreach (System.CodeDom.Compiler.CompilerError err in template.Errors) {
 
51
                                errors.Add (new Error (err.IsWarning ? ErrorType.Warning : ErrorType.Error, err.ErrorText, err.Line, err.Column));
 
52
                        }
 
53
                        var doc = new T4ParsedDocument (fileName, template.RawSegments, errors);
49
54
                        doc.Flags |= ParsedDocumentFlags.NonSerializable;
50
 
                        foreach (System.CodeDom.Compiler.CompilerError err in template.Errors)
51
 
                                doc.Errors.Add (new Error (err.IsWarning? ErrorType.Warning : ErrorType.Error,
52
 
                                                           err.ErrorText, err.Line, err.Column)); 
53
 
                        
 
55
 
54
56
                        return doc;
55
57
                }
56
58
        }