Skip to content

Instantly share code, notes, and snippets.

@zaydek-old
Created August 8, 2017 21:30
Show Gist options
  • Save zaydek-old/4fe45c68fa471c6a7718751b39757d1d to your computer and use it in GitHub Desktop.
Save zaydek-old/4fe45c68fa471c6a7718751b39757d1d to your computer and use it in GitHub Desktop.
module od.meta;
/+
_this_
+/
enum _name_ = __FILE__[0 .. $ - 2];
enum _this_ =
q{
{
import std.regex, std.format;
return matchFirst(__FUNCTION__, ctRegex!(_name_ ~ `\.(.+)(\.__.+)$`))[1];
}()
};
/+
_sect_
+/
enum _sect_ =
q{
mixin(_this_) ~
{
import std.conv;
return "@" ~ to!(string)(__LINE__);
}()
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment