]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2373] some more comment updates
authorJINMEI Tatuya <jinmei@isc.org>
Thu, 15 Nov 2012 03:16:04 +0000 (19:16 -0800)
committerJINMEI Tatuya <jinmei@isc.org>
Thu, 15 Nov 2012 03:16:04 +0000 (19:16 -0800)
src/lib/dns/master_lexer.cc
src/lib/dns/tests/master_lexer_state_unittest.cc

index 7d79e0d063652bb6623e08fcae10f25b1cca886c..185df8b0787ad16dc04cdb55d8944effffaf3b82 100644 (file)
@@ -64,9 +64,13 @@ struct MasterLexer::MasterLexerImpl {
     }
 
     bool isTokenEnd(int c, bool escaped) {
+        // Special case of EOF (end of stream); this is not in the bitmaps
         if (c == InputSource::END_OF_STREAM) {
             return (true);
         }
+        // In this implementation we only ensure the behavior for unsigned
+        // range of characters, so we restrict the range of the values up to
+        // 0x7f = 127
         return (escaped ? esc_separators_.test(c & 0x7f) :
                 separators_.test(c & 0x7f));
     }
@@ -84,7 +88,7 @@ struct MasterLexer::MasterLexerImpl {
     // Bitmaps that gives whether a given (positive) character should be
     // considered a separator of a string/number token.  The esc_ version
     // is a subset of the other, excluding characters that can be ignored
-    // if escaped by a backslash.
+    // if escaped by a backslash.  See isTokenEnd() for the bitmap size.
     std::bitset<128> separators_;
     std::bitset<128> esc_separators_;
 };
index 5c3be03009a01c14dfc8e65288afd4753c608081..f64ab79af67f666e189289d799223187db1a4135 100644 (file)
@@ -255,6 +255,8 @@ TEST_F(MasterLexerStateTest, crlf) {
     EXPECT_EQ(Token::END_OF_FILE, s_crlf.getToken(lexer).getType());
 }
 
+// Commonly used check for string related test cases, checking if the given
+// token has expected values.
 void
 stringTokenCheck(const std::string& expected, const MasterLexer::Token& token,
                  bool quoted = false)