diff --git a/.gitignore b/.gitignore index f9d5d37..7bf7e3f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /tests_results /main.exe /main.exe.mdb -/*Generated.cs -/*Generator.exe \ No newline at end of file +*Generated.cs +*GeneratedF.cs +*Generator.exe diff --git a/F.sed b/F.sed new file mode 100644 index 0000000..13bffc0 --- /dev/null +++ b/F.sed @@ -0,0 +1,38 @@ +#!/usr/bin/env sed -nf + +/^[^ ].*/p + +/\[F\]/,/^ *)/{ + s/\( *\)private partial class \(.*\) {/\1\2/; + t classHeader; + b notClassHeader; + :classHeader + h; + s/\( *\)\(.*\)/\1private partial class \2 : IEqF
{\n\1 private \2() {}\n\1 public static readonly \2\3 Eq = new \2\3();\n\1 public static bool operator ==(\2\3 a, \2\3 b)\n\1 => Equality.Operator(a, b);\n\1 public static bool operator !=(\2\3 a, \2\3 b)\n\1 => !(a == b);\n\1 public override bool Equals(object other)\n\1 => Equality.Untyped<\2\3>(\n\1 this,\n\1 other,\n\1 x => x as \2\3,\n\1 x => x.hashCode);\n\1 public bool Equals(IEqF<\n\5\n\1 \4\n\1 > other)\n\1 => Equality.Equatable