This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class BooViewFilter : ViewFilter | |
| { | |
| public BooViewFilter(CodeWindowManager mgr, IVsTextView view) : base(mgr, view) | |
| {} | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public bool Execute() | |
| { | |
| int line, col; | |
| view.GetCaretPos(out line, out col); | |
| indenter.SetIndentationForNextLine(line); | |
| return false; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string diffContent = File.ReadAllText("MyDiffFile.diff"); | |
| Diff diff = Diff.CreateFrom(diffContent); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @@ -1,3 +1,6 @@ | |
| This is a small text file | |
| +that I quite like, | |
| with a few lines of text | |
| -inside, nothing much. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void RebuildGitNumstatParser() | |
| { | |
| var contents = File.ReadAllText(@"..\..\..\SharpDiff\Parsers\GitNumstatParser.ometacs"); | |
| var result = Grammars.ParseGrammarThenOptimizeThenTranslate | |
| <OMetaParser, OMetaOptimizer, OMetaTranslator> | |
| (contents, | |
| p => p.Grammar, | |
| o => o.OptimizeGrammar, | |
| t => t.Trans); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class GitNumstatParser : Parser | |
| { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Test] | |
| public void ParsesNumber() | |
| { | |
| var result = Parse<int>("1", x => x.Number); | |
| Assert.That(result, Is.EqualTo(1)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected T Parse<T>(string text, Func<GitNumstatParser, Rule<char>> ruleFetcher) | |
| { | |
| return Grammars.ParseWith(text, ruleFetcher).As<T>(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Test] | |
| public void ParsesAdditionsAndSubtractionValues() | |
| { | |
| var result = Parse<FileStats>("3\t8\tmyFile.txt\r\n", x => x.Number); | |
| Assert.That(result.Additions, Is.EqualTo(3)); | |
| Assert.That(result.Subtractions, Is.EqualTo(8)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class FileStats | |
| { | |
| public FileStats(int additions, int subtractions) | |
| { | |
| Additions = additions; | |
| Subtractions = subtractions; | |
| } | |
| public int Additions { get; private set; } | |
| public int Subtractions { get; private set; } |
OlderNewer