Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Knot DNS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
23
Issues
23
List
Boards
Labels
Milestones
Merge Requests
5
Merge Requests
5
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Knot projects
Knot DNS
Commits
779b7566
Commit
779b7566
authored
May 11, 2015
by
Daniel Salzman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
yparser: add CR+LF support + cleanup
parent
15ced159
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
83 deletions
+94
-83
src/libknot/yparser/ypbody.c
src/libknot/yparser/ypbody.c
+88
-77
src/libknot/yparser/ypbody.rl
src/libknot/yparser/ypbody.rl
+6
-6
No files found.
src/libknot/yparser/ypbody.c
View file @
779b7566
...
@@ -26,115 +26,126 @@
...
@@ -26,115 +26,126 @@
// Include parser static data (Ragel internals).
// Include parser static data (Ragel internals).
static
const
char
_yparser_actions
[]
=
{
static
const
char
_yparser_actions
[]
=
{
0
,
1
,
0
,
1
,
1
,
1
,
3
,
1
,
0
,
1
,
0
,
1
,
1
,
1
,
2
,
1
,
4
,
1
,
5
,
1
,
7
,
1
,
8
,
1
,
3
,
1
,
4
,
1
,
5
,
1
,
7
,
1
,
9
,
1
,
10
,
1
,
11
,
1
,
14
,
2
,
8
,
1
,
9
,
1
,
10
,
1
,
11
,
1
,
1
,
0
,
2
,
1
,
2
,
2
,
3
,
4
,
14
,
2
,
1
,
0
,
2
,
1
,
2
,
2
,
2
,
5
,
0
,
2
,
6
,
7
,
2
,
11
,
2
,
0
,
2
,
3
,
4
,
2
,
5
,
0
,
12
,
2
,
13
,
11
,
3
,
1
,
2
,
0
,
2
,
6
,
7
,
2
,
11
,
12
,
2
,
13
,
3
,
1
,
6
,
7
,
3
,
1
,
11
,
12
,
11
,
3
,
1
,
2
,
0
,
3
,
1
,
6
,
3
,
1
,
13
,
11
,
4
,
1
,
2
,
6
,
7
,
3
,
1
,
11
,
12
,
3
,
1
,
13
,
7
,
4
,
1
,
2
,
11
,
12
,
4
,
1
,
11
,
3
,
2
,
6
,
7
,
3
,
2
,
11
,
2
,
13
,
11
12
,
3
,
2
,
13
,
11
,
4
,
1
,
2
,
6
,
7
,
4
,
1
,
2
,
11
,
12
,
4
,
1
,
2
,
13
,
11
};
};
static
const
unsigned
char
_yparser_key_offsets
[]
=
{
static
const
unsigned
char
_yparser_key_offsets
[]
=
{
0
,
0
,
1
0
,
11
,
12
,
19
,
28
,
30
,
0
,
0
,
1
1
,
13
,
14
,
21
,
30
,
32
,
3
1
,
41
,
51
,
60
,
62
,
64
,
75
,
78
,
3
3
,
43
,
54
,
63
,
65
,
68
,
80
,
83
,
8
0
,
83
,
84
,
94
,
102
,
105
,
107
,
110
,
8
6
,
90
,
92
,
102
,
110
,
113
,
116
,
119
,
1
13
,
122
,
132
,
142
1
22
,
131
,
142
,
153
,
164
};
};
static
const
char
_yparser_trans_keys
[]
=
{
static
const
char
_yparser_trans_keys
[]
=
{
10
,
32
,
35
,
45
,
48
,
57
,
65
,
90
,
10
,
13
,
32
,
35
,
45
,
48
,
57
,
65
,
97
,
122
,
10
,
32
,
32
,
48
,
57
,
65
,
90
,
97
,
122
,
10
,
13
,
32
,
32
,
48
,
90
,
97
,
122
,
32
,
45
,
58
,
48
,
57
,
57
,
65
,
90
,
97
,
122
,
32
,
45
,
58
,
65
,
90
,
97
,
122
,
32
,
58
,
32
,
32
,
48
,
57
,
65
,
90
,
97
,
122
,
32
,
58
,
33
,
34
,
92
,
36
,
43
,
45
,
90
,
94
,
32
,
32
,
33
,
34
,
92
,
36
,
43
,
45
,
126
,
10
,
32
,
33
,
92
,
36
,
43
,
45
,
90
,
94
,
126
,
10
,
13
,
32
,
33
,
92
,
90
,
94
,
126
,
32
,
45
,
58
,
48
,
57
,
36
,
43
,
45
,
90
,
94
,
126
,
32
,
45
,
65
,
90
,
97
,
122
,
32
,
58
,
10
,
32
,
58
,
48
,
57
,
65
,
90
,
97
,
122
,
32
,
10
,
32
,
34
,
35
,
91
,
33
,
43
,
45
,
58
,
10
,
13
,
32
,
10
,
13
,
32
,
34
,
92
,
94
,
126
,
34
,
32
,
126
,
10
,
32
,
35
,
91
,
33
,
43
,
45
,
92
,
94
,
126
,
10
,
32
,
35
,
10
,
32
,
33
,
34
,
92
,
34
,
32
,
126
,
10
,
13
,
32
,
10
,
13
,
32
,
35
,
10
,
13
,
32
,
33
,
34
,
92
,
36
,
43
,
45
,
90
,
94
,
126
,
32
,
33
,
36
,
43
,
45
,
90
,
94
,
126
,
32
,
33
,
44
,
93
,
36
,
90
,
92
,
126
,
32
,
44
,
44
,
93
,
36
,
90
,
92
,
126
,
32
,
44
,
93
,
10
,
32
,
34
,
32
,
126
,
32
,
44
,
93
,
10
,
13
,
32
,
34
,
32
,
126
,
32
,
93
,
32
,
45
,
58
,
48
,
57
,
65
,
90
,
44
,
93
,
32
,
45
,
58
,
48
,
57
,
65
,
97
,
122
,
10
,
32
,
35
,
45
,
48
,
57
,
90
,
97
,
122
,
10
,
13
,
32
,
35
,
45
,
65
,
90
,
97
,
122
,
10
,
32
,
35
,
45
,
48
,
57
,
65
,
90
,
97
,
122
,
10
,
13
,
48
,
57
,
65
,
90
,
97
,
122
,
10
,
32
,
32
,
35
,
45
,
48
,
57
,
65
,
90
,
97
,
35
,
45
,
48
,
57
,
65
,
90
,
97
,
122
,
122
,
10
,
13
,
32
,
35
,
45
,
48
,
57
,
0
65
,
90
,
97
,
122
,
10
,
13
,
32
,
35
,
45
,
48
,
57
,
65
,
90
,
97
,
122
,
0
};
};
static
const
char
_yparser_single_lengths
[]
=
{
static
const
char
_yparser_single_lengths
[]
=
{
0
,
4
,
1
,
1
,
1
,
3
,
2
,
1
,
0
,
5
,
2
,
1
,
1
,
3
,
2
,
1
,
4
,
4
,
3
,
2
,
2
,
5
,
1
,
2
,
4
,
5
,
3
,
2
,
3
,
6
,
1
,
3
,
3
,
1
,
4
,
4
,
3
,
2
,
1
,
3
,
4
,
2
,
4
,
4
,
3
,
3
,
1
,
3
,
3
,
4
,
4
,
4
3
,
5
,
5
,
5
,
5
};
};
static
const
char
_yparser_range_lengths
[]
=
{
static
const
char
_yparser_range_lengths
[]
=
{
0
,
3
,
0
,
0
,
3
,
3
,
0
,
0
,
0
,
3
,
0
,
0
,
3
,
3
,
0
,
0
,
3
,
3
,
3
,
0
,
0
,
3
,
1
,
0
,
3
,
3
,
3
,
0
,
0
,
3
,
1
,
0
,
0
,
0
,
3
,
2
,
0
,
0
,
1
,
0
,
0
,
0
,
3
,
2
,
0
,
0
,
1
,
0
,
3
,
3
,
3
,
3
3
,
3
,
3
,
3
,
3
};
};
static
const
unsigned
char
_yparser_index_offsets
[]
=
{
static
const
unsigned
char
_yparser_index_offsets
[]
=
{
0
,
0
,
8
,
10
,
12
,
17
,
24
,
27
,
0
,
0
,
9
,
12
,
14
,
19
,
26
,
29
,
29
,
37
,
45
,
52
,
55
,
58
,
67
,
70
,
31
,
39
,
48
,
55
,
58
,
62
,
72
,
75
,
7
3
,
77
,
79
,
87
,
94
,
98
,
101
,
104
,
7
9
,
84
,
87
,
95
,
102
,
106
,
110
,
113
,
1
08
,
115
,
123
,
13
1
1
17
,
124
,
133
,
142
,
15
1
};
};
static
const
char
_yparser_indicies
[]
=
{
static
const
char
_yparser_indicies
[]
=
{
1
,
2
,
3
,
4
,
5
,
5
,
5
,
0
,
1
,
2
,
3
,
4
,
5
,
6
,
6
,
6
,
1
,
3
,
6
,
0
,
6
,
7
,
7
,
7
,
0
,
1
,
2
,
4
,
7
,
0
,
7
,
8
,
0
,
8
,
9
,
10
,
9
,
9
,
9
,
0
,
8
,
8
,
0
,
9
,
10
,
11
,
10
,
10
,
11
,
12
,
0
,
13
,
0
,
13
,
14
,
15
,
10
,
0
,
12
,
13
,
0
,
14
,
0
,
14
,
14
,
14
,
14
,
14
,
0
,
16
,
17
,
18
,
15
,
16
,
15
,
15
,
15
,
15
,
0
,
17
,
18
,
18
,
18
,
18
,
0
,
19
,
20
,
21
,
18
,
19
,
20
,
20
,
20
,
20
,
20
,
0
,
20
,
20
,
20
,
0
,
22
,
23
,
0
,
24
,
21
,
22
,
23
,
22
,
22
,
22
,
0
,
24
,
25
,
0
,
24
,
25
,
15
,
26
,
27
,
14
,
25
,
0
,
26
,
27
,
28
,
0
,
26
,
27
,
14
,
14
,
0
,
29
,
28
,
0
,
16
,
17
,
28
,
16
,
29
,
30
,
15
,
15
,
15
,
0
,
0
,
24
,
30
,
26
,
0
,
24
,
26
,
27
,
32
,
31
,
0
,
17
,
18
,
19
,
0
,
26
,
31
,
32
,
31
,
31
,
31
,
31
,
0
,
33
,
27
,
33
,
29
,
0
,
26
,
27
,
29
,
30
,
34
,
35
,
36
,
34
,
34
,
0
,
37
,
27
,
34
,
35
,
34
,
34
,
34
,
34
,
0
,
36
,
38
,
0
,
24
,
30
,
0
,
40
,
39
,
0
,
37
,
38
,
39
,
37
,
37
,
0
,
40
,
30
,
33
,
35
,
36
,
0
,
41
,
42
,
43
,
42
,
41
,
0
,
26
,
27
,
33
,
0
,
43
,
42
,
42
,
42
,
0
,
1
,
2
,
3
,
4
,
44
,
0
,
36
,
38
,
39
,
0
,
44
,
45
,
46
,
44
,
44
,
0
,
45
,
46
,
47
,
48
,
49
,
45
,
45
,
45
,
0
,
1
,
2
,
3
,
4
,
49
,
49
,
0
,
50
,
51
,
52
,
53
,
54
,
5
,
47
,
47
,
47
,
0
,
48
,
49
,
50
,
54
,
54
,
0
,
0
51
,
52
,
53
,
53
,
53
,
0
,
54
,
55
,
56
,
57
,
58
,
59
,
59
,
59
,
0
,
60
,
61
,
62
,
63
,
64
,
65
,
65
,
65
,
0
,
0
};
};
static
const
char
_yparser_trans_targs
[]
=
{
static
const
char
_yparser_trans_targs
[]
=
{
0
,
26
,
1
,
2
,
3
,
24
,
4
,
5
,
0
,
26
,
27
,
1
,
2
,
3
,
24
,
4
,
6
,
5
,
7
,
6
,
7
,
8
,
9
,
14
,
5
,
6
,
5
,
7
,
6
,
7
,
8
,
9
,
27
,
16
,
9
,
11
,
10
,
12
,
11
,
12
,
14
,
28
,
25
,
16
,
9
,
11
,
10
,
12
,
27
,
13
,
17
,
18
,
14
,
15
,
16
,
19
,
11
,
12
,
28
,
25
,
13
,
17
,
18
,
14
,
22
,
20
,
19
,
18
,
21
,
20
,
21
,
22
,
15
,
16
,
19
,
22
,
20
,
19
,
18
,
21
,
23
,
11
,
24
,
12
,
10
,
26
,
1
,
2
,
20
,
21
,
22
,
23
,
11
,
24
,
12
,
10
,
3
,
10
,
26
,
1
,
2
,
3
,
10
26
,
27
,
1
,
2
,
3
,
10
,
26
,
27
,
1
,
2
,
3
,
10
,
26
,
27
,
1
,
2
,
3
,
10
};
};
static
const
char
_yparser_trans_actions
[]
=
{
static
const
char
_yparser_trans_actions
[]
=
{
21
,
1
,
38
,
0
,
41
,
35
,
19
,
35
,
23
,
1
,
0
,
43
,
0
,
46
,
40
,
21
,
17
,
11
,
17
,
0
,
0
,
0
,
29
,
5
,
40
,
19
,
13
,
19
,
0
,
0
,
0
,
34
,
32
,
9
,
7
,
13
,
11
,
13
,
0
,
0
,
7
,
37
,
11
,
11
,
9
,
15
,
13
,
15
,
1
,
0
,
0
,
0
,
7
,
0
,
0
,
29
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
9
,
5
,
9
,
7
,
9
,
9
,
0
,
0
,
7
,
0
,
0
,
34
,
7
,
11
,
9
,
11
,
11
,
0
,
15
,
11
,
15
,
35
,
44
,
65
,
26
,
0
,
0
,
9
,
0
,
17
,
13
,
17
,
40
,
70
,
60
,
23
,
52
,
3
,
56
,
48
49
,
28
,
82
,
28
,
87
,
77
,
31
,
5
,
69
,
5
,
73
,
65
,
25
,
3
,
57
,
3
,
61
,
53
};
};
static
const
char
_yparser_eof_actions
[]
=
{
static
const
char
_yparser_eof_actions
[]
=
{
0
,
2
1
,
21
,
21
,
21
,
21
,
21
,
21
,
0
,
2
3
,
23
,
23
,
23
,
23
,
23
,
23
,
2
1
,
21
,
21
,
21
,
21
,
21
,
21
,
21
,
2
3
,
23
,
23
,
23
,
23
,
23
,
23
,
23
,
2
1
,
21
,
21
,
21
,
21
,
21
,
21
,
21
,
2
3
,
23
,
23
,
23
,
23
,
23
,
23
,
23
,
2
1
,
0
,
26
,
3
2
3
,
0
,
28
,
5
,
3
};
};
...
...
src/libknot/yparser/ypbody.rl
View file @
779b7566
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
parser->event = YP_ENULL;
parser->event = YP_ENULL;
parser->processed = false;
parser->processed = false;
}
}
newline_char = '\n' >_newline_init %_newline;
newline_char = '\n' >_newline_init %_newline
| '\r'
;
# Comment processing.
# Comment processing.
comment_char = '#';
comment_char = '#';
...
@@ -133,13 +133,13 @@
...
@@ -133,13 +133,13 @@
}
}
parser->indent = 0;
parser->indent = 0;
}
}
key_name = (alnum . (
"-"
| alnum)*) >_key_init $_key;
key_name = (alnum . (
'-'
| alnum)*) >_key_init $_key;
key0 = key_name %_key0_exit;
key0 = key_name %_key0_exit;
key1 = sep $_indent . key_name %_key1_exit;
key1 = sep $_indent . key_name %_key1_exit;
id = ((sep $_id)? .
"-"
>_dash_init . sep) $_indent . key_name %_id_exit;
id = ((sep $_id)? .
'-'
>_dash_init . sep) $_indent . key_name %_id_exit;
item = (((key0 . sep? .
":"
. (sep . (item_data_list | item_data))?)
item = (((key0 . sep? .
':'
. (sep . (item_data_list | item_data))?)
|(key1 . sep? .
":"
. (sep . (item_data_list | item_data))?)
|(key1 . sep? .
':'
. (sep . (item_data_list | item_data))?)
|(id . sep? .
":"
. sep . item_data)
|(id . sep? .
':'
. sep . item_data)
) . rest
) . rest
);
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment