Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for CRLF line endings in filters #1673

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 84 additions & 84 deletions src/lexer.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,23 +437,23 @@ static yyconst YY_CHAR yy_meta[54] =
static yyconst flex_uint16_t yy_base[170] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
51, 52, 320, 321, 57, 59, 297, 321, 0, 321,
296, 321, 321, 295, 294, 293, 47, 47, 50, 292,
291, 290, 294, 0, 291, 48, 51, 53, 52, 37,
59, 57, 66, 56, 63, 68, 70, 72, 287, 0,
0, 321, 80, 90, 321, 0, 321, 321, 321, 321,
95, 99, 0, 106, 286, 321, 110, 321, 321, 321,
290, 0, 285, 281, 86, 77, 277, 97, 101, 111,
113, 115, 117, 274, 119, 120, 118, 121, 270, 122,
123, 124, 321, 0, 257, 321, 255, 0, 254, 249,

321, 245, 321, 0, 125, 239, 126, 127, 237, 128,
134, 234, 136, 143, 147, 148, 149, 152, 154, 232,
165, 212, 210, 157, 159, 158, 209, 208, 160, 161,
162, 163, 164, 166, 207, 196, 171, 205, 204, 174,
167, 175, 201, 170, 176, 190, 190, 184, 199, 194,
198, 197, 85, 78, 76, 321, 230, 239, 245, 250,
255, 264, 273, 278, 283, 285, 290, 294, 298
51, 52, 323, 324, 57, 60, 300, 324, 0, 324,
299, 324, 324, 298, 297, 296, 49, 49, 52, 295,
294, 293, 297, 0, 294, 53, 50, 37, 54, 55,
58, 56, 68, 63, 59, 70, 71, 75, 290, 0,
0, 324, 82, 115, 324, 0, 324, 324, 324, 324,
88, 96, 0, 107, 287, 324, 115, 324, 324, 324,
288, 0, 282, 279, 107, 108, 275, 110, 89, 115,
116, 119, 90, 272, 120, 122, 125, 126, 270, 131,
121, 123, 324, 0, 248, 324, 243, 0, 250, 245,

324, 243, 324, 0, 128, 239, 130, 134, 237, 132,
140, 227, 141, 145, 151, 148, 152, 155, 156, 215,
168, 204, 213, 160, 162, 167, 212, 211, 161, 163,
164, 166, 169, 172, 210, 199, 177, 208, 206, 178,
168, 176, 205, 179, 184, 194, 195, 181, 203, 199,
202, 171, 83, 79, 77, 324, 235, 244, 250, 255,
260, 269, 278, 283, 288, 290, 295, 299, 303
} ;

static yyconst flex_int16_t yy_def[170] =
Expand All @@ -478,94 +478,94 @@ static yyconst flex_int16_t yy_def[170] =
156, 156, 156, 156, 156, 156, 156, 156, 156
} ;

static yyconst flex_uint16_t yy_nxt[375] =
static yyconst flex_uint16_t yy_nxt[378] =
{ 0,
14, 15, 16, 14, 17, 18, 19, 20, 21, 22,
14, 15, 16, 15, 17, 18, 19, 20, 21, 22,
23, 24, 25, 20, 26, 27, 28, 29, 20, 20,
30, 31, 32, 33, 34, 35, 35, 22, 14, 23,
36, 37, 38, 39, 40, 41, 42, 35, 43, 35,
44, 45, 35, 46, 35, 47, 35, 48, 35, 35,
22, 49, 23, 51, 51, 74, 52, 52, 54, 54,
54, 54, 61, 65, 62, 62, 74, 62, 66, 74,
74, 74, 80, 64, 74, 74, 67, 74, 75, 53,
53, 74, 64, 79, 74, 67, 74, 87, 74, 96,
74, 54, 54, 76, 74, 74, 74, 77, 78, 81,

83, 82, 84, 74, 74, 90, 88, 85, 86, 91,
62, 106, 62, 89, 62, 74, 62, 92, 99, 74,
99, 67, 99, 100, 99, 67, 105, 102, 97, 74,
67, 74, 107, 74, 67, 74, 74, 74, 74, 74,
74, 74, 74, 74, 74, 74, 74, 109, 108, 112,
116, 110, 74, 115, 74, 117, 118, 125, 119, 111,
126, 74, 113, 114, 127, 74, 74, 74, 124, 128,
74, 129, 74, 120, 156, 74, 74, 74, 74, 74,
74, 74, 74, 132, 74, 74, 130, 131, 74, 74,
137, 140, 74, 74, 74, 139, 135, 133, 138, 145,

134, 147, 74, 143, 144, 151, 141, 148, 74, 150,
142, 152, 74, 97, 149, 74, 74, 74, 121, 74,
153, 154, 74, 74, 121, 74, 74, 74, 74, 155,
50, 50, 50, 50, 50, 50, 50, 50, 50, 56,
121, 56, 56, 56, 56, 56, 56, 56, 63, 63,
74, 63, 74, 63, 72, 74, 72, 74, 72, 73,
73, 73, 102, 73, 94, 94, 100, 94, 94, 94,
94, 102, 94, 95, 95, 95, 95, 95, 95, 95,
95, 95, 98, 121, 98, 121, 98, 122, 74, 122,
122, 123, 74, 123, 136, 74, 136, 136, 146, 104,

146, 146, 95, 74, 95, 95, 103, 101, 93, 74,
71, 70, 69, 68, 60, 59, 58, 57, 55, 156,
13, 156, 156, 156, 156, 156, 156, 156, 156, 156,
54, 54, 54, 54, 61, 65, 62, 62, 74, 62,
66, 74, 74, 74, 74, 64, 74, 74, 67, 53,
53, 74, 78, 75, 64, 79, 74, 67, 74, 74,
80, 96, 76, 74, 87, 74, 77, 74, 81, 83,

82, 74, 88, 62, 84, 62, 90, 74, 74, 85,
86, 62, 91, 62, 67, 89, 54, 54, 54, 99,
92, 99, 67, 67, 100, 74, 74, 99, 74, 99,
97, 67, 102, 74, 74, 113, 108, 74, 74, 74,
74, 74, 106, 74, 74, 107, 74, 105, 74, 74,
74, 109, 74, 112, 110, 115, 119, 116, 74, 74,
117, 125, 111, 74, 114, 118, 74, 126, 127, 74,
74, 124, 120, 74, 74, 128, 129, 156, 74, 74,
74, 74, 74, 132, 74, 74, 74, 74, 130, 74,
74, 131, 140, 137, 74, 74, 74, 74, 135, 74,

133, 138, 74, 134, 139, 145, 143, 147, 141, 144,
150, 148, 142, 74, 151, 149, 97, 74, 154, 152,
74, 74, 121, 74, 74, 153, 74, 121, 74, 74,
74, 74, 121, 74, 155, 50, 50, 50, 50, 50,
50, 50, 50, 50, 56, 74, 56, 56, 56, 56,
56, 56, 56, 63, 63, 74, 63, 74, 63, 72,
102, 72, 100, 72, 73, 73, 73, 102, 73, 94,
94, 121, 94, 94, 94, 94, 121, 94, 95, 95,
95, 95, 95, 95, 95, 95, 95, 98, 74, 98,
74, 98, 122, 74, 122, 122, 123, 104, 123, 136,

74, 136, 136, 146, 103, 146, 146, 95, 101, 95,
95, 93, 74, 71, 70, 69, 68, 60, 59, 58,
57, 55, 156, 13, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156
156, 156, 156, 156, 156, 156, 156
} ;

static yyconst flex_int16_t yy_chk[375] =
static yyconst flex_int16_t yy_chk[378] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 11, 12, 40, 11, 12, 15, 15,
16, 16, 27, 28, 27, 29, 36, 29, 28, 37,
39, 38, 40, 27, 44, 42, 29, 41, 36, 11,
12, 45, 27, 39, 43, 29, 46, 44, 47, 53,
48, 54, 54, 37, 155, 76, 154, 37, 38, 41,

42, 41, 43, 153, 75, 47, 45, 43, 43, 48,
61, 76, 61, 46, 62, 78, 62, 48, 64, 79,
64, 61, 67, 64, 67, 62, 75, 67, 53, 80,
61, 81, 78, 82, 62, 83, 87, 85, 86, 88,
90, 91, 92, 105, 107, 108, 110, 80, 79, 82,
87, 81, 111, 86, 113, 88, 90, 107, 91, 81,
108, 114, 83, 85, 110, 115, 116, 117, 105, 111,
118, 113, 119, 92, 121, 124, 126, 125, 129, 130,
131, 132, 133, 116, 134, 141, 114, 115, 144, 137,
124, 129, 140, 142, 145, 126, 119, 117, 125, 134,

118, 137, 148, 132, 133, 144, 130, 140, 147, 142,
131, 145, 150, 121, 141, 152, 151, 149, 146, 143,
147, 148, 139, 138, 136, 135, 128, 127, 123, 150,
157, 157, 157, 157, 157, 157, 157, 157, 157, 158,
122, 158, 158, 158, 158, 158, 158, 158, 159, 159,
120, 159, 112, 159, 160, 109, 160, 106, 160, 161,
161, 161, 102, 161, 162, 162, 100, 162, 162, 162,
162, 99, 162, 163, 163, 163, 163, 163, 163, 163,
163, 163, 164, 97, 164, 95, 164, 165, 89, 165,
165, 166, 84, 166, 167, 77, 167, 167, 168, 74,

168, 168, 169, 73, 169, 169, 71, 65, 49, 35,
33, 32, 31, 30, 26, 25, 24, 21, 17, 13,
1, 1, 1, 11, 12, 38, 11, 12, 15, 15,
15, 16, 16, 16, 27, 28, 27, 29, 37, 29,
28, 36, 39, 40, 42, 27, 41, 45, 29, 11,
12, 44, 38, 36, 27, 39, 43, 29, 46, 47,
40, 53, 37, 48, 44, 155, 37, 154, 41, 42,

41, 153, 45, 61, 43, 61, 47, 79, 83, 43,
43, 62, 48, 62, 61, 46, 54, 54, 54, 64,
48, 64, 62, 61, 64, 75, 76, 67, 78, 67,
53, 62, 67, 80, 81, 83, 79, 82, 85, 91,
86, 92, 76, 87, 88, 78, 105, 75, 107, 90,
110, 80, 108, 82, 81, 86, 91, 87, 111, 113,
88, 107, 81, 114, 85, 90, 116, 108, 110, 115,
117, 105, 92, 118, 119, 111, 113, 121, 124, 129,
125, 130, 131, 116, 132, 126, 141, 133, 114, 152,
134, 115, 129, 124, 142, 137, 140, 144, 119, 148,

117, 125, 145, 118, 126, 134, 132, 137, 130, 133,
142, 140, 131, 147, 144, 141, 121, 150, 148, 145,
151, 149, 146, 143, 139, 147, 138, 136, 135, 128,
127, 123, 122, 120, 150, 157, 157, 157, 157, 157,
157, 157, 157, 157, 158, 112, 158, 158, 158, 158,
158, 158, 158, 159, 159, 109, 159, 106, 159, 160,
102, 160, 100, 160, 161, 161, 161, 99, 161, 162,
162, 97, 162, 162, 162, 162, 95, 162, 163, 163,
163, 163, 163, 163, 163, 163, 163, 164, 89, 164,
84, 164, 165, 77, 165, 165, 166, 74, 166, 167,

73, 167, 167, 168, 71, 168, 168, 169, 65, 169,
169, 49, 35, 33, 32, 31, 30, 26, 25, 24,
21, 17, 13, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156
156, 156, 156, 156, 156, 156, 156
} ;

/* The intent behind this definition is that it'll catch
Expand Down Expand Up @@ -929,7 +929,7 @@ YY_DECL
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
while ( yy_base[yy_current_state] != 321 );
while ( yy_base[yy_current_state] != 324 );

yy_find_action:
yy_act = yy_accept[yy_current_state];
Expand Down
2 changes: 1 addition & 1 deletion src/lexer.l
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ struct lexer_param;
([a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]* { yylval->literal = jv_string(yytext); return IDENT;}
\.[a-zA-Z_][a-zA-Z_0-9]* { yylval->literal = jv_string(yytext+1); return FIELD;}

[ \n\t]+ {}
[ \r\n\t]+ {}

. { return INVALID_CHARACTER; }

Expand Down