File tree Expand file tree Collapse file tree 3 files changed +23
-4
lines changed
Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -138,20 +138,27 @@ private static void Main(string[] args)
138138 return ;
139139 }
140140
141- var guideResult = grammar . LoadSyntaxHighlightingGuide ( ) ;
142- guide = guideResult != null ? guideResult . Item2 : new HeuristicSyntaxHighlightingGuide ( _Settings ) ;
141+ // To be used later once syntax highlighting for the console is enabled.
142+ //var guideResult = grammar.LoadSyntaxHighlightingGuide();
143+ //guide = guideResult != null ? guideResult.Item2 : new HeuristicSyntaxHighlightingGuide(_Settings);
143144
144- var data = string . Empty ;
145+ string data ;
145146
146147 if ( ! string . IsNullOrEmpty ( o . FileName ) )
147148 {
149+ if ( ! File . Exists ( o . FileName ) )
150+ {
151+ Console . WriteLine ( Resources . FileNotFoundErrorMessage , o . FileName ) ;
152+ return ;
153+ }
154+
148155 var encodingToUse = ! string . IsNullOrEmpty ( o . EncodingName ) ? Encoding . GetEncoding ( o . EncodingName ) : Encoding . Default ;
149156 using ( var reader = new StreamReader ( o . FileName , encodingToUse ) )
150157 data = reader . ReadToEnd ( ) ;
151158 }
152159 else
153160 {
154- var analyzer = new Analyzer ( ) ;
161+ // var analyzer = new Analyzer();
155162 var builder = new StringBuilder ( ) ;
156163 Console . WriteLine ( Resources . ReadingFromStandardInputPromptMessage ) ;
157164 var currentLine = Console . CursorTop ;
Original file line number Diff line number Diff line change 138138 <data name =" UnableToDisplayParseTree" xml : space =" preserve" >
139139 <value >Cannot display parse tree.</value >
140140 </data >
141+ <data name =" FileNotFoundErrorMessage" xml : space =" preserve" >
142+ <value >File "{0}" could not be found.</value >
143+ </data >
141144</root >
You can’t perform that action at this time.
0 commit comments