Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created June 10, 2015 15:06
Show Gist options
  • Save jnthn/cff4c17fcc6d7bd2ece3 to your computer and use it in GitHub Desktop.
Save jnthn/cff4c17fcc6d7bd2ece3 to your computer and use it in GitHub Desktop.
sub combi (*%attr)
{
if %attr<sep_char> eq %attr<quote_char> || %attr<sep_char> eq %attr<escape_char> {
say "INI - separator is equal to quote- or escape sequence" ~~ m{separator};
}
if %attr<allow_whitespace> and %attr<escape_char> ~~ m/^[ \t]/ {
}
}
my @special = ('"', "'", ",", ";", "\t", "\\", "~");
for ( False, True ) -> $aw {
for ( False, True ) -> $aq {
for ( @special ) -> $qc {
for ( @special, "+" ) -> $ec {
for ( @special, "\0" ) -> $sc {
combi(
sep_char => $sc,
quote_char => $qc,
escape_char => $ec,
allow_whitespace => $aw,
);
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment