Lines Matching refs:scan_string

18 json::lexer::token_type scan_string(const char* s, bool ignore_comments = false);
19 json::lexer::token_type scan_string(const char* s, const bool ignore_comments)
41 CHECK((scan_string("[") == json::lexer::token_type::begin_array));
42 CHECK((scan_string("]") == json::lexer::token_type::end_array));
43 CHECK((scan_string("{") == json::lexer::token_type::begin_object));
44 CHECK((scan_string("}") == json::lexer::token_type::end_object));
45 CHECK((scan_string(",") == json::lexer::token_type::value_separator));
46 CHECK((scan_string(":") == json::lexer::token_type::name_separator));
51 CHECK((scan_string("null") == json::lexer::token_type::literal_null));
52 CHECK((scan_string("true") == json::lexer::token_type::literal_true));
53 CHECK((scan_string("false") == json::lexer::token_type::literal_false));
58 CHECK((scan_string("0") == json::lexer::token_type::value_unsigned));
59 CHECK((scan_string("1") == json::lexer::token_type::value_unsigned));
60 CHECK((scan_string("2") == json::lexer::token_type::value_unsigned));
61 CHECK((scan_string("3") == json::lexer::token_type::value_unsigned));
62 CHECK((scan_string("4") == json::lexer::token_type::value_unsigned));
63 CHECK((scan_string("5") == json::lexer::token_type::value_unsigned));
64 CHECK((scan_string("6") == json::lexer::token_type::value_unsigned));
65 CHECK((scan_string("7") == json::lexer::token_type::value_unsigned));
66 CHECK((scan_string("8") == json::lexer::token_type::value_unsigned));
67 CHECK((scan_string("9") == json::lexer::token_type::value_unsigned));
69 CHECK((scan_string("-0") == json::lexer::token_type::value_integer));
70 CHECK((scan_string("-1") == json::lexer::token_type::value_integer));
72 CHECK((scan_string("1.1") == json::lexer::token_type::value_float));
73 CHECK((scan_string("-1.1") == json::lexer::token_type::value_float));
74 CHECK((scan_string("1E10") == json::lexer::token_type::value_float));
80 CHECK((scan_string(" ") == json::lexer::token_type::end_of_input));
81 CHECK((scan_string("\t") == json::lexer::token_type::end_of_input));
82 CHECK((scan_string("\n") == json::lexer::token_type::end_of_input));
83 CHECK((scan_string("\r") == json::lexer::token_type::end_of_input));
84 CHECK((scan_string(" \t\n\r\n\t ") == json::lexer::token_type::end_of_input));
115 const auto res = scan_string(s.c_str());
169 CHECK((scan_string(s.c_str()) == json::lexer::token_type::value_string));
174 CHECK((scan_string("/", false) == json::lexer::token_type::parse_error));
177 CHECK((scan_string("/!", false) == json::lexer::token_type::parse_error));
179 CHECK((scan_string("/*", false) == json::lexer::token_type::parse_error));
181 CHECK((scan_string("/**", false) == json::lexer::token_type::parse_error));
184 CHECK((scan_string("//", false) == json::lexer::token_type::parse_error));
186 CHECK((scan_string("/**/", false) == json::lexer::token_type::parse_error));
188 CHECK((scan_string("/** /", false) == json::lexer::token_type::parse_error));
191 CHECK((scan_string("/***/", false) == json::lexer::token_type::parse_error));
193 CHECK((scan_string("/* true */", false) == json::lexer::token_type::parse_error));
195 CHECK((scan_string("/*/**/", false) == json::lexer::token_type::parse_error));
197 CHECK((scan_string("/*/* */", false) == json::lexer::token_type::parse_error));
203 CHECK((scan_string("/", true) == json::lexer::token_type::parse_error));
206 CHECK((scan_string("/!", true) == json::lexer::token_type::parse_error));
208 CHECK((scan_string("/*", true) == json::lexer::token_type::parse_error));
210 CHECK((scan_string("/**", true) == json::lexer::token_type::parse_error));
213 CHECK((scan_string("//", true) == json::lexer::token_type::end_of_input));
214 CHECK((scan_string("/**/", true) == json::lexer::token_type::end_of_input));
215 CHECK((scan_string("/** /", true) == json::lexer::token_type::parse_error));
218 CHECK((scan_string("/***/", true) == json::lexer::token_type::end_of_input));
219 CHECK((scan_string("/* true */", true) == json::lexer::token_type::end_of_input));
220 CHECK((scan_string("/*/**/", true) == json::lexer::token_type::end_of_input));
221 CHECK((scan_string("/*/* */", true) == json::lexer::token_type::end_of_input));
223 CHECK((scan_string("//\n//\n", true) == json::lexer::token_type::end_of_input));
224 CHECK((scan_string("/**//**//**/", true) == json::lexer::token_type::end_of_input));