Fix handling of empty C++ comments in JSON parsing

When AOS parses a JSON file, it first performs some preprocessing
to remove comments before passing the document to the real parser.
The removal of C++ style comments using // had a corner case.  If
you had a comment that had no content, just //\n, then the \n was
being swallowed and the next line was commented out too.
This change reorganizes the handling of C++ comments to allow this
to be correctly handled, including if the document ends with an
empty comment.

Change-Id: Id2874faafd21e68d8926c42c9cda3581c02069a7
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/json_tokenizer.cc b/aos/json_tokenizer.cc
index d277c1e..32c9247 100644
--- a/aos/json_tokenizer.cc
+++ b/aos/json_tokenizer.cc
@@ -27,14 +27,17 @@
       // C++ style comment.  Keep consuming chars until newline, or until the
       // end of the file if this is the last line (no newline at end of file).
       while (true) {
-        ConsumeChar();
+        // First check if we are at the end of the file.
         if (AtEnd()) {
           return;
         }
+        // Then check if we are at the end of the line.
         if (Char() == '\n') {
           ++linenumber_;
           break;
         }
+        // Advance to next character and repeat.
+        ConsumeChar();
       }
     } else {
       // There is no fail.  Once we are out of whitespace (including 0 of it),