From 31feab605306122fa39c9b63a2dd94e0b2a08efa Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Sat, 28 Aug 2010 22:14:09 +0000 Subject: [PATCH] Fix to parsing of single-line comments where the comment at the end of a line was merging statements separated by a single line comment --- include/chaiscript/language/chaiscript_parser.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/chaiscript/language/chaiscript_parser.hpp b/include/chaiscript/language/chaiscript_parser.hpp index 49bdb2b0..d702de48 100644 --- a/include/chaiscript/language/chaiscript_parser.hpp +++ b/include/chaiscript/language/chaiscript_parser.hpp @@ -211,9 +211,12 @@ namespace chaiscript } else if (Symbol_(singleline_comment.c_str())) { while (input_pos != input_end) { - if (Symbol_("\r\n") || Char_('\n')) { - ++line; - col = 1; + if (Symbol_("\r\n")) { + input_pos -= 2; + break; + } + else if (Char_('\n')) { + --input_pos; break; } else {