From 957ca9c955751d4454e7b4095f903eead9b678cc Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 9 Oct 2015 20:03:18 -0700 Subject: 2269 Another bugfix. Thanks Jack and Caleb Couch. --- 081run_interactive.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/081run_interactive.cc b/081run_interactive.cc index 81c49d42..dc46cf1f 100644 --- a/081run_interactive.cc +++ b/081run_interactive.cc @@ -286,6 +286,17 @@ get x:number, foo:offset] +mem: storing 110 in location 14 # ... +:(scenario run_interactive_with_comment) +recipe main [ + # 2 instructions, with a comment after the first + 1:address:array:number <- new [a:number <- copy 0 # abc +b:number <- copy 0 +] + 2:address:array:character, 3:address:array:character <- run-interactive 1:address:array:character +] +# no errors ++mem: storing 0 in location 3 + :(before "End Globals") string Most_recent_products; :(before "End Setup") @@ -330,7 +341,7 @@ string strip_comments(string in) { result << in.at(i); } else { - while (i < SIZE(in) && in.at(i) != '\n') + while (i+1 < SIZE(in) && in.at(i+1) != '\n') ++i; } } -- cgit 1.4.1-2-gfad0