File tree Expand file tree Collapse file tree 2 files changed +28
-3
lines changed
Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 24942494 },
24952495 {
24962496 "pattern" : [{ "hostname" : " bad\n hostname" }],
2497- "expected_obj" : " error"
2497+ "inputs" : [{ "hostname" : " badhostname" }],
2498+ "expected_obj" : {
2499+ "hostname" : " badhostname"
2500+ },
2501+ "expected_match" : {
2502+ "hostname" : { "input" : " badhostname" , "groups" : {} }
2503+ }
24982504 },
24992505 {
25002506 "pattern" : [{ "hostname" : " bad\r hostname" }],
2501- "expected_obj" : " error"
2507+ "inputs" : [{ "hostname" : " badhostname" }],
2508+ "expected_obj" : {
2509+ "hostname" : " badhostname"
2510+ },
2511+ "expected_match" : {
2512+ "hostname" : { "input" : " badhostname" , "groups" : {} }
2513+ }
25022514 },
25032515 {
25042516 "pattern" : [{ "hostname" : " bad\t hostname" }],
2505- "expected_obj" : " error"
2517+ "inputs" : [{ "hostname" : " badhostname" }],
2518+ "expected_obj" : {
2519+ "hostname" : " badhostname"
2520+ },
2521+ "expected_match" : {
2522+ "hostname" : { "input" : " badhostname" , "groups" : {} }
2523+ }
25062524 },
25072525 {
25082526 "pattern" : [{}],
Original file line number Diff line number Diff line change @@ -160,6 +160,13 @@ pub fn tokenize(
160160 ) ;
161161 continue ;
162162 }
163+ if tokenizer. code_point == Some ( '\n' ) ||
164+ tokenizer. code_point == Some ( '\r' ) ||
165+ tokenizer. code_point == Some ( '\t' ) {
166+ // ignore newline, carriage return and tab
167+ tokenizer. index = tokenizer. next_index ;
168+ continue ;
169+ }
163170 if tokenizer. code_point == Some ( '{' ) {
164171 tokenizer. add_token_with_default_pos_and_len ( TokenType :: Open ) ;
165172 continue ;
You can’t perform that action at this time.
0 commit comments