Created
September 4, 2018 19:28
-
-
Save zorael/f4a5f37a5bccdcb16539cc0c27d8f1f9 to your computer and use it in GitHub Desktop.
gdc internal compiler error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module segfault; | |
struct Foo {} | |
struct Bar | |
{ | |
string configFile; | |
} | |
Bar settings; | |
void meldSettingsFromFile() | |
{ | |
Foo temp; | |
settings.configFile.readConfigInto(temp); | |
} | |
string[][string] readConfigInto(T)(string configFile, T things) | |
{ | |
return configFile.applyConfiguration(things); | |
} | |
string[][string] applyConfiguration(Range, Things...)(Range, Things things) | |
{ | |
import std.regex; | |
string section; | |
string[][string] invalidEntries; | |
string line; | |
switch (line) | |
{ | |
default: | |
enum pattern = r"^(?P<entry>\w+)\s+(?P<value>.+)"; | |
auto hits = line.matchFirst(pattern); | |
thingloop: | |
foreach (i; things) | |
{ | |
switch (hits["entry"]) | |
{ | |
continue thingloop; | |
default: | |
} | |
} | |
} | |
return invalidEntries; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment