Skip to content

Instantly share code, notes, and snippets.

[Test]
public void ParsesNumber()
{
var result = Parse<int>("1", x => x.Number);
Assert.That(result, Is.EqualTo(1));
}
public class GitNumstatParser : Parser
{
}
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);
@@ -1,3 +1,6 @@
This is a small text file
+that I quite like,
with a few lines of text
-inside, nothing much.
string diffContent = File.ReadAllText("MyDiffFile.diff");
Diff diff = Diff.CreateFrom(diffContent);
public bool Execute()
{
int line, col;
view.GetCaretPos(out line, out col);
indenter.SetIndentationForNextLine(line);
return false;
}
@jagregory
jagregory / gist:17751
Created October 19, 2008 00:14
SmartIndentationBlog.ViewFilterSimple
public class BooViewFilter : ViewFilter
{
public BooViewFilter(CodeWindowManager mgr, IVsTextView view) : base(mgr, view)
{}
}