Skip to content

Instantly share code, notes, and snippets.

@CyberShadow
Created August 11, 2011 00:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CyberShadow/1138658 to your computer and use it in GitHub Desktop.
Save CyberShadow/1138658 to your computer and use it in GitHub Desktop.
import std.stdio, std.string, std.exception;
void main(string[] args)
{
enforce(args.length==3, "Two files please");
auto f1 = File(args[1]), f2 = File(args[2]);
while (!f1.eof() && !f2.eof())
{
auto l1 = f1.readln(), l2 = f2.readln();
if (dstrip(l1) != dstrip(l2))
writef("> %s< %s---\n", l1, l2);
}
}
string dstrip(string s)
{
s = strip(s);
if (s.indexOf("//")>=0)
s = strip(s[0..s.indexOf("//")]);
return s;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment