 
                     result_inline_comment = @regex.inline_comment.exec query.slice i
                     if result_inline_comment?
-                        to_skip = result_inline_comment[0].length-1
+                        result_query += query.slice(start, i).replace(/\n/g, '\\\\n')
+                        start = i
+                        to_skip = result_inline_comment[0].length
                         continue
                     result_multiple_line_comment = @regex.multiple_line_comment.exec query.slice i
                     if result_multiple_line_comment?
-                        to_skip = result_multiple_line_comment[0].length-1
+                        result_query += query.slice(start, i).replace(/\n/g, '\\\\n')
+                        start = i
+                        to_skip = result_multiple_line_comment[0].length
                         continue
             if is_parsing_string
                 result_query += query.slice(start, i).replace(/\n/g, '\\\\n')

            for char, i in query
                if to_skip > 0
                    to_skip--
                    continue

                if is_parsing_string is true

        #   world')
        # becomes
        #   r.expr('hello\nworld')
        #  We also remove comments from the query
        clean_query: (query) ->
            is_parsing_string = false
            start = 0

