Skip to content

Instantly share code, notes, and snippets.

@timo
Created November 1, 2017 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timo/8c1c395114765624803e5ea8ed223e55 to your computer and use it in GitHub Desktop.
Save timo/8c1c395114765624803e5ea8ed223e55 to your computer and use it in GitHub Desktop.
potential fix for YAMLish, but it's ugly
diff --git a/lib/YAMLish.pm6 b/lib/YAMLish.pm6
index 0848ed4..ca200ce 100644
--- a/lib/YAMLish.pm6
+++ b/lib/YAMLish.pm6
@@ -451,7 +451,11 @@ grammar Grammar {
make ~$/;
}
method single-quoted($/) {
- make $<value>.Str.subst(/<Grammar::foldable-whitespace>/, ' ', :g).subst("''", "'", :g);
+ my $value = $<value>.Str;
+ make do {
+ my $/;
+ $value.subst(/<Grammar::foldable-whitespace>/, ' ', :g).subst("''", "'", :g);
+ }
}
method single-key($/) {
make $<value>.Str.subst("''", "'", :g);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment