diff options
author | Rob Mensching <rob@firegiant.com> | 2017-11-01 10:59:45 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2017-11-01 10:59:45 -0700 |
commit | 2bb37beda887d120a0ddabf874ad25357101faa1 (patch) | |
tree | c35e97b03274b86cfc9ff7fd2caeee211165a140 /src/WixToolset.Core/Preprocessor.cs | |
parent | df7413aeed3aea3425dff20ae0c8b1be3a3ab525 (diff) | |
download | wix-2bb37beda887d120a0ddabf874ad25357101faa1.tar.gz wix-2bb37beda887d120a0ddabf874ad25357101faa1.tar.bz2 wix-2bb37beda887d120a0ddabf874ad25357101faa1.zip |
Update to WiX Intermediate Representation
Diffstat (limited to 'src/WixToolset.Core/Preprocessor.cs')
-rw-r--r-- | src/WixToolset.Core/Preprocessor.cs | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/src/WixToolset.Core/Preprocessor.cs b/src/WixToolset.Core/Preprocessor.cs index a9fbcbb7..85b3dab8 100644 --- a/src/WixToolset.Core/Preprocessor.cs +++ b/src/WixToolset.Core/Preprocessor.cs | |||
@@ -38,7 +38,6 @@ namespace WixToolset | |||
38 | 38 | ||
39 | private List<IPreprocessorExtension> extensions; | 39 | private List<IPreprocessorExtension> extensions; |
40 | private Dictionary<string, IPreprocessorExtension> extensionsByPrefix; | 40 | private Dictionary<string, IPreprocessorExtension> extensionsByPrefix; |
41 | private List<InspectorExtension> inspectorExtensions; | ||
42 | 41 | ||
43 | private SourceLineNumber currentLineNumber; | 42 | private SourceLineNumber currentLineNumber; |
44 | private Stack<SourceLineNumber> sourceStack; | 43 | private Stack<SourceLineNumber> sourceStack; |
@@ -60,7 +59,6 @@ namespace WixToolset | |||
60 | 59 | ||
61 | this.extensions = new List<IPreprocessorExtension>(); | 60 | this.extensions = new List<IPreprocessorExtension>(); |
62 | this.extensionsByPrefix = new Dictionary<string, IPreprocessorExtension>(); | 61 | this.extensionsByPrefix = new Dictionary<string, IPreprocessorExtension>(); |
63 | this.inspectorExtensions = new List<InspectorExtension>(); | ||
64 | 62 | ||
65 | this.sourceStack = new Stack<SourceLineNumber>(); | 63 | this.sourceStack = new Stack<SourceLineNumber>(); |
66 | 64 | ||
@@ -201,27 +199,9 @@ namespace WixToolset | |||
201 | public XDocument Process(string sourceFile, IDictionary<string, string> variables) | 199 | public XDocument Process(string sourceFile, IDictionary<string, string> variables) |
202 | { | 200 | { |
203 | using (Stream sourceStream = new FileStream(sourceFile, FileMode.Open, FileAccess.Read, FileShare.Read)) | 201 | using (Stream sourceStream = new FileStream(sourceFile, FileMode.Open, FileAccess.Read, FileShare.Read)) |
202 | using (XmlReader reader = XmlReader.Create(sourceFile, DocumentXmlReaderSettings)) | ||
204 | { | 203 | { |
205 | InspectorCore inspectorCore = new InspectorCore(); | 204 | return Process(reader, variables, sourceFile); |
206 | foreach (InspectorExtension inspectorExtension in this.inspectorExtensions) | ||
207 | { | ||
208 | inspectorExtension.Core = inspectorCore; | ||
209 | inspectorExtension.InspectSource(sourceStream); | ||
210 | |||
211 | // reset | ||
212 | inspectorExtension.Core = null; | ||
213 | sourceStream.Position = 0; | ||
214 | } | ||
215 | |||
216 | if (inspectorCore.EncounteredError) | ||
217 | { | ||
218 | return null; | ||
219 | } | ||
220 | |||
221 | using (XmlReader reader = XmlReader.Create(sourceFile, DocumentXmlReaderSettings)) | ||
222 | { | ||
223 | return Process(reader, variables, sourceFile); | ||
224 | } | ||
225 | } | 205 | } |
226 | } | 206 | } |
227 | 207 | ||