Skip to content

Commit

Permalink
Add GitHub link to Expand Code
Browse files Browse the repository at this point in the history
  • Loading branch information
kzrnm committed Dec 13, 2020
1 parent 5e49a43 commit 6c5cccd
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ class Program
}
}

#region Expanded
#region Expanded by https://github.com/naminodarie/SourceExpander
namespace SourceExpander { public class Expander { [Conditional("EXPANDER")] public static void Expand(string inputFilePath = null, string outputFilePath = null, bool ignoreAnyError = true) { } public static string ExpandString(string inputFilePath = null, bool ignoreAnyError = true) { return ""; } } }
// library code
#endregion Expanded
#endregion Expanded by https://github.com/naminodarie/SourceExpander
```

### For library developer
Expand Down
4 changes: 2 additions & 2 deletions Source/SourceExpander.Generator/CompilationExpander.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ public string ExpandCode(SyntaxTree origTree, CancellationToken cancellationToke
line = sr.ReadLine();
}

sb.AppendLine("#region Expanded");
sb.AppendLine("#region Expanded by https://github.com/naminodarie/SourceExpander");
foreach (var s in requiedFiles)
sb.AppendLine(s.CodeBody);
sb.AppendLine("#endregion Expanded");
sb.AppendLine("#endregion Expanded by https://github.com/naminodarie/SourceExpander");
return sb.ToString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ static void Main()
#endif
}
}
#region Expanded
#region Expanded by https://github.com/naminodarie/SourceExpander
namespace SampleLibrary { public static class Put { private static readonly Xorshift rnd = new Xorshift(); public static void WriteRandom() => Trace.WriteLine(rnd.Next()); } }
namespace SampleLibrary { public class Xorshift : Random { private uint x = 123456789; private uint y = 362436069; private uint z = 521288629; private uint w; private static readonly Random rnd = new Random(); public Xorshift() : this(rnd.Next()) { } public Xorshift(int seed) { w = (uint)seed; } protected override double Sample() => InternalSample() * (1.0 / uint.MaxValue); private uint InternalSample() { uint t = x ^ (x << 11); x = y; y = z; z = w; return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); } } }
#endregion Expanded
#endregion Expanded by https://github.com/naminodarie/SourceExpander
")
);

Expand Down Expand Up @@ -178,10 +178,10 @@ static void Main()
#endif
}
}
#region Expanded
#region Expanded by https://github.com/naminodarie/SourceExpander
namespace SampleLibrary { public static class Put { private static readonly Xorshift rnd = new Xorshift(); public static void WriteRandom() => Trace.WriteLine(rnd.Next()); } }
namespace SampleLibrary { public class Xorshift : Random { private uint x = 123456789; private uint y = 362436069; private uint z = 521288629; private uint w; private static readonly Random rnd = new Random(); public Xorshift() : this(rnd.Next()) { } public Xorshift(int seed) { w = (uint)seed; } protected override double Sample() => InternalSample() * (1.0 / uint.MaxValue); private uint InternalSample() { uint t = x ^ (x << 11); x = y; y = z; z = w; return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); } } }
#endregion Expanded
#endregion Expanded by https://github.com/naminodarie/SourceExpander
")
);

Expand Down
8 changes: 4 additions & 4 deletions Test/SourceExpander.Generator.Test/Generate/ConfigTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ static void P()
#endif
}
}
#region Expanded
#region Expanded by https://github.com/naminodarie/SourceExpander
namespace SampleLibrary { public static class Put { private static readonly Xorshift rnd = new Xorshift(); public static void WriteRandom() => Trace.WriteLine(rnd.Next()); } }
namespace SampleLibrary { public class Xorshift : Random { private uint x = 123456789; private uint y = 362436069; private uint z = 521288629; private uint w; private static readonly Random rnd = new Random(); public Xorshift() : this(rnd.Next()) { } public Xorshift(int seed) { w = (uint)seed; } protected override double Sample() => InternalSample() * (1.0 / uint.MaxValue); private uint InternalSample() { uint t = x ^ (x << 11); x = y; y = z; z = w; return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); } } }
#endregion Expanded
#endregion Expanded by https://github.com/naminodarie/SourceExpander
")
);
}
Expand Down Expand Up @@ -209,10 +209,10 @@ static void P()
#endif
}
}
#region Expanded
#region Expanded by https://github.com/naminodarie/SourceExpander
namespace SampleLibrary { public static class Put { private static readonly Xorshift rnd = new Xorshift(); public static void WriteRandom() => Trace.WriteLine(rnd.Next()); } }
namespace SampleLibrary { public class Xorshift : Random { private uint x = 123456789; private uint y = 362436069; private uint z = 521288629; private uint w; private static readonly Random rnd = new Random(); public Xorshift() : this(rnd.Next()) { } public Xorshift(int seed) { w = (uint)seed; } protected override double Sample() => InternalSample() * (1.0 / uint.MaxValue); private uint InternalSample() { uint t = x ^ (x << 11); x = y; y = z; z = w; return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); } } }
#endregion Expanded
#endregion Expanded by https://github.com/naminodarie/SourceExpander
")
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ static void P()
#endif
}
}
#region Expanded
#region Expanded by https://github.com/naminodarie/SourceExpander
namespace SampleLibrary { public static class Put { private static readonly Xorshift rnd = new Xorshift(); public static void WriteRandom() => Trace.WriteLine(rnd.Next()); } }
namespace SampleLibrary { public class Xorshift : Random { private uint x = 123456789; private uint y = 362436069; private uint z = 521288629; private uint w; private static readonly Random rnd = new Random(); public Xorshift() : this(rnd.Next()) { } public Xorshift(int seed) { w = (uint)seed; } protected override double Sample() => InternalSample() * (1.0 / uint.MaxValue); private uint InternalSample() { uint t = x ^ (x << 11); x = y; y = z; z = w; return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); } } }
#endregion Expanded
#endregion Expanded by https://github.com/naminodarie/SourceExpander
")
);
((object)files["/home/source/Program2.cs"]).Should()
Expand All @@ -110,11 +110,11 @@ static void P()
using System.Diagnostics;
Console.WriteLine(42);
Put2.Write();
#region Expanded
#region Expanded by https://github.com/naminodarie/SourceExpander
namespace SampleLibrary { public static class Put2 { public static void Write() => Put.WriteRandom(); } }
namespace SampleLibrary { public static class Put { private static readonly Xorshift rnd = new Xorshift(); public static void WriteRandom() => Trace.WriteLine(rnd.Next()); } }
namespace SampleLibrary { public class Xorshift : Random { private uint x = 123456789; private uint y = 362436069; private uint z = 521288629; private uint w; private static readonly Random rnd = new Random(); public Xorshift() : this(rnd.Next()) { } public Xorshift(int seed) { w = (uint)seed; } protected override double Sample() => InternalSample() * (1.0 / uint.MaxValue); private uint InternalSample() { uint t = x ^ (x << 11); x = y; y = z; z = w; return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); } } }
#endregion Expanded
#endregion Expanded by https://github.com/naminodarie/SourceExpander
")
);
}
Expand Down Expand Up @@ -169,10 +169,10 @@ static void P()
#endif
}
}
#region Expanded
#region Expanded by https://github.com/naminodarie/SourceExpander
namespace SampleLibrary { public static class Put { private static readonly Xorshift rnd = new Xorshift(); public static void WriteRandom() => Trace.WriteLine(rnd.Next()); } }
namespace SampleLibrary { public class Xorshift : Random { private uint x = 123456789; private uint y = 362436069; private uint z = 521288629; private uint w; private static readonly Random rnd = new Random(); public Xorshift() : this(rnd.Next()) { } public Xorshift(int seed) { w = (uint)seed; } protected override double Sample() => InternalSample() * (1.0 / uint.MaxValue); private uint InternalSample() { uint t = x ^ (x << 11); x = y; y = z; z = w; return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); } } }
#endregion Expanded
#endregion Expanded by https://github.com/naminodarie/SourceExpander
")
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ static void P()
#endif
}
}
#region Expanded
#region Expanded by https://github.com/naminodarie/SourceExpander
namespace SampleLibrary { public static class Put { private static readonly Xorshift rnd = new Xorshift(); public static void WriteRandom() => Trace.WriteLine(rnd.Next()); } }
namespace SampleLibrary { public class Xorshift : Random { private uint x = 123456789; private uint y = 362436069; private uint z = 521288629; private uint w; private static readonly Random rnd = new Random(); public Xorshift() : this(rnd.Next()) { } public Xorshift(int seed) { w = (uint)seed; } protected override double Sample() => InternalSample() * (1.0 / uint.MaxValue); private uint InternalSample() { uint t = x ^ (x << 11); x = y; y = z; z = w; return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); } } }
#endregion Expanded
#endregion Expanded by https://github.com/naminodarie/SourceExpander
")
);
files["/home/source/Program2.cs"].Should()
Expand All @@ -108,11 +108,11 @@ static void P()
using System.Diagnostics;
Console.WriteLine(42);
Put2.Write();
#region Expanded
#region Expanded by https://github.com/naminodarie/SourceExpander
namespace SampleLibrary { public static class Put2 { public static void Write() => Put.WriteRandom(); } }
namespace SampleLibrary { public static class Put { private static readonly Xorshift rnd = new Xorshift(); public static void WriteRandom() => Trace.WriteLine(rnd.Next()); } }
namespace SampleLibrary { public class Xorshift : Random { private uint x = 123456789; private uint y = 362436069; private uint z = 521288629; private uint w; private static readonly Random rnd = new Random(); public Xorshift() : this(rnd.Next()) { } public Xorshift(int seed) { w = (uint)seed; } protected override double Sample() => InternalSample() * (1.0 / uint.MaxValue); private uint InternalSample() { uint t = x ^ (x << 11); x = y; y = z; z = w; return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); } } }
#endregion Expanded
#endregion Expanded by https://github.com/naminodarie/SourceExpander
")
);
}
Expand Down Expand Up @@ -164,10 +164,10 @@ static void P()
#endif
}
}
#region Expanded
#region Expanded by https://github.com/naminodarie/SourceExpander
namespace SampleLibrary { public static class Put { private static readonly Xorshift rnd = new Xorshift(); public static void WriteRandom() => Trace.WriteLine(rnd.Next()); } }
namespace SampleLibrary { public class Xorshift : Random { private uint x = 123456789; private uint y = 362436069; private uint z = 521288629; private uint w; private static readonly Random rnd = new Random(); public Xorshift() : this(rnd.Next()) { } public Xorshift(int seed) { w = (uint)seed; } protected override double Sample() => InternalSample() * (1.0 / uint.MaxValue); private uint InternalSample() { uint t = x ^ (x << 11); x = y; y = z; z = w; return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); } } }
#endregion Expanded
#endregion Expanded by https://github.com/naminodarie/SourceExpander
")
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ static void Main()
#endif
}
}
#region Expanded
#region Expanded by https://github.com/naminodarie/SourceExpander
namespace SampleLibrary { public static class Put { private static readonly Xorshift rnd = new Xorshift(); public static void WriteRandom() => Trace.WriteLine(rnd.Next()); } }
namespace SampleLibrary { public class Xorshift : Random { private uint x = 123456789; private uint y = 362436069; private uint z = 521288629; private uint w; private static readonly Random rnd = new Random(); public Xorshift() : this(rnd.Next()) { } public Xorshift(int seed) { w = (uint)seed; } protected override double Sample() => InternalSample() * (1.0 / uint.MaxValue); private uint InternalSample() { uint t = x ^ (x << 11); x = y; y = z; z = w; return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); } } }
#endregion Expanded
#endregion Expanded by https://github.com/naminodarie/SourceExpander
")
);

Expand Down Expand Up @@ -153,10 +153,10 @@ static void Main()
#endif
}
}
#region Expanded
#region Expanded by https://github.com/naminodarie/SourceExpander
namespace SampleLibrary { public static class Put { private static readonly Xorshift rnd = new Xorshift(); public static void WriteRandom() => Trace.WriteLine(rnd.Next()); } }
namespace SampleLibrary { public class Xorshift : Random { private uint x = 123456789; private uint y = 362436069; private uint z = 521288629; private uint w; private static readonly Random rnd = new Random(); public Xorshift() : this(rnd.Next()) { } public Xorshift(int seed) { w = (uint)seed; } protected override double Sample() => InternalSample() * (1.0 / uint.MaxValue); private uint InternalSample() { uint t = x ^ (x << 11); x = y; y = z; z = w; return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); } } }
#endregion Expanded
#endregion Expanded by https://github.com/naminodarie/SourceExpander
")
);

Expand Down
4 changes: 2 additions & 2 deletions Test/SourceExpander.Generator.Test/Generate/NotFound.Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ static void Main()
Console.WriteLine(42);
}
}
#region Expanded
#endregion Expanded
#region Expanded by https://github.com/naminodarie/SourceExpander
#endregion Expanded by https://github.com/naminodarie/SourceExpander
")
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ static void Main()
#endif
}
}
#region Expanded
#region Expanded by https://github.com/naminodarie/SourceExpander
namespace SampleLibrary { public static class Put { private static readonly Xorshift rnd = new Xorshift(); public static void WriteRandom() => Trace.WriteLine(rnd.Next()); } }
namespace SampleLibrary { public class Xorshift : Random { private uint x = 123456789; private uint y = 362436069; private uint z = 521288629; private uint w; private static readonly Random rnd = new Random(); public Xorshift() : this(rnd.Next()) { } public Xorshift(int seed) { w = (uint)seed; } protected override double Sample() => InternalSample() * (1.0 / uint.MaxValue); private uint InternalSample() { uint t = x ^ (x << 11); x = y; y = z; z = w; return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); } } }
#endregion Expanded
#endregion Expanded by https://github.com/naminodarie/SourceExpander
")
);

Expand Down
4 changes: 2 additions & 2 deletions Test/SourceExpander.Test/ExpandTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ static void Main()
Expander.Expand();
}
}
#region Expanded
#region Expanded by https://github.com/naminodarie/SourceExpander
namespace SourceExpander{public class Expander{[Conditional(""EXP"")]public static void Expand(string inputFilePath = null, string outputFilePath = null, bool ignoreAnyError = true){}public static string ExpandString(string inputFilePath = null, bool ignoreAnyError = true){return """";}}}
#endregion Expanded
#endregion Expanded by https://github.com/naminodarie/SourceExpander
")
);
}
Expand Down

0 comments on commit 6c5cccd

Please sign in to comment.