about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-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();
 }