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 2494
2494
},
2495
2495
{
2496
2496
"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
+ }
2498
2504
},
2499
2505
{
2500
2506
"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
+ }
2502
2514
},
2503
2515
{
2504
2516
"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
+ }
2506
2524
},
2507
2525
{
2508
2526
"pattern" : [{}],
Original file line number Diff line number Diff line change @@ -160,6 +160,13 @@ pub fn tokenize(
160
160
) ;
161
161
continue ;
162
162
}
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
+ }
163
170
if tokenizer. code_point == Some ( '{' ) {
164
171
tokenizer. add_token_with_default_pos_and_len ( TokenType :: Open ) ;
165
172
continue ;
You can’t perform that action at this time.
0 commit comments