about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-01-18 16:37:56 -0800
committerKartik K. Agaram <vc@akkartik.com>2016-01-18 16:37:56 -0800
commitd5f89e0facc8bdfd93d6e487c90cd450ee21a2e8 (patch)
tree74bfd0d32495beb8b2d170a8dbf947e63089ac69
parent4821d76f1e4ddfb51b5b162a453544367bdaaee3 (diff)
downloadmu-d5f89e0facc8bdfd93d6e487c90cd450ee21a2e8.tar.gz
2568
-rw-r--r--054dilated_reagent.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/054dilated_reagent.cc b/054dilated_reagent.cc
index 6788becc..76de7157 100644
--- a/054dilated_reagent.cc
+++ b/054dilated_reagent.cc
@@ -16,6 +16,22 @@ recipe main [
 ]
 # successfully parsed
 
+:(scenarios run)
+:(scenario dilated_reagent_with_comment)
+% Hide_errors = true;
+recipe main [
+  {1: number, foo: bar} <- copy 34  # test comment
+]
++parse:   product: {"1": "number", "foo": "bar"}
+$error: 0
+
+:(scenario dilated_reagent_with_comment_immediately_following)
+% Hide_errors = true;
+recipe main [
+  1:number <- copy {34: literal}  # test comment
+]
+$error: 0
+
 //: First augment next_word to group balanced brackets together.
 
 :(before "End next_word Special-cases")
@@ -71,6 +87,7 @@ string slurp_balanced_bracket(istream& in) {
     result << c;
     if (open_brackets.empty()) break;
   }
+  skip_whitespace_and_comments_but_not_newline(in);
   return result.str();
 }