line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# This module was GENERATED! |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# By https://github.com/ingydotnet/yaml-parser-pm |
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
69642
|
use v5.12; |
|
2
|
|
|
|
|
16
|
|
6
|
|
|
|
|
|
|
package YAML::Parser; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.0.3'; |
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
912
|
use XXX; |
|
2
|
|
|
|
|
2676
|
|
|
2
|
|
|
|
|
9
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
2
|
|
|
2
|
0
|
115
|
my ($class, %self) = @_; |
14
|
|
|
|
|
|
|
|
15
|
2
|
|
|
|
|
9
|
my $self = bless { |
16
|
|
|
|
|
|
|
%self, |
17
|
|
|
|
|
|
|
}, $class; |
18
|
|
|
|
|
|
|
|
19
|
2
|
100
|
|
|
|
16
|
if (not defined $self->{receiver}) { |
20
|
1
|
|
|
|
|
4
|
$self->{events} = []; |
21
|
|
|
|
|
|
|
$self->{receiver} = PerlYamlReferenceParserReceiver->new( |
22
|
|
|
|
|
|
|
callback => sub { |
23
|
13
|
|
|
13
|
|
21
|
my ($event) = @_; |
24
|
13
|
|
|
|
|
18
|
push @{$self->{events}}, $event; |
|
13
|
|
|
|
|
43
|
|
25
|
|
|
|
|
|
|
}, |
26
|
1
|
|
|
|
|
10
|
); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
2
|
|
|
|
|
7
|
return $self; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub parse { |
33
|
2
|
|
|
2
|
0
|
17
|
my ($self, $yaml_string) = @_; |
34
|
|
|
|
|
|
|
$self->{parser} = PerlYamlReferenceParserParser->new( |
35
|
|
|
|
|
|
|
$self->{receiver}, |
36
|
2
|
|
|
|
|
16
|
); |
37
|
2
|
|
|
|
|
13
|
$self->{parser}->parse($yaml_string); |
38
|
2
|
|
|
|
|
16
|
return $self; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub receiver { |
42
|
1
|
|
|
1
|
0
|
3
|
my ($self) = @_; |
43
|
1
|
|
|
|
|
8
|
return $self->{parser}{receiver}; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub events { |
47
|
1
|
|
|
1
|
0
|
4
|
my ($self) = @_; |
48
|
1
|
|
|
|
|
2
|
return @{$self->{events}}; |
|
1
|
|
|
|
|
6
|
|
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
BEGIN { |
52
|
2
|
|
|
2
|
|
654
|
$INC{'PerlYamlReferenceParserParser.pm'} = __FILE__; |
53
|
2
|
|
|
|
|
5
|
$INC{'PerlYamlReferenceParserGrammar.pm'} = __FILE__; |
54
|
2
|
|
|
|
|
56
|
$INC{'PerlYamlReferenceParserPrelude.pm'} = __FILE__; |
55
|
|
|
|
|
|
|
}; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
### INCLUDE code from yaml-reference-parser/perl/lib/ |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
BEGIN { |
62
|
|
|
|
|
|
|
|
63
|
2
|
|
|
2
|
|
32
|
use v5.12; |
|
2
|
|
|
|
|
7
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
package PerlYamlReferenceParserFunc; |
66
|
|
|
|
|
|
|
use overload |
67
|
104
|
|
|
104
|
|
247
|
eq => sub { 0 }, |
68
|
2
|
|
|
2
|
|
1206
|
bool => sub { 1 }; |
|
2
|
|
|
0
|
|
1035
|
|
|
2
|
|
|
|
|
18
|
|
|
0
|
|
|
|
|
0
|
|
69
|
|
|
|
|
|
|
sub new { |
70
|
9186
|
|
|
9186
|
|
15636
|
my ($class, $func, $name, $trace, $num) = @_; |
71
|
9186
|
|
66
|
|
|
55189
|
bless { |
72
|
|
|
|
|
|
|
func => $func, |
73
|
|
|
|
|
|
|
name => $name, |
74
|
|
|
|
|
|
|
trace => $trace || $name, |
75
|
|
|
|
|
|
|
num => $num, |
76
|
|
|
|
|
|
|
receivers => undef, |
77
|
|
|
|
|
|
|
}, $class; |
78
|
|
|
|
|
|
|
} |
79
|
0
|
|
|
0
|
|
0
|
sub TO_JSON { $_[0]->{func} } |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
package PerlYamlReferenceParserPrelude; |
82
|
|
|
|
|
|
|
|
83
|
2
|
|
|
2
|
|
1255
|
use boolean; |
|
2
|
|
|
|
|
2127
|
|
|
2
|
|
|
|
|
9
|
|
84
|
2
|
|
|
2
|
|
130
|
use Carp; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
127
|
|
85
|
2
|
|
|
2
|
|
13
|
use Exporter 'import'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
52
|
|
86
|
2
|
|
|
2
|
|
1490
|
use JSON::PP; |
|
2
|
|
|
|
|
33108
|
|
|
2
|
|
|
|
|
152
|
|
87
|
2
|
|
|
2
|
|
1102
|
use Time::HiRes qw< gettimeofday tv_interval >; |
|
2
|
|
|
|
|
2944
|
|
|
2
|
|
|
|
|
7
|
|
88
|
2
|
|
|
2
|
|
1412
|
use YAML::PP::Perl; |
|
2
|
|
|
|
|
142707
|
|
|
2
|
|
|
|
|
126
|
|
89
|
2
|
|
|
2
|
|
20
|
use XXX; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
18
|
|
90
|
|
|
|
|
|
|
|
91
|
2
|
|
|
2
|
|
156
|
use constant DEBUG => $ENV{DEBUG}; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
268
|
|
92
|
|
|
|
|
|
|
|
93
|
2
|
|
|
2
|
|
8
|
our @EXPORT; |
94
|
30
|
|
|
30
|
0
|
73
|
sub export { push @EXPORT, @_ } |
95
|
|
|
|
|
|
|
|
96
|
2
|
|
|
|
|
15
|
export qw< true false >; |
97
|
|
|
|
|
|
|
|
98
|
2
|
|
|
|
|
4
|
export 'rule'; |
99
|
|
|
|
|
|
|
sub rule { |
100
|
424
|
|
|
424
|
0
|
812
|
my ($num, $name, $func) = @_; |
101
|
424
|
|
|
|
|
897
|
my ($pkg) = caller; |
102
|
|
|
|
|
|
|
{ |
103
|
2
|
|
|
2
|
|
14
|
no strict 'refs'; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
2707
|
|
|
424
|
|
|
|
|
619
|
|
104
|
424
|
|
|
|
|
497
|
*{"${pkg}::$name"} = $func; |
|
424
|
|
|
|
|
1994
|
|
105
|
|
|
|
|
|
|
} |
106
|
424
|
|
|
|
|
822
|
$func = name($name, $func); |
107
|
424
|
|
|
|
|
790
|
$func->{num} = $num; |
108
|
424
|
|
|
|
|
868
|
return $func; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
2
|
|
|
|
|
22
|
export 'name'; |
112
|
|
|
|
|
|
|
sub name { |
113
|
5526
|
|
|
5526
|
0
|
11309
|
my ($name, $func, $trace) = (@_, ''); |
114
|
5526
|
|
|
|
|
7337
|
my $f = $func; |
115
|
5526
|
|
|
|
|
6476
|
if (DEBUG) { |
116
|
|
|
|
|
|
|
$f = sub { |
117
|
0
|
|
|
0
|
|
0
|
my ($n, @args) = @_; |
118
|
0
|
|
|
|
|
0
|
my $args = join ',', map stringify($_), @args; |
119
|
0
|
|
|
|
|
0
|
debug("$name($args)"); |
120
|
0
|
|
|
|
|
0
|
goto $func; |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
} |
123
|
5526
|
|
|
|
|
10628
|
return PerlYamlReferenceParserFunc->new($f, $name, $trace); |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
2
|
|
|
|
|
8
|
export qw; |
127
|
6480
|
|
|
6480
|
0
|
13182
|
sub isNull { not defined $_[0] } |
128
|
6490
|
|
|
6490
|
0
|
23637
|
sub isBoolean { ref($_[0]) eq 'boolean' } |
129
|
6560
|
100
|
|
6560
|
0
|
20179
|
sub isNumber { not(ref $_[0]) and $_[0] =~ /^-?\d+$/ } |
130
|
9180
|
|
100
|
9180
|
0
|
34275
|
sub isString { not(ref $_[0]) and $_[0] !~ /^-?\d+$/ } |
131
|
19134
|
|
|
19134
|
0
|
49210
|
sub isFunction { ref($_[0]) eq 'PerlYamlReferenceParserFunc' } |
132
|
16498
|
|
|
16498
|
0
|
43033
|
sub isArray { ref($_[0]) eq 'ARRAY' } |
133
|
2798
|
|
|
2798
|
0
|
5487
|
sub isObject { ref($_[0]) eq 'HASH' } |
134
|
|
|
|
|
|
|
|
135
|
2
|
|
|
|
|
7
|
export 'typeof'; |
136
|
|
|
|
|
|
|
sub typeof { |
137
|
6480
|
|
|
6480
|
0
|
10900
|
my ($value) = @_; |
138
|
6480
|
50
|
|
|
|
10419
|
return 'null' if isNull $value; |
139
|
6480
|
100
|
|
|
|
11270
|
return 'boolean' if isBoolean $value; |
140
|
18
|
100
|
|
|
|
40
|
return 'number' if isNumber $value; |
141
|
6
|
50
|
|
|
|
14
|
return 'string' if isString $value; |
142
|
0
|
0
|
|
|
|
0
|
return 'function' if isFunction $value; |
143
|
0
|
0
|
|
|
|
0
|
return 'array' if isArray $value; |
144
|
0
|
0
|
|
|
|
0
|
return 'object' if isObject $value; |
145
|
0
|
|
|
|
|
0
|
XXX [$value, ref($value)]; |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
|
148
|
2
|
|
|
|
|
17
|
my $json = JSON::PP->new->canonical->allow_unknown->allow_nonref->convert_blessed; |
149
|
|
|
|
|
|
|
sub json_stringify { |
150
|
2752
|
|
|
2752
|
0
|
3569
|
my $string; |
151
|
2752
|
|
|
|
|
3755
|
eval { |
152
|
2752
|
|
|
|
|
7371
|
$string = $json->encode($_[0]); |
153
|
|
|
|
|
|
|
}; |
154
|
2752
|
50
|
|
|
|
179736
|
confess $@ if $@; |
155
|
2752
|
|
|
|
|
5330
|
return $string; |
156
|
|
|
|
|
|
|
} |
157
|
|
|
|
|
|
|
|
158
|
2
|
|
|
|
|
276
|
export 'stringify'; |
159
|
|
|
|
|
|
|
sub stringify; |
160
|
|
|
|
|
|
|
sub stringify { |
161
|
2982
|
|
|
2982
|
0
|
4938
|
my ($o) = @_; |
162
|
2982
|
100
|
|
|
|
6178
|
if ($o eq "\x{feff}") { |
163
|
80
|
|
|
|
|
303
|
return "\\uFEFF"; |
164
|
|
|
|
|
|
|
} |
165
|
2902
|
100
|
|
|
|
4838
|
if (isFunction $o) { |
166
|
104
|
|
|
|
|
453
|
return "\@$o->{trace}"; |
167
|
|
|
|
|
|
|
} |
168
|
2798
|
100
|
|
|
|
5090
|
if (isObject $o) { |
169
|
72
|
|
|
|
|
581
|
return json_stringify [ sort keys %$o ]; |
170
|
|
|
|
|
|
|
} |
171
|
2726
|
100
|
|
|
|
4559
|
if (isArray $o) { |
172
|
46
|
|
|
|
|
96
|
return "[${\ join ',', map stringify($_), @$o}]"; |
|
46
|
|
|
|
|
152
|
|
173
|
|
|
|
|
|
|
} |
174
|
2680
|
100
|
|
|
|
4593
|
if (isString $o) { |
175
|
2630
|
|
|
|
|
4964
|
$_ = json_stringify $o; |
176
|
2630
|
|
|
|
|
11648
|
s/^"(.*)"$/$1/; |
177
|
2630
|
|
|
|
|
10633
|
return $_; |
178
|
|
|
|
|
|
|
} |
179
|
50
|
|
|
|
|
148
|
return json_stringify $o; |
180
|
|
|
|
|
|
|
} |
181
|
|
|
|
|
|
|
|
182
|
2
|
|
|
|
|
5
|
export 'hex_char'; |
183
|
|
|
|
|
|
|
sub hex_char { |
184
|
788
|
|
|
788
|
0
|
1867
|
my ($chr) = @_; |
185
|
788
|
|
|
|
|
3394
|
return sprintf "x%x", ord $chr; |
186
|
|
|
|
|
|
|
} |
187
|
|
|
|
|
|
|
|
188
|
2
|
|
|
|
|
12
|
export 'func'; |
189
|
|
|
|
|
|
|
sub func { |
190
|
3660
|
|
|
3660
|
0
|
6313
|
my ($self, $name) = @_; |
191
|
3660
|
50
|
|
|
|
11237
|
my $func = $self->can($name) or |
192
|
|
|
|
|
|
|
die "Can't find parser function '$name'"; |
193
|
3660
|
|
|
|
|
7331
|
PerlYamlReferenceParserFunc->new($func, $name); |
194
|
|
|
|
|
|
|
} |
195
|
|
|
|
|
|
|
|
196
|
2
|
|
|
|
|
6
|
export 'file_read'; |
197
|
|
|
|
|
|
|
sub file_read { |
198
|
0
|
|
|
0
|
0
|
0
|
do { local $/; <> }; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
199
|
|
|
|
|
|
|
} |
200
|
|
|
|
|
|
|
|
201
|
2
|
|
|
|
|
5
|
export 'debug'; |
202
|
|
|
|
|
|
|
sub debug { |
203
|
0
|
|
|
0
|
0
|
0
|
my ($msg) = @_; |
204
|
0
|
|
|
|
|
0
|
warn ">>> $msg\n"; |
205
|
|
|
|
|
|
|
} |
206
|
|
|
|
|
|
|
|
207
|
2
|
|
|
|
|
5
|
export 'debug_rule'; |
208
|
|
|
|
|
|
|
sub debug_rule { |
209
|
0
|
|
|
0
|
0
|
0
|
my ($name, @args) = @_; |
210
|
0
|
|
|
|
|
0
|
my $args = join ',', map stringify($_), @args; |
211
|
0
|
|
|
|
|
0
|
debug "$name($args)"; |
212
|
|
|
|
|
|
|
} |
213
|
|
|
|
|
|
|
|
214
|
2
|
|
|
|
|
4
|
export qw< WWW XXX YYY ZZZ www xxx yyy zzz >; |
215
|
2
|
|
|
|
|
11
|
*www = \&www; |
216
|
2
|
|
|
|
|
6
|
*xxx = \&xxx; |
217
|
2
|
|
|
|
|
4
|
*yyy = \&yyy; |
218
|
2
|
|
|
|
|
6
|
*zzz = \&zzz; |
219
|
|
|
|
|
|
|
|
220
|
2
|
|
|
|
|
4
|
export 'dump'; |
221
|
|
|
|
|
|
|
sub dump { |
222
|
0
|
|
|
0
|
0
|
0
|
YAML::PP::Perl->new->dump(@_); |
223
|
|
|
|
|
|
|
} |
224
|
|
|
|
|
|
|
|
225
|
2
|
|
|
|
|
4
|
export 'FAIL'; |
226
|
|
|
|
|
|
|
sub FAIL { |
227
|
0
|
|
|
0
|
0
|
0
|
WWW [@_]; |
228
|
0
|
|
0
|
|
|
0
|
confess "FAIL '${\ $_[0] // '???'}'"; |
|
0
|
|
|
|
|
0
|
|
229
|
|
|
|
|
|
|
} |
230
|
|
|
|
|
|
|
|
231
|
2
|
|
|
|
|
4
|
export 'timer'; |
232
|
|
|
|
|
|
|
sub timer { |
233
|
0
|
0
|
|
0
|
0
|
0
|
if (@_) { |
234
|
0
|
|
|
|
|
0
|
tv_interval(shift); |
235
|
|
|
|
|
|
|
} |
236
|
|
|
|
|
|
|
else { |
237
|
0
|
|
|
|
|
0
|
[gettimeofday]; |
238
|
|
|
|
|
|
|
} |
239
|
|
|
|
|
|
|
} |
240
|
|
|
|
|
|
|
|
241
|
2
|
|
|
|
|
66
|
1; |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
# vim: sw=2: |
244
|
|
|
|
|
|
|
} |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
### |
248
|
|
|
|
|
|
|
# This grammar class was generated from https://yaml.org/spec/1.2/spec.html |
249
|
|
|
|
|
|
|
### |
250
|
|
|
|
|
|
|
|
251
|
2
|
|
|
2
|
|
37
|
use v5.12; |
|
2
|
|
|
|
|
7
|
|
252
|
|
|
|
|
|
|
package PerlYamlReferenceParserGrammar; |
253
|
2
|
|
|
2
|
|
21
|
use PerlYamlReferenceParserPrelude; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
269
|
|
254
|
|
|
|
|
|
|
|
255
|
2
|
|
|
2
|
|
15
|
use constant DEBUG => $ENV{DEBUG}; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
30012
|
|
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
rule '000', TOP => sub { |
258
|
2
|
|
|
2
|
|
6
|
my ($self) = @_; |
259
|
2
|
|
|
|
|
6
|
$self->func('l_yaml_stream'); |
260
|
|
|
|
|
|
|
}; |
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
# [001] |
264
|
|
|
|
|
|
|
# c-printable ::= |
265
|
|
|
|
|
|
|
# x:9 | x:A | x:D | [x:20-x:7E] |
266
|
|
|
|
|
|
|
# | x:85 | [x:A0-x:D7FF] | [x:E000-x:FFFD] |
267
|
|
|
|
|
|
|
# | [x:10000-x:10FFFF] |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
rule '001', c_printable => sub { |
270
|
82
|
|
|
82
|
|
185
|
my ($self) = @_; |
271
|
82
|
|
|
|
|
136
|
debug_rule("c_printable") if DEBUG; |
272
|
82
|
|
|
|
|
206
|
$self->any( |
273
|
|
|
|
|
|
|
$self->chr("\x{09}"), |
274
|
|
|
|
|
|
|
$self->chr("\x{0A}"), |
275
|
|
|
|
|
|
|
$self->chr("\x{0D}"), |
276
|
|
|
|
|
|
|
$self->rng("\x{20}", "\x{7E}"), |
277
|
|
|
|
|
|
|
$self->chr("\x{85}"), |
278
|
|
|
|
|
|
|
$self->rng("\x{A0}", "\x{D7FF}"), |
279
|
|
|
|
|
|
|
$self->rng("\x{E000}", "\x{FFFD}"), |
280
|
|
|
|
|
|
|
$self->rng("\x{010000}", "\x{10FFFF}") |
281
|
|
|
|
|
|
|
); |
282
|
|
|
|
|
|
|
}; |
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
# [002] |
287
|
|
|
|
|
|
|
# nb-json ::= |
288
|
|
|
|
|
|
|
# x:9 | [x:20-x:10FFFF] |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
rule '002', nb_json => sub { |
291
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
292
|
0
|
|
|
|
|
0
|
debug_rule("nb_json") if DEBUG; |
293
|
0
|
|
|
|
|
0
|
$self->any( |
294
|
|
|
|
|
|
|
$self->chr("\x{09}"), |
295
|
|
|
|
|
|
|
$self->rng("\x{20}", "\x{10FFFF}") |
296
|
|
|
|
|
|
|
); |
297
|
|
|
|
|
|
|
}; |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
|
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
# [003] |
302
|
|
|
|
|
|
|
# c-byte-order-mark ::= |
303
|
|
|
|
|
|
|
# x:FEFF |
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
rule '003', c_byte_order_mark => sub { |
306
|
80
|
|
|
80
|
|
176
|
my ($self) = @_; |
307
|
80
|
|
|
|
|
115
|
debug_rule("c_byte_order_mark") if DEBUG; |
308
|
80
|
|
|
|
|
231
|
$self->chr("\x{FEFF}"); |
309
|
|
|
|
|
|
|
}; |
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
# [004] |
314
|
|
|
|
|
|
|
# c-sequence-entry ::= |
315
|
|
|
|
|
|
|
# '-' |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
rule '004', c_sequence_entry => sub { |
318
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
319
|
0
|
|
|
|
|
0
|
debug_rule("c_sequence_entry") if DEBUG; |
320
|
0
|
|
|
|
|
0
|
$self->chr('-'); |
321
|
|
|
|
|
|
|
}; |
322
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
# [005] |
326
|
|
|
|
|
|
|
# c-mapping-key ::= |
327
|
|
|
|
|
|
|
# '?' |
328
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
rule '005', c_mapping_key => sub { |
330
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
331
|
0
|
|
|
|
|
0
|
debug_rule("c_mapping_key") if DEBUG; |
332
|
0
|
|
|
|
|
0
|
$self->chr('?'); |
333
|
|
|
|
|
|
|
}; |
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
# [006] |
338
|
|
|
|
|
|
|
# c-mapping-value ::= |
339
|
|
|
|
|
|
|
# ':' |
340
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
rule '006', c_mapping_value => sub { |
342
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
343
|
0
|
|
|
|
|
0
|
debug_rule("c_mapping_value") if DEBUG; |
344
|
0
|
|
|
|
|
0
|
$self->chr(':'); |
345
|
|
|
|
|
|
|
}; |
346
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
# [007] |
350
|
|
|
|
|
|
|
# c-collect-entry ::= |
351
|
|
|
|
|
|
|
# ',' |
352
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
rule '007', c_collect_entry => sub { |
354
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
355
|
0
|
|
|
|
|
0
|
debug_rule("c_collect_entry") if DEBUG; |
356
|
0
|
|
|
|
|
0
|
$self->chr(','); |
357
|
|
|
|
|
|
|
}; |
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
# [008] |
362
|
|
|
|
|
|
|
# c-sequence-start ::= |
363
|
|
|
|
|
|
|
# '[' |
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
rule '008', c_sequence_start => sub { |
366
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
367
|
0
|
|
|
|
|
0
|
debug_rule("c_sequence_start") if DEBUG; |
368
|
0
|
|
|
|
|
0
|
$self->chr('['); |
369
|
|
|
|
|
|
|
}; |
370
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
# [009] |
374
|
|
|
|
|
|
|
# c-sequence-end ::= |
375
|
|
|
|
|
|
|
# ']' |
376
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
rule '009', c_sequence_end => sub { |
378
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
379
|
0
|
|
|
|
|
0
|
debug_rule("c_sequence_end") if DEBUG; |
380
|
0
|
|
|
|
|
0
|
$self->chr(']'); |
381
|
|
|
|
|
|
|
}; |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
# [010] |
386
|
|
|
|
|
|
|
# c-mapping-start ::= |
387
|
|
|
|
|
|
|
# '{' |
388
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
rule '010', c_mapping_start => sub { |
390
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
391
|
0
|
|
|
|
|
0
|
debug_rule("c_mapping_start") if DEBUG; |
392
|
0
|
|
|
|
|
0
|
$self->chr('{'); |
393
|
|
|
|
|
|
|
}; |
394
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
# [011] |
398
|
|
|
|
|
|
|
# c-mapping-end ::= |
399
|
|
|
|
|
|
|
# '}' |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
rule '011', c_mapping_end => sub { |
402
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
403
|
0
|
|
|
|
|
0
|
debug_rule("c_mapping_end") if DEBUG; |
404
|
0
|
|
|
|
|
0
|
$self->chr('}'); |
405
|
|
|
|
|
|
|
}; |
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
|
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
# [012] |
410
|
|
|
|
|
|
|
# c-comment ::= |
411
|
|
|
|
|
|
|
# '#' |
412
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
rule '012', c_comment => sub { |
414
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
415
|
0
|
|
|
|
|
0
|
debug_rule("c_comment") if DEBUG; |
416
|
0
|
|
|
|
|
0
|
$self->chr('#'); |
417
|
|
|
|
|
|
|
}; |
418
|
|
|
|
|
|
|
|
419
|
|
|
|
|
|
|
|
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
# [013] |
422
|
|
|
|
|
|
|
# c-anchor ::= |
423
|
|
|
|
|
|
|
# '&' |
424
|
|
|
|
|
|
|
|
425
|
|
|
|
|
|
|
rule '013', c_anchor => sub { |
426
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
427
|
0
|
|
|
|
|
0
|
debug_rule("c_anchor") if DEBUG; |
428
|
0
|
|
|
|
|
0
|
$self->chr('&'); |
429
|
|
|
|
|
|
|
}; |
430
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
|
432
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
# [014] |
434
|
|
|
|
|
|
|
# c-alias ::= |
435
|
|
|
|
|
|
|
# '*' |
436
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
rule '014', c_alias => sub { |
438
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
439
|
0
|
|
|
|
|
0
|
debug_rule("c_alias") if DEBUG; |
440
|
0
|
|
|
|
|
0
|
$self->chr('*'); |
441
|
|
|
|
|
|
|
}; |
442
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
|
444
|
|
|
|
|
|
|
|
445
|
|
|
|
|
|
|
# [015] |
446
|
|
|
|
|
|
|
# c-tag ::= |
447
|
|
|
|
|
|
|
# '!' |
448
|
|
|
|
|
|
|
|
449
|
|
|
|
|
|
|
rule '015', c_tag => sub { |
450
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
451
|
0
|
|
|
|
|
0
|
debug_rule("c_tag") if DEBUG; |
452
|
0
|
|
|
|
|
0
|
$self->chr('!'); |
453
|
|
|
|
|
|
|
}; |
454
|
|
|
|
|
|
|
|
455
|
|
|
|
|
|
|
|
456
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
# [016] |
458
|
|
|
|
|
|
|
# c-literal ::= |
459
|
|
|
|
|
|
|
# '|' |
460
|
|
|
|
|
|
|
|
461
|
|
|
|
|
|
|
rule '016', c_literal => sub { |
462
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
463
|
0
|
|
|
|
|
0
|
debug_rule("c_literal") if DEBUG; |
464
|
0
|
|
|
|
|
0
|
$self->chr('|'); |
465
|
|
|
|
|
|
|
}; |
466
|
|
|
|
|
|
|
|
467
|
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
|
469
|
|
|
|
|
|
|
# [017] |
470
|
|
|
|
|
|
|
# c-folded ::= |
471
|
|
|
|
|
|
|
# '>' |
472
|
|
|
|
|
|
|
|
473
|
|
|
|
|
|
|
rule '017', c_folded => sub { |
474
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
475
|
0
|
|
|
|
|
0
|
debug_rule("c_folded") if DEBUG; |
476
|
0
|
|
|
|
|
0
|
$self->chr('>'); |
477
|
|
|
|
|
|
|
}; |
478
|
|
|
|
|
|
|
|
479
|
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
|
481
|
|
|
|
|
|
|
# [018] |
482
|
|
|
|
|
|
|
# c-single-quote ::= |
483
|
|
|
|
|
|
|
# ''' |
484
|
|
|
|
|
|
|
|
485
|
|
|
|
|
|
|
rule '018', c_single_quote => sub { |
486
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
487
|
0
|
|
|
|
|
0
|
debug_rule("c_single_quote") if DEBUG; |
488
|
0
|
|
|
|
|
0
|
$self->chr("'"); |
489
|
|
|
|
|
|
|
}; |
490
|
|
|
|
|
|
|
|
491
|
|
|
|
|
|
|
|
492
|
|
|
|
|
|
|
|
493
|
|
|
|
|
|
|
# [019] |
494
|
|
|
|
|
|
|
# c-double-quote ::= |
495
|
|
|
|
|
|
|
# '"' |
496
|
|
|
|
|
|
|
|
497
|
|
|
|
|
|
|
rule '019', c_double_quote => sub { |
498
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
499
|
0
|
|
|
|
|
0
|
debug_rule("c_double_quote") if DEBUG; |
500
|
0
|
|
|
|
|
0
|
$self->chr('"'); |
501
|
|
|
|
|
|
|
}; |
502
|
|
|
|
|
|
|
|
503
|
|
|
|
|
|
|
|
504
|
|
|
|
|
|
|
|
505
|
|
|
|
|
|
|
# [020] |
506
|
|
|
|
|
|
|
# c-directive ::= |
507
|
|
|
|
|
|
|
# '%' |
508
|
|
|
|
|
|
|
|
509
|
|
|
|
|
|
|
rule '020', c_directive => sub { |
510
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
511
|
0
|
|
|
|
|
0
|
debug_rule("c_directive") if DEBUG; |
512
|
0
|
|
|
|
|
0
|
$self->chr('%'); |
513
|
|
|
|
|
|
|
}; |
514
|
|
|
|
|
|
|
|
515
|
|
|
|
|
|
|
|
516
|
|
|
|
|
|
|
|
517
|
|
|
|
|
|
|
# [021] |
518
|
|
|
|
|
|
|
# c-reserved ::= |
519
|
|
|
|
|
|
|
# '@' | '`' |
520
|
|
|
|
|
|
|
|
521
|
|
|
|
|
|
|
rule '021', c_reserved => sub { |
522
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
523
|
0
|
|
|
|
|
0
|
debug_rule("c_reserved") if DEBUG; |
524
|
0
|
|
|
|
|
0
|
$self->any( |
525
|
|
|
|
|
|
|
$self->chr('@'), |
526
|
|
|
|
|
|
|
$self->chr('`') |
527
|
|
|
|
|
|
|
); |
528
|
|
|
|
|
|
|
}; |
529
|
|
|
|
|
|
|
|
530
|
|
|
|
|
|
|
|
531
|
|
|
|
|
|
|
|
532
|
|
|
|
|
|
|
# [022] |
533
|
|
|
|
|
|
|
# c-indicator ::= |
534
|
|
|
|
|
|
|
# '-' | '?' | ':' | ',' | '[' | ']' | '{' | '}' |
535
|
|
|
|
|
|
|
# | '#' | '&' | '*' | '!' | '|' | '>' | ''' | '"' |
536
|
|
|
|
|
|
|
# | '%' | '@' | '`' |
537
|
|
|
|
|
|
|
|
538
|
|
|
|
|
|
|
rule '022', c_indicator => sub { |
539
|
14
|
|
|
14
|
|
37
|
my ($self) = @_; |
540
|
14
|
|
|
|
|
25
|
debug_rule("c_indicator") if DEBUG; |
541
|
14
|
|
|
|
|
45
|
$self->any( |
542
|
|
|
|
|
|
|
$self->chr('-'), |
543
|
|
|
|
|
|
|
$self->chr('?'), |
544
|
|
|
|
|
|
|
$self->chr(':'), |
545
|
|
|
|
|
|
|
$self->chr(','), |
546
|
|
|
|
|
|
|
$self->chr('['), |
547
|
|
|
|
|
|
|
$self->chr(']'), |
548
|
|
|
|
|
|
|
$self->chr('{'), |
549
|
|
|
|
|
|
|
$self->chr('}'), |
550
|
|
|
|
|
|
|
$self->chr('#'), |
551
|
|
|
|
|
|
|
$self->chr('&'), |
552
|
|
|
|
|
|
|
$self->chr('*'), |
553
|
|
|
|
|
|
|
$self->chr('!'), |
554
|
|
|
|
|
|
|
$self->chr('|'), |
555
|
|
|
|
|
|
|
$self->chr('>'), |
556
|
|
|
|
|
|
|
$self->chr("'"), |
557
|
|
|
|
|
|
|
$self->chr('"'), |
558
|
|
|
|
|
|
|
$self->chr('%'), |
559
|
|
|
|
|
|
|
$self->chr('@'), |
560
|
|
|
|
|
|
|
$self->chr('`') |
561
|
|
|
|
|
|
|
); |
562
|
|
|
|
|
|
|
}; |
563
|
|
|
|
|
|
|
|
564
|
|
|
|
|
|
|
|
565
|
|
|
|
|
|
|
|
566
|
|
|
|
|
|
|
# [023] |
567
|
|
|
|
|
|
|
# c-flow-indicator ::= |
568
|
|
|
|
|
|
|
# ',' | '[' | ']' | '{' | '}' |
569
|
|
|
|
|
|
|
|
570
|
|
|
|
|
|
|
rule '023', c_flow_indicator => sub { |
571
|
8
|
|
|
8
|
|
23
|
my ($self) = @_; |
572
|
8
|
|
|
|
|
18
|
debug_rule("c_flow_indicator") if DEBUG; |
573
|
8
|
|
|
|
|
28
|
$self->any( |
574
|
|
|
|
|
|
|
$self->chr(','), |
575
|
|
|
|
|
|
|
$self->chr('['), |
576
|
|
|
|
|
|
|
$self->chr(']'), |
577
|
|
|
|
|
|
|
$self->chr('{'), |
578
|
|
|
|
|
|
|
$self->chr('}') |
579
|
|
|
|
|
|
|
); |
580
|
|
|
|
|
|
|
}; |
581
|
|
|
|
|
|
|
|
582
|
|
|
|
|
|
|
|
583
|
|
|
|
|
|
|
|
584
|
|
|
|
|
|
|
# [024] |
585
|
|
|
|
|
|
|
# b-line-feed ::= |
586
|
|
|
|
|
|
|
# x:A |
587
|
|
|
|
|
|
|
|
588
|
|
|
|
|
|
|
rule '024', b_line_feed => sub { |
589
|
152
|
|
|
152
|
|
303
|
my ($self) = @_; |
590
|
152
|
|
|
|
|
221
|
debug_rule("b_line_feed") if DEBUG; |
591
|
152
|
|
|
|
|
320
|
$self->chr("\x{0A}"); |
592
|
|
|
|
|
|
|
}; |
593
|
|
|
|
|
|
|
|
594
|
|
|
|
|
|
|
|
595
|
|
|
|
|
|
|
|
596
|
|
|
|
|
|
|
# [025] |
597
|
|
|
|
|
|
|
# b-carriage-return ::= |
598
|
|
|
|
|
|
|
# x:D |
599
|
|
|
|
|
|
|
|
600
|
|
|
|
|
|
|
rule '025', b_carriage_return => sub { |
601
|
216
|
|
|
216
|
|
404
|
my ($self) = @_; |
602
|
216
|
|
|
|
|
302
|
debug_rule("b_carriage_return") if DEBUG; |
603
|
216
|
|
|
|
|
485
|
$self->chr("\x{0D}"); |
604
|
|
|
|
|
|
|
}; |
605
|
|
|
|
|
|
|
|
606
|
|
|
|
|
|
|
|
607
|
|
|
|
|
|
|
|
608
|
|
|
|
|
|
|
# [026] |
609
|
|
|
|
|
|
|
# b-char ::= |
610
|
|
|
|
|
|
|
# b-line-feed | b-carriage-return |
611
|
|
|
|
|
|
|
|
612
|
|
|
|
|
|
|
rule '026', b_char => sub { |
613
|
82
|
|
|
82
|
|
165
|
my ($self) = @_; |
614
|
82
|
|
|
|
|
148
|
debug_rule("b_char") if DEBUG; |
615
|
82
|
|
|
|
|
199
|
$self->any( |
616
|
|
|
|
|
|
|
$self->func('b_line_feed'), |
617
|
|
|
|
|
|
|
$self->func('b_carriage_return') |
618
|
|
|
|
|
|
|
); |
619
|
|
|
|
|
|
|
}; |
620
|
|
|
|
|
|
|
|
621
|
|
|
|
|
|
|
|
622
|
|
|
|
|
|
|
|
623
|
|
|
|
|
|
|
# [027] |
624
|
|
|
|
|
|
|
# nb-char ::= |
625
|
|
|
|
|
|
|
# c-printable - b-char - c-byte-order-mark |
626
|
|
|
|
|
|
|
|
627
|
|
|
|
|
|
|
rule '027', nb_char => sub { |
628
|
82
|
|
|
82
|
|
192
|
my ($self) = @_; |
629
|
82
|
|
|
|
|
108
|
debug_rule("nb_char") if DEBUG; |
630
|
82
|
|
|
|
|
210
|
$self->but( |
631
|
|
|
|
|
|
|
$self->func('c_printable'), |
632
|
|
|
|
|
|
|
$self->func('b_char'), |
633
|
|
|
|
|
|
|
$self->func('c_byte_order_mark') |
634
|
|
|
|
|
|
|
); |
635
|
|
|
|
|
|
|
}; |
636
|
|
|
|
|
|
|
|
637
|
|
|
|
|
|
|
|
638
|
|
|
|
|
|
|
|
639
|
|
|
|
|
|
|
# [028] |
640
|
|
|
|
|
|
|
# b-break ::= |
641
|
|
|
|
|
|
|
# ( b-carriage-return b-line-feed ) |
642
|
|
|
|
|
|
|
# | b-carriage-return |
643
|
|
|
|
|
|
|
# | b-line-feed |
644
|
|
|
|
|
|
|
|
645
|
|
|
|
|
|
|
rule '028', b_break => sub { |
646
|
70
|
|
|
70
|
|
179
|
my ($self) = @_; |
647
|
70
|
|
|
|
|
121
|
debug_rule("b_break") if DEBUG; |
648
|
70
|
|
|
|
|
162
|
$self->any( |
649
|
|
|
|
|
|
|
$self->all( |
650
|
|
|
|
|
|
|
$self->func('b_carriage_return'), |
651
|
|
|
|
|
|
|
$self->func('b_line_feed') |
652
|
|
|
|
|
|
|
), |
653
|
|
|
|
|
|
|
$self->func('b_carriage_return'), |
654
|
|
|
|
|
|
|
$self->func('b_line_feed') |
655
|
|
|
|
|
|
|
); |
656
|
|
|
|
|
|
|
}; |
657
|
|
|
|
|
|
|
|
658
|
|
|
|
|
|
|
|
659
|
|
|
|
|
|
|
|
660
|
|
|
|
|
|
|
# [029] |
661
|
|
|
|
|
|
|
# b-as-line-feed ::= |
662
|
|
|
|
|
|
|
# b-break |
663
|
|
|
|
|
|
|
|
664
|
|
|
|
|
|
|
rule '029', b_as_line_feed => sub { |
665
|
16
|
|
|
16
|
|
36
|
my ($self) = @_; |
666
|
16
|
|
|
|
|
24
|
debug_rule("b_as_line_feed") if DEBUG; |
667
|
16
|
|
|
|
|
47
|
$self->func('b_break'); |
668
|
|
|
|
|
|
|
}; |
669
|
|
|
|
|
|
|
|
670
|
|
|
|
|
|
|
|
671
|
|
|
|
|
|
|
|
672
|
|
|
|
|
|
|
# [030] |
673
|
|
|
|
|
|
|
# b-non-content ::= |
674
|
|
|
|
|
|
|
# b-break |
675
|
|
|
|
|
|
|
|
676
|
|
|
|
|
|
|
rule '030', b_non_content => sub { |
677
|
46
|
|
|
46
|
|
114
|
my ($self) = @_; |
678
|
46
|
|
|
|
|
85
|
debug_rule("b_non_content") if DEBUG; |
679
|
46
|
|
|
|
|
120
|
$self->func('b_break'); |
680
|
|
|
|
|
|
|
}; |
681
|
|
|
|
|
|
|
|
682
|
|
|
|
|
|
|
|
683
|
|
|
|
|
|
|
|
684
|
|
|
|
|
|
|
# [031] |
685
|
|
|
|
|
|
|
# s-space ::= |
686
|
|
|
|
|
|
|
# x:20 |
687
|
|
|
|
|
|
|
|
688
|
|
|
|
|
|
|
rule '031', s_space => sub { |
689
|
202
|
|
|
202
|
|
378
|
my ($self) = @_; |
690
|
202
|
|
|
|
|
264
|
debug_rule("s_space") if DEBUG; |
691
|
202
|
|
|
|
|
465
|
$self->chr("\x{20}"); |
692
|
|
|
|
|
|
|
}; |
693
|
|
|
|
|
|
|
|
694
|
|
|
|
|
|
|
|
695
|
|
|
|
|
|
|
|
696
|
|
|
|
|
|
|
# [032] |
697
|
|
|
|
|
|
|
# s-tab ::= |
698
|
|
|
|
|
|
|
# x:9 |
699
|
|
|
|
|
|
|
|
700
|
|
|
|
|
|
|
rule '032', s_tab => sub { |
701
|
142
|
|
|
142
|
|
269
|
my ($self) = @_; |
702
|
142
|
|
|
|
|
173
|
debug_rule("s_tab") if DEBUG; |
703
|
142
|
|
|
|
|
303
|
$self->chr("\x{09}"); |
704
|
|
|
|
|
|
|
}; |
705
|
|
|
|
|
|
|
|
706
|
|
|
|
|
|
|
|
707
|
|
|
|
|
|
|
|
708
|
|
|
|
|
|
|
# [033] |
709
|
|
|
|
|
|
|
# s-white ::= |
710
|
|
|
|
|
|
|
# s-space | s-tab |
711
|
|
|
|
|
|
|
|
712
|
|
|
|
|
|
|
rule '033', s_white => sub { |
713
|
168
|
|
|
168
|
|
315
|
my ($self) = @_; |
714
|
168
|
|
|
|
|
219
|
debug_rule("s_white") if DEBUG; |
715
|
168
|
|
|
|
|
374
|
$self->any( |
716
|
|
|
|
|
|
|
$self->func('s_space'), |
717
|
|
|
|
|
|
|
$self->func('s_tab') |
718
|
|
|
|
|
|
|
); |
719
|
|
|
|
|
|
|
}; |
720
|
|
|
|
|
|
|
|
721
|
|
|
|
|
|
|
|
722
|
|
|
|
|
|
|
|
723
|
|
|
|
|
|
|
# [034] |
724
|
|
|
|
|
|
|
# ns-char ::= |
725
|
|
|
|
|
|
|
# nb-char - s-white |
726
|
|
|
|
|
|
|
|
727
|
|
|
|
|
|
|
rule '034', ns_char => sub { |
728
|
50
|
|
|
50
|
|
120
|
my ($self) = @_; |
729
|
50
|
|
|
|
|
66
|
debug_rule("ns_char") if DEBUG; |
730
|
50
|
|
|
|
|
130
|
$self->but( |
731
|
|
|
|
|
|
|
$self->func('nb_char'), |
732
|
|
|
|
|
|
|
$self->func('s_white') |
733
|
|
|
|
|
|
|
); |
734
|
|
|
|
|
|
|
}; |
735
|
|
|
|
|
|
|
|
736
|
|
|
|
|
|
|
|
737
|
|
|
|
|
|
|
|
738
|
|
|
|
|
|
|
# [035] |
739
|
|
|
|
|
|
|
# ns-dec-digit ::= |
740
|
|
|
|
|
|
|
# [x:30-x:39] |
741
|
|
|
|
|
|
|
|
742
|
|
|
|
|
|
|
rule '035', ns_dec_digit => sub { |
743
|
2
|
|
|
2
|
|
6
|
my ($self) = @_; |
744
|
2
|
|
|
|
|
5
|
debug_rule("ns_dec_digit") if DEBUG; |
745
|
2
|
|
|
|
|
10
|
$self->rng("\x{30}", "\x{39}"); |
746
|
|
|
|
|
|
|
}; |
747
|
|
|
|
|
|
|
|
748
|
|
|
|
|
|
|
|
749
|
|
|
|
|
|
|
|
750
|
|
|
|
|
|
|
# [036] |
751
|
|
|
|
|
|
|
# ns-hex-digit ::= |
752
|
|
|
|
|
|
|
# ns-dec-digit |
753
|
|
|
|
|
|
|
# | [x:41-x:46] | [x:61-x:66] |
754
|
|
|
|
|
|
|
|
755
|
|
|
|
|
|
|
rule '036', ns_hex_digit => sub { |
756
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
757
|
0
|
|
|
|
|
0
|
debug_rule("ns_hex_digit") if DEBUG; |
758
|
0
|
|
|
|
|
0
|
$self->any( |
759
|
|
|
|
|
|
|
$self->func('ns_dec_digit'), |
760
|
|
|
|
|
|
|
$self->rng("\x{41}", "\x{46}"), |
761
|
|
|
|
|
|
|
$self->rng("\x{61}", "\x{66}") |
762
|
|
|
|
|
|
|
); |
763
|
|
|
|
|
|
|
}; |
764
|
|
|
|
|
|
|
|
765
|
|
|
|
|
|
|
|
766
|
|
|
|
|
|
|
|
767
|
|
|
|
|
|
|
# [037] |
768
|
|
|
|
|
|
|
# ns-ascii-letter ::= |
769
|
|
|
|
|
|
|
# [x:41-x:5A] | [x:61-x:7A] |
770
|
|
|
|
|
|
|
|
771
|
|
|
|
|
|
|
rule '037', ns_ascii_letter => sub { |
772
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
773
|
0
|
|
|
|
|
0
|
debug_rule("ns_ascii_letter") if DEBUG; |
774
|
0
|
|
|
|
|
0
|
$self->any( |
775
|
|
|
|
|
|
|
$self->rng("\x{41}", "\x{5A}"), |
776
|
|
|
|
|
|
|
$self->rng("\x{61}", "\x{7A}") |
777
|
|
|
|
|
|
|
); |
778
|
|
|
|
|
|
|
}; |
779
|
|
|
|
|
|
|
|
780
|
|
|
|
|
|
|
|
781
|
|
|
|
|
|
|
|
782
|
|
|
|
|
|
|
# [038] |
783
|
|
|
|
|
|
|
# ns-word-char ::= |
784
|
|
|
|
|
|
|
# ns-dec-digit | ns-ascii-letter | '-' |
785
|
|
|
|
|
|
|
|
786
|
|
|
|
|
|
|
rule '038', ns_word_char => sub { |
787
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
788
|
0
|
|
|
|
|
0
|
debug_rule("ns_word_char") if DEBUG; |
789
|
0
|
|
|
|
|
0
|
$self->any( |
790
|
|
|
|
|
|
|
$self->func('ns_dec_digit'), |
791
|
|
|
|
|
|
|
$self->func('ns_ascii_letter'), |
792
|
|
|
|
|
|
|
$self->chr('-') |
793
|
|
|
|
|
|
|
); |
794
|
|
|
|
|
|
|
}; |
795
|
|
|
|
|
|
|
|
796
|
|
|
|
|
|
|
|
797
|
|
|
|
|
|
|
|
798
|
|
|
|
|
|
|
# [039] |
799
|
|
|
|
|
|
|
# ns-uri-char ::= |
800
|
|
|
|
|
|
|
# '%' ns-hex-digit ns-hex-digit | ns-word-char | '#' |
801
|
|
|
|
|
|
|
# | ';' | '/' | '?' | ':' | '@' | '&' | '=' | '+' | '$' | ',' |
802
|
|
|
|
|
|
|
# | '_' | '.' | '!' | '~' | '*' | ''' | '(' | ')' | '[' | ']' |
803
|
|
|
|
|
|
|
|
804
|
|
|
|
|
|
|
rule '039', ns_uri_char => sub { |
805
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
806
|
0
|
|
|
|
|
0
|
debug_rule("ns_uri_char") if DEBUG; |
807
|
0
|
|
|
|
|
0
|
$self->any( |
808
|
|
|
|
|
|
|
$self->all( |
809
|
|
|
|
|
|
|
$self->chr('%'), |
810
|
|
|
|
|
|
|
$self->func('ns_hex_digit'), |
811
|
|
|
|
|
|
|
$self->func('ns_hex_digit') |
812
|
|
|
|
|
|
|
), |
813
|
|
|
|
|
|
|
$self->func('ns_word_char'), |
814
|
|
|
|
|
|
|
$self->chr('#'), |
815
|
|
|
|
|
|
|
$self->chr(';'), |
816
|
|
|
|
|
|
|
$self->chr('/'), |
817
|
|
|
|
|
|
|
$self->chr('?'), |
818
|
|
|
|
|
|
|
$self->chr(':'), |
819
|
|
|
|
|
|
|
$self->chr('@'), |
820
|
|
|
|
|
|
|
$self->chr('&'), |
821
|
|
|
|
|
|
|
$self->chr('='), |
822
|
|
|
|
|
|
|
$self->chr('+'), |
823
|
|
|
|
|
|
|
$self->chr('$'), |
824
|
|
|
|
|
|
|
$self->chr(','), |
825
|
|
|
|
|
|
|
$self->chr('_'), |
826
|
|
|
|
|
|
|
$self->chr('.'), |
827
|
|
|
|
|
|
|
$self->chr('!'), |
828
|
|
|
|
|
|
|
$self->chr('~'), |
829
|
|
|
|
|
|
|
$self->chr('*'), |
830
|
|
|
|
|
|
|
$self->chr("'"), |
831
|
|
|
|
|
|
|
$self->chr('('), |
832
|
|
|
|
|
|
|
$self->chr(')'), |
833
|
|
|
|
|
|
|
$self->chr('['), |
834
|
|
|
|
|
|
|
$self->chr(']') |
835
|
|
|
|
|
|
|
); |
836
|
|
|
|
|
|
|
}; |
837
|
|
|
|
|
|
|
|
838
|
|
|
|
|
|
|
|
839
|
|
|
|
|
|
|
|
840
|
|
|
|
|
|
|
# [040] |
841
|
|
|
|
|
|
|
# ns-tag-char ::= |
842
|
|
|
|
|
|
|
# ns-uri-char - '!' - c-flow-indicator |
843
|
|
|
|
|
|
|
|
844
|
|
|
|
|
|
|
rule '040', ns_tag_char => sub { |
845
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
846
|
0
|
|
|
|
|
0
|
debug_rule("ns_tag_char") if DEBUG; |
847
|
0
|
|
|
|
|
0
|
$self->but( |
848
|
|
|
|
|
|
|
$self->func('ns_uri_char'), |
849
|
|
|
|
|
|
|
$self->chr('!'), |
850
|
|
|
|
|
|
|
$self->func('c_flow_indicator') |
851
|
|
|
|
|
|
|
); |
852
|
|
|
|
|
|
|
}; |
853
|
|
|
|
|
|
|
|
854
|
|
|
|
|
|
|
|
855
|
|
|
|
|
|
|
|
856
|
|
|
|
|
|
|
# [041] |
857
|
|
|
|
|
|
|
# c-escape ::= |
858
|
|
|
|
|
|
|
# '\' |
859
|
|
|
|
|
|
|
|
860
|
|
|
|
|
|
|
rule '041', c_escape => sub { |
861
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
862
|
0
|
|
|
|
|
0
|
debug_rule("c_escape") if DEBUG; |
863
|
0
|
|
|
|
|
0
|
$self->chr("\\"); |
864
|
|
|
|
|
|
|
}; |
865
|
|
|
|
|
|
|
|
866
|
|
|
|
|
|
|
|
867
|
|
|
|
|
|
|
|
868
|
|
|
|
|
|
|
# [042] |
869
|
|
|
|
|
|
|
# ns-esc-null ::= |
870
|
|
|
|
|
|
|
# '0' |
871
|
|
|
|
|
|
|
|
872
|
|
|
|
|
|
|
rule '042', ns_esc_null => sub { |
873
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
874
|
0
|
|
|
|
|
0
|
debug_rule("ns_esc_null") if DEBUG; |
875
|
0
|
|
|
|
|
0
|
$self->chr('0'); |
876
|
|
|
|
|
|
|
}; |
877
|
|
|
|
|
|
|
|
878
|
|
|
|
|
|
|
|
879
|
|
|
|
|
|
|
|
880
|
|
|
|
|
|
|
# [043] |
881
|
|
|
|
|
|
|
# ns-esc-bell ::= |
882
|
|
|
|
|
|
|
# 'a' |
883
|
|
|
|
|
|
|
|
884
|
|
|
|
|
|
|
rule '043', ns_esc_bell => sub { |
885
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
886
|
0
|
|
|
|
|
0
|
debug_rule("ns_esc_bell") if DEBUG; |
887
|
0
|
|
|
|
|
0
|
$self->chr('a'); |
888
|
|
|
|
|
|
|
}; |
889
|
|
|
|
|
|
|
|
890
|
|
|
|
|
|
|
|
891
|
|
|
|
|
|
|
|
892
|
|
|
|
|
|
|
# [044] |
893
|
|
|
|
|
|
|
# ns-esc-backspace ::= |
894
|
|
|
|
|
|
|
# 'b' |
895
|
|
|
|
|
|
|
|
896
|
|
|
|
|
|
|
rule '044', ns_esc_backspace => sub { |
897
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
898
|
0
|
|
|
|
|
0
|
debug_rule("ns_esc_backspace") if DEBUG; |
899
|
0
|
|
|
|
|
0
|
$self->chr('b'); |
900
|
|
|
|
|
|
|
}; |
901
|
|
|
|
|
|
|
|
902
|
|
|
|
|
|
|
|
903
|
|
|
|
|
|
|
|
904
|
|
|
|
|
|
|
# [045] |
905
|
|
|
|
|
|
|
# ns-esc-horizontal-tab ::= |
906
|
|
|
|
|
|
|
# 't' | x:9 |
907
|
|
|
|
|
|
|
|
908
|
|
|
|
|
|
|
rule '045', ns_esc_horizontal_tab => sub { |
909
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
910
|
0
|
|
|
|
|
0
|
debug_rule("ns_esc_horizontal_tab") if DEBUG; |
911
|
0
|
|
|
|
|
0
|
$self->any( |
912
|
|
|
|
|
|
|
$self->chr('t'), |
913
|
|
|
|
|
|
|
$self->chr("\x{09}") |
914
|
|
|
|
|
|
|
); |
915
|
|
|
|
|
|
|
}; |
916
|
|
|
|
|
|
|
|
917
|
|
|
|
|
|
|
|
918
|
|
|
|
|
|
|
|
919
|
|
|
|
|
|
|
# [046] |
920
|
|
|
|
|
|
|
# ns-esc-line-feed ::= |
921
|
|
|
|
|
|
|
# 'n' |
922
|
|
|
|
|
|
|
|
923
|
|
|
|
|
|
|
rule '046', ns_esc_line_feed => sub { |
924
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
925
|
0
|
|
|
|
|
0
|
debug_rule("ns_esc_line_feed") if DEBUG; |
926
|
0
|
|
|
|
|
0
|
$self->chr('n'); |
927
|
|
|
|
|
|
|
}; |
928
|
|
|
|
|
|
|
|
929
|
|
|
|
|
|
|
|
930
|
|
|
|
|
|
|
|
931
|
|
|
|
|
|
|
# [047] |
932
|
|
|
|
|
|
|
# ns-esc-vertical-tab ::= |
933
|
|
|
|
|
|
|
# 'v' |
934
|
|
|
|
|
|
|
|
935
|
|
|
|
|
|
|
rule '047', ns_esc_vertical_tab => sub { |
936
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
937
|
0
|
|
|
|
|
0
|
debug_rule("ns_esc_vertical_tab") if DEBUG; |
938
|
0
|
|
|
|
|
0
|
$self->chr('v'); |
939
|
|
|
|
|
|
|
}; |
940
|
|
|
|
|
|
|
|
941
|
|
|
|
|
|
|
|
942
|
|
|
|
|
|
|
|
943
|
|
|
|
|
|
|
# [048] |
944
|
|
|
|
|
|
|
# ns-esc-form-feed ::= |
945
|
|
|
|
|
|
|
# 'f' |
946
|
|
|
|
|
|
|
|
947
|
|
|
|
|
|
|
rule '048', ns_esc_form_feed => sub { |
948
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
949
|
0
|
|
|
|
|
0
|
debug_rule("ns_esc_form_feed") if DEBUG; |
950
|
0
|
|
|
|
|
0
|
$self->chr('f'); |
951
|
|
|
|
|
|
|
}; |
952
|
|
|
|
|
|
|
|
953
|
|
|
|
|
|
|
|
954
|
|
|
|
|
|
|
|
955
|
|
|
|
|
|
|
# [049] |
956
|
|
|
|
|
|
|
# ns-esc-carriage-return ::= |
957
|
|
|
|
|
|
|
# 'r' |
958
|
|
|
|
|
|
|
|
959
|
|
|
|
|
|
|
rule '049', ns_esc_carriage_return => sub { |
960
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
961
|
0
|
|
|
|
|
0
|
debug_rule("ns_esc_carriage_return") if DEBUG; |
962
|
0
|
|
|
|
|
0
|
$self->chr('r'); |
963
|
|
|
|
|
|
|
}; |
964
|
|
|
|
|
|
|
|
965
|
|
|
|
|
|
|
|
966
|
|
|
|
|
|
|
|
967
|
|
|
|
|
|
|
# [050] |
968
|
|
|
|
|
|
|
# ns-esc-escape ::= |
969
|
|
|
|
|
|
|
# 'e' |
970
|
|
|
|
|
|
|
|
971
|
|
|
|
|
|
|
rule '050', ns_esc_escape => sub { |
972
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
973
|
0
|
|
|
|
|
0
|
debug_rule("ns_esc_escape") if DEBUG; |
974
|
0
|
|
|
|
|
0
|
$self->chr('e'); |
975
|
|
|
|
|
|
|
}; |
976
|
|
|
|
|
|
|
|
977
|
|
|
|
|
|
|
|
978
|
|
|
|
|
|
|
|
979
|
|
|
|
|
|
|
# [051] |
980
|
|
|
|
|
|
|
# ns-esc-space ::= |
981
|
|
|
|
|
|
|
# x:20 |
982
|
|
|
|
|
|
|
|
983
|
|
|
|
|
|
|
rule '051', ns_esc_space => sub { |
984
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
985
|
0
|
|
|
|
|
0
|
debug_rule("ns_esc_space") if DEBUG; |
986
|
0
|
|
|
|
|
0
|
$self->chr("\x{20}"); |
987
|
|
|
|
|
|
|
}; |
988
|
|
|
|
|
|
|
|
989
|
|
|
|
|
|
|
|
990
|
|
|
|
|
|
|
|
991
|
|
|
|
|
|
|
# [052] |
992
|
|
|
|
|
|
|
# ns-esc-double-quote ::= |
993
|
|
|
|
|
|
|
# '"' |
994
|
|
|
|
|
|
|
|
995
|
|
|
|
|
|
|
rule '052', ns_esc_double_quote => sub { |
996
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
997
|
0
|
|
|
|
|
0
|
debug_rule("ns_esc_double_quote") if DEBUG; |
998
|
0
|
|
|
|
|
0
|
$self->chr('"'); |
999
|
|
|
|
|
|
|
}; |
1000
|
|
|
|
|
|
|
|
1001
|
|
|
|
|
|
|
|
1002
|
|
|
|
|
|
|
|
1003
|
|
|
|
|
|
|
# [053] |
1004
|
|
|
|
|
|
|
# ns-esc-slash ::= |
1005
|
|
|
|
|
|
|
# '/' |
1006
|
|
|
|
|
|
|
|
1007
|
|
|
|
|
|
|
rule '053', ns_esc_slash => sub { |
1008
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1009
|
0
|
|
|
|
|
0
|
debug_rule("ns_esc_slash") if DEBUG; |
1010
|
0
|
|
|
|
|
0
|
$self->chr('/'); |
1011
|
|
|
|
|
|
|
}; |
1012
|
|
|
|
|
|
|
|
1013
|
|
|
|
|
|
|
|
1014
|
|
|
|
|
|
|
|
1015
|
|
|
|
|
|
|
# [054] |
1016
|
|
|
|
|
|
|
# ns-esc-backslash ::= |
1017
|
|
|
|
|
|
|
# '\' |
1018
|
|
|
|
|
|
|
|
1019
|
|
|
|
|
|
|
rule '054', ns_esc_backslash => sub { |
1020
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1021
|
0
|
|
|
|
|
0
|
debug_rule("ns_esc_backslash") if DEBUG; |
1022
|
0
|
|
|
|
|
0
|
$self->chr("\\"); |
1023
|
|
|
|
|
|
|
}; |
1024
|
|
|
|
|
|
|
|
1025
|
|
|
|
|
|
|
|
1026
|
|
|
|
|
|
|
|
1027
|
|
|
|
|
|
|
# [055] |
1028
|
|
|
|
|
|
|
# ns-esc-next-line ::= |
1029
|
|
|
|
|
|
|
# 'N' |
1030
|
|
|
|
|
|
|
|
1031
|
|
|
|
|
|
|
rule '055', ns_esc_next_line => sub { |
1032
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1033
|
0
|
|
|
|
|
0
|
debug_rule("ns_esc_next_line") if DEBUG; |
1034
|
0
|
|
|
|
|
0
|
$self->chr('N'); |
1035
|
|
|
|
|
|
|
}; |
1036
|
|
|
|
|
|
|
|
1037
|
|
|
|
|
|
|
|
1038
|
|
|
|
|
|
|
|
1039
|
|
|
|
|
|
|
# [056] |
1040
|
|
|
|
|
|
|
# ns-esc-non-breaking-space ::= |
1041
|
|
|
|
|
|
|
# '_' |
1042
|
|
|
|
|
|
|
|
1043
|
|
|
|
|
|
|
rule '056', ns_esc_non_breaking_space => sub { |
1044
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1045
|
0
|
|
|
|
|
0
|
debug_rule("ns_esc_non_breaking_space") if DEBUG; |
1046
|
0
|
|
|
|
|
0
|
$self->chr('_'); |
1047
|
|
|
|
|
|
|
}; |
1048
|
|
|
|
|
|
|
|
1049
|
|
|
|
|
|
|
|
1050
|
|
|
|
|
|
|
|
1051
|
|
|
|
|
|
|
# [057] |
1052
|
|
|
|
|
|
|
# ns-esc-line-separator ::= |
1053
|
|
|
|
|
|
|
# 'L' |
1054
|
|
|
|
|
|
|
|
1055
|
|
|
|
|
|
|
rule '057', ns_esc_line_separator => sub { |
1056
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1057
|
0
|
|
|
|
|
0
|
debug_rule("ns_esc_line_separator") if DEBUG; |
1058
|
0
|
|
|
|
|
0
|
$self->chr('L'); |
1059
|
|
|
|
|
|
|
}; |
1060
|
|
|
|
|
|
|
|
1061
|
|
|
|
|
|
|
|
1062
|
|
|
|
|
|
|
|
1063
|
|
|
|
|
|
|
# [058] |
1064
|
|
|
|
|
|
|
# ns-esc-paragraph-separator ::= |
1065
|
|
|
|
|
|
|
# 'P' |
1066
|
|
|
|
|
|
|
|
1067
|
|
|
|
|
|
|
rule '058', ns_esc_paragraph_separator => sub { |
1068
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1069
|
0
|
|
|
|
|
0
|
debug_rule("ns_esc_paragraph_separator") if DEBUG; |
1070
|
0
|
|
|
|
|
0
|
$self->chr('P'); |
1071
|
|
|
|
|
|
|
}; |
1072
|
|
|
|
|
|
|
|
1073
|
|
|
|
|
|
|
|
1074
|
|
|
|
|
|
|
|
1075
|
|
|
|
|
|
|
# [059] |
1076
|
|
|
|
|
|
|
# ns-esc-8-bit ::= |
1077
|
|
|
|
|
|
|
# 'x' |
1078
|
|
|
|
|
|
|
# ( ns-hex-digit{2} ) |
1079
|
|
|
|
|
|
|
|
1080
|
|
|
|
|
|
|
rule '059', ns_esc_8_bit => sub { |
1081
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1082
|
0
|
|
|
|
|
0
|
debug_rule("ns_esc_8_bit") if DEBUG; |
1083
|
0
|
|
|
|
|
0
|
$self->all( |
1084
|
|
|
|
|
|
|
$self->chr('x'), |
1085
|
|
|
|
|
|
|
$self->rep($2, $2, $self->func('ns_hex_digit')) |
1086
|
|
|
|
|
|
|
); |
1087
|
|
|
|
|
|
|
}; |
1088
|
|
|
|
|
|
|
|
1089
|
|
|
|
|
|
|
|
1090
|
|
|
|
|
|
|
|
1091
|
|
|
|
|
|
|
# [060] |
1092
|
|
|
|
|
|
|
# ns-esc-16-bit ::= |
1093
|
|
|
|
|
|
|
# 'u' |
1094
|
|
|
|
|
|
|
# ( ns-hex-digit{4} ) |
1095
|
|
|
|
|
|
|
|
1096
|
|
|
|
|
|
|
rule '060', ns_esc_16_bit => sub { |
1097
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1098
|
0
|
|
|
|
|
0
|
debug_rule("ns_esc_16_bit") if DEBUG; |
1099
|
0
|
|
|
|
|
0
|
$self->all( |
1100
|
|
|
|
|
|
|
$self->chr('u'), |
1101
|
|
|
|
|
|
|
$self->rep($4, $4, $self->func('ns_hex_digit')) |
1102
|
|
|
|
|
|
|
); |
1103
|
|
|
|
|
|
|
}; |
1104
|
|
|
|
|
|
|
|
1105
|
|
|
|
|
|
|
|
1106
|
|
|
|
|
|
|
|
1107
|
|
|
|
|
|
|
# [061] |
1108
|
|
|
|
|
|
|
# ns-esc-32-bit ::= |
1109
|
|
|
|
|
|
|
# 'U' |
1110
|
|
|
|
|
|
|
# ( ns-hex-digit{8} ) |
1111
|
|
|
|
|
|
|
|
1112
|
|
|
|
|
|
|
rule '061', ns_esc_32_bit => sub { |
1113
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1114
|
0
|
|
|
|
|
0
|
debug_rule("ns_esc_32_bit") if DEBUG; |
1115
|
0
|
|
|
|
|
0
|
$self->all( |
1116
|
|
|
|
|
|
|
$self->chr('U'), |
1117
|
|
|
|
|
|
|
$self->rep($8, $8, $self->func('ns_hex_digit')) |
1118
|
|
|
|
|
|
|
); |
1119
|
|
|
|
|
|
|
}; |
1120
|
|
|
|
|
|
|
|
1121
|
|
|
|
|
|
|
|
1122
|
|
|
|
|
|
|
|
1123
|
|
|
|
|
|
|
# [062] |
1124
|
|
|
|
|
|
|
# c-ns-esc-char ::= |
1125
|
|
|
|
|
|
|
# '\' |
1126
|
|
|
|
|
|
|
# ( ns-esc-null | ns-esc-bell | ns-esc-backspace |
1127
|
|
|
|
|
|
|
# | ns-esc-horizontal-tab | ns-esc-line-feed |
1128
|
|
|
|
|
|
|
# | ns-esc-vertical-tab | ns-esc-form-feed |
1129
|
|
|
|
|
|
|
# | ns-esc-carriage-return | ns-esc-escape | ns-esc-space |
1130
|
|
|
|
|
|
|
# | ns-esc-double-quote | ns-esc-slash | ns-esc-backslash |
1131
|
|
|
|
|
|
|
# | ns-esc-next-line | ns-esc-non-breaking-space |
1132
|
|
|
|
|
|
|
# | ns-esc-line-separator | ns-esc-paragraph-separator |
1133
|
|
|
|
|
|
|
# | ns-esc-8-bit | ns-esc-16-bit | ns-esc-32-bit ) |
1134
|
|
|
|
|
|
|
|
1135
|
|
|
|
|
|
|
rule '062', c_ns_esc_char => sub { |
1136
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1137
|
0
|
|
|
|
|
0
|
debug_rule("c_ns_esc_char") if DEBUG; |
1138
|
0
|
|
|
|
|
0
|
$self->all( |
1139
|
|
|
|
|
|
|
$self->chr("\\"), |
1140
|
|
|
|
|
|
|
$self->any( |
1141
|
|
|
|
|
|
|
$self->func('ns_esc_null'), |
1142
|
|
|
|
|
|
|
$self->func('ns_esc_bell'), |
1143
|
|
|
|
|
|
|
$self->func('ns_esc_backspace'), |
1144
|
|
|
|
|
|
|
$self->func('ns_esc_horizontal_tab'), |
1145
|
|
|
|
|
|
|
$self->func('ns_esc_line_feed'), |
1146
|
|
|
|
|
|
|
$self->func('ns_esc_vertical_tab'), |
1147
|
|
|
|
|
|
|
$self->func('ns_esc_form_feed'), |
1148
|
|
|
|
|
|
|
$self->func('ns_esc_carriage_return'), |
1149
|
|
|
|
|
|
|
$self->func('ns_esc_escape'), |
1150
|
|
|
|
|
|
|
$self->func('ns_esc_space'), |
1151
|
|
|
|
|
|
|
$self->func('ns_esc_double_quote'), |
1152
|
|
|
|
|
|
|
$self->func('ns_esc_slash'), |
1153
|
|
|
|
|
|
|
$self->func('ns_esc_backslash'), |
1154
|
|
|
|
|
|
|
$self->func('ns_esc_next_line'), |
1155
|
|
|
|
|
|
|
$self->func('ns_esc_non_breaking_space'), |
1156
|
|
|
|
|
|
|
$self->func('ns_esc_line_separator'), |
1157
|
|
|
|
|
|
|
$self->func('ns_esc_paragraph_separator'), |
1158
|
|
|
|
|
|
|
$self->func('ns_esc_8_bit'), |
1159
|
|
|
|
|
|
|
$self->func('ns_esc_16_bit'), |
1160
|
|
|
|
|
|
|
$self->func('ns_esc_32_bit') |
1161
|
|
|
|
|
|
|
) |
1162
|
|
|
|
|
|
|
); |
1163
|
|
|
|
|
|
|
}; |
1164
|
|
|
|
|
|
|
|
1165
|
|
|
|
|
|
|
|
1166
|
|
|
|
|
|
|
|
1167
|
|
|
|
|
|
|
# [063] |
1168
|
|
|
|
|
|
|
# s-indent(n) ::= |
1169
|
|
|
|
|
|
|
# s-space{n} |
1170
|
|
|
|
|
|
|
|
1171
|
|
|
|
|
|
|
rule '063', s_indent => sub { |
1172
|
28
|
|
|
28
|
|
68
|
my ($self, $n) = @_; |
1173
|
28
|
|
|
|
|
43
|
debug_rule("s_indent",$n) if DEBUG; |
1174
|
28
|
|
|
|
|
80
|
$self->rep($n, $n, $self->func('s_space')); |
1175
|
|
|
|
|
|
|
}; |
1176
|
|
|
|
|
|
|
|
1177
|
|
|
|
|
|
|
|
1178
|
|
|
|
|
|
|
|
1179
|
|
|
|
|
|
|
# [064] |
1180
|
|
|
|
|
|
|
# s-indent(
|
1181
|
|
|
|
|
|
|
# s-space{m} |
1182
|
|
|
|
|
|
|
|
1183
|
|
|
|
|
|
|
rule '064', s_indent_lt => sub { |
1184
|
4
|
|
|
4
|
|
11
|
my ($self, $n) = @_; |
1185
|
4
|
|
|
|
|
20
|
debug_rule("s_indent_lt",$n) if DEBUG; |
1186
|
4
|
|
|
|
|
13
|
$self->may( |
1187
|
|
|
|
|
|
|
$self->all( |
1188
|
|
|
|
|
|
|
$self->rep(0, undef, $self->func('s_space')), |
1189
|
|
|
|
|
|
|
$self->lt($self->len($self->func('match')), $n) |
1190
|
|
|
|
|
|
|
) |
1191
|
|
|
|
|
|
|
); |
1192
|
|
|
|
|
|
|
}; |
1193
|
|
|
|
|
|
|
|
1194
|
|
|
|
|
|
|
|
1195
|
|
|
|
|
|
|
|
1196
|
|
|
|
|
|
|
# [065] |
1197
|
|
|
|
|
|
|
# s-indent(<=n) ::= |
1198
|
|
|
|
|
|
|
# s-space{m} |
1199
|
|
|
|
|
|
|
|
1200
|
|
|
|
|
|
|
rule '065', s_indent_le => sub { |
1201
|
2
|
|
|
2
|
|
9
|
my ($self, $n) = @_; |
1202
|
2
|
|
|
|
|
5
|
debug_rule("s_indent_le",$n) if DEBUG; |
1203
|
2
|
|
|
|
|
9
|
$self->may( |
1204
|
|
|
|
|
|
|
$self->all( |
1205
|
|
|
|
|
|
|
$self->rep(0, undef, $self->func('s_space')), |
1206
|
|
|
|
|
|
|
$self->le($self->len($self->func('match')), $n) |
1207
|
|
|
|
|
|
|
) |
1208
|
|
|
|
|
|
|
); |
1209
|
|
|
|
|
|
|
}; |
1210
|
|
|
|
|
|
|
|
1211
|
|
|
|
|
|
|
|
1212
|
|
|
|
|
|
|
|
1213
|
|
|
|
|
|
|
# [066] |
1214
|
|
|
|
|
|
|
# s-separate-in-line ::= |
1215
|
|
|
|
|
|
|
# s-white+ | |
1216
|
|
|
|
|
|
|
|
1217
|
|
|
|
|
|
|
rule '066', s_separate_in_line => sub { |
1218
|
72
|
|
|
72
|
|
153
|
my ($self) = @_; |
1219
|
72
|
|
|
|
|
89
|
debug_rule("s_separate_in_line") if DEBUG; |
1220
|
72
|
|
|
|
|
215
|
$self->any( |
1221
|
|
|
|
|
|
|
$self->rep(1, undef, $self->func('s_white')), |
1222
|
|
|
|
|
|
|
$self->func('start_of_line') |
1223
|
|
|
|
|
|
|
); |
1224
|
|
|
|
|
|
|
}; |
1225
|
|
|
|
|
|
|
|
1226
|
|
|
|
|
|
|
|
1227
|
|
|
|
|
|
|
|
1228
|
|
|
|
|
|
|
# [067] |
1229
|
|
|
|
|
|
|
# s-line-prefix(n,c) ::= |
1230
|
|
|
|
|
|
|
# ( c = block-out => s-block-line-prefix(n) ) |
1231
|
|
|
|
|
|
|
# ( c = block-in => s-block-line-prefix(n) ) |
1232
|
|
|
|
|
|
|
# ( c = flow-out => s-flow-line-prefix(n) ) |
1233
|
|
|
|
|
|
|
# ( c = flow-in => s-flow-line-prefix(n) ) |
1234
|
|
|
|
|
|
|
|
1235
|
|
|
|
|
|
|
rule '067', s_line_prefix => sub { |
1236
|
8
|
|
|
8
|
|
22
|
my ($self, $n, $c) = @_; |
1237
|
8
|
|
|
|
|
14
|
debug_rule("s_line_prefix",$n,$c) if DEBUG; |
1238
|
8
|
|
|
|
|
37
|
$self->case( |
1239
|
|
|
|
|
|
|
$c, |
1240
|
|
|
|
|
|
|
{ |
1241
|
|
|
|
|
|
|
'block-in' => [ $self->func('s_block_line_prefix'), $n ], |
1242
|
|
|
|
|
|
|
'block-out' => [ $self->func('s_block_line_prefix'), $n ], |
1243
|
|
|
|
|
|
|
'flow-in' => [ $self->func('s_flow_line_prefix'), $n ], |
1244
|
|
|
|
|
|
|
'flow-out' => [ $self->func('s_flow_line_prefix'), $n ], |
1245
|
|
|
|
|
|
|
} |
1246
|
|
|
|
|
|
|
); |
1247
|
|
|
|
|
|
|
}; |
1248
|
|
|
|
|
|
|
|
1249
|
|
|
|
|
|
|
|
1250
|
|
|
|
|
|
|
|
1251
|
|
|
|
|
|
|
# [068] |
1252
|
|
|
|
|
|
|
# s-block-line-prefix(n) ::= |
1253
|
|
|
|
|
|
|
# s-indent(n) |
1254
|
|
|
|
|
|
|
|
1255
|
|
|
|
|
|
|
rule '068', s_block_line_prefix => sub { |
1256
|
8
|
|
|
8
|
|
24
|
my ($self, $n) = @_; |
1257
|
8
|
|
|
|
|
11
|
debug_rule("s_block_line_prefix",$n) if DEBUG; |
1258
|
8
|
|
|
|
|
24
|
[ $self->func('s_indent'), $n ]; |
1259
|
|
|
|
|
|
|
}; |
1260
|
|
|
|
|
|
|
|
1261
|
|
|
|
|
|
|
|
1262
|
|
|
|
|
|
|
|
1263
|
|
|
|
|
|
|
# [069] |
1264
|
|
|
|
|
|
|
# s-flow-line-prefix(n) ::= |
1265
|
|
|
|
|
|
|
# s-indent(n) |
1266
|
|
|
|
|
|
|
# s-separate-in-line? |
1267
|
|
|
|
|
|
|
|
1268
|
|
|
|
|
|
|
rule '069', s_flow_line_prefix => sub { |
1269
|
4
|
|
|
4
|
|
10
|
my ($self, $n) = @_; |
1270
|
4
|
|
|
|
|
5
|
debug_rule("s_flow_line_prefix",$n) if DEBUG; |
1271
|
4
|
|
|
|
|
16
|
$self->all( |
1272
|
|
|
|
|
|
|
[ $self->func('s_indent'), $n ], |
1273
|
|
|
|
|
|
|
$self->rep(0, 1, $self->func('s_separate_in_line')) |
1274
|
|
|
|
|
|
|
); |
1275
|
|
|
|
|
|
|
}; |
1276
|
|
|
|
|
|
|
|
1277
|
|
|
|
|
|
|
|
1278
|
|
|
|
|
|
|
|
1279
|
|
|
|
|
|
|
# [070] |
1280
|
|
|
|
|
|
|
# l-empty(n,c) ::= |
1281
|
|
|
|
|
|
|
# ( s-line-prefix(n,c) | s-indent(
|
1282
|
|
|
|
|
|
|
# b-as-line-feed |
1283
|
|
|
|
|
|
|
|
1284
|
|
|
|
|
|
|
rule '070', l_empty => sub { |
1285
|
8
|
|
|
8
|
|
27
|
my ($self, $n, $c) = @_; |
1286
|
8
|
|
|
|
|
13
|
debug_rule("l_empty",$n,$c) if DEBUG; |
1287
|
8
|
|
|
|
|
32
|
$self->all( |
1288
|
|
|
|
|
|
|
$self->any( |
1289
|
|
|
|
|
|
|
[ $self->func('s_line_prefix'), $n, $c ], |
1290
|
|
|
|
|
|
|
[ $self->func('s_indent_lt'), $n ] |
1291
|
|
|
|
|
|
|
), |
1292
|
|
|
|
|
|
|
$self->func('b_as_line_feed') |
1293
|
|
|
|
|
|
|
); |
1294
|
|
|
|
|
|
|
}; |
1295
|
|
|
|
|
|
|
|
1296
|
|
|
|
|
|
|
|
1297
|
|
|
|
|
|
|
|
1298
|
|
|
|
|
|
|
# [071] |
1299
|
|
|
|
|
|
|
# b-l-trimmed(n,c) ::= |
1300
|
|
|
|
|
|
|
# b-non-content l-empty(n,c)+ |
1301
|
|
|
|
|
|
|
|
1302
|
|
|
|
|
|
|
rule '071', b_l_trimmed => sub { |
1303
|
4
|
|
|
4
|
|
13
|
my ($self, $n, $c) = @_; |
1304
|
4
|
|
|
|
|
6
|
debug_rule("b_l_trimmed",$n,$c) if DEBUG; |
1305
|
4
|
|
|
|
|
12
|
$self->all( |
1306
|
|
|
|
|
|
|
$self->func('b_non_content'), |
1307
|
|
|
|
|
|
|
$self->rep(1, undef, [ $self->func('l_empty'), $n, $c ]) |
1308
|
|
|
|
|
|
|
); |
1309
|
|
|
|
|
|
|
}; |
1310
|
|
|
|
|
|
|
|
1311
|
|
|
|
|
|
|
|
1312
|
|
|
|
|
|
|
|
1313
|
|
|
|
|
|
|
# [072] |
1314
|
|
|
|
|
|
|
# b-as-space ::= |
1315
|
|
|
|
|
|
|
# b-break |
1316
|
|
|
|
|
|
|
|
1317
|
|
|
|
|
|
|
rule '072', b_as_space => sub { |
1318
|
4
|
|
|
4
|
|
11
|
my ($self) = @_; |
1319
|
4
|
|
|
|
|
7
|
debug_rule("b_as_space") if DEBUG; |
1320
|
4
|
|
|
|
|
15
|
$self->func('b_break'); |
1321
|
|
|
|
|
|
|
}; |
1322
|
|
|
|
|
|
|
|
1323
|
|
|
|
|
|
|
|
1324
|
|
|
|
|
|
|
|
1325
|
|
|
|
|
|
|
# [073] |
1326
|
|
|
|
|
|
|
# b-l-folded(n,c) ::= |
1327
|
|
|
|
|
|
|
# b-l-trimmed(n,c) | b-as-space |
1328
|
|
|
|
|
|
|
|
1329
|
|
|
|
|
|
|
rule '073', b_l_folded => sub { |
1330
|
4
|
|
|
4
|
|
15
|
my ($self, $n, $c) = @_; |
1331
|
4
|
|
|
|
|
11
|
debug_rule("b_l_folded",$n,$c) if DEBUG; |
1332
|
4
|
|
|
|
|
16
|
$self->any( |
1333
|
|
|
|
|
|
|
[ $self->func('b_l_trimmed'), $n, $c ], |
1334
|
|
|
|
|
|
|
$self->func('b_as_space') |
1335
|
|
|
|
|
|
|
); |
1336
|
|
|
|
|
|
|
}; |
1337
|
|
|
|
|
|
|
|
1338
|
|
|
|
|
|
|
|
1339
|
|
|
|
|
|
|
|
1340
|
|
|
|
|
|
|
# [074] |
1341
|
|
|
|
|
|
|
# s-flow-folded(n) ::= |
1342
|
|
|
|
|
|
|
# s-separate-in-line? |
1343
|
|
|
|
|
|
|
# b-l-folded(n,flow-in) |
1344
|
|
|
|
|
|
|
# s-flow-line-prefix(n) |
1345
|
|
|
|
|
|
|
|
1346
|
|
|
|
|
|
|
rule '074', s_flow_folded => sub { |
1347
|
4
|
|
|
4
|
|
16
|
my ($self, $n) = @_; |
1348
|
4
|
|
|
|
|
7
|
debug_rule("s_flow_folded",$n) if DEBUG; |
1349
|
4
|
|
|
|
|
21
|
$self->all( |
1350
|
|
|
|
|
|
|
$self->rep(0, 1, $self->func('s_separate_in_line')), |
1351
|
|
|
|
|
|
|
[ $self->func('b_l_folded'), $n, "flow-in" ], |
1352
|
|
|
|
|
|
|
[ $self->func('s_flow_line_prefix'), $n ] |
1353
|
|
|
|
|
|
|
); |
1354
|
|
|
|
|
|
|
}; |
1355
|
|
|
|
|
|
|
|
1356
|
|
|
|
|
|
|
|
1357
|
|
|
|
|
|
|
|
1358
|
|
|
|
|
|
|
# [075] |
1359
|
|
|
|
|
|
|
# c-nb-comment-text ::= |
1360
|
|
|
|
|
|
|
# '#' nb-char* |
1361
|
|
|
|
|
|
|
|
1362
|
|
|
|
|
|
|
rule '075', c_nb_comment_text => sub { |
1363
|
26
|
|
|
26
|
|
66
|
my ($self) = @_; |
1364
|
26
|
|
|
|
|
36
|
debug_rule("c_nb_comment_text") if DEBUG; |
1365
|
26
|
|
|
|
|
88
|
$self->all( |
1366
|
|
|
|
|
|
|
$self->chr('#'), |
1367
|
|
|
|
|
|
|
$self->rep(0, undef, $self->func('nb_char')) |
1368
|
|
|
|
|
|
|
); |
1369
|
|
|
|
|
|
|
}; |
1370
|
|
|
|
|
|
|
|
1371
|
|
|
|
|
|
|
|
1372
|
|
|
|
|
|
|
|
1373
|
|
|
|
|
|
|
# [076] |
1374
|
|
|
|
|
|
|
# b-comment ::= |
1375
|
|
|
|
|
|
|
# b-non-content | |
1376
|
|
|
|
|
|
|
|
1377
|
|
|
|
|
|
|
rule '076', b_comment => sub { |
1378
|
40
|
|
|
40
|
|
78
|
my ($self) = @_; |
1379
|
40
|
|
|
|
|
65
|
debug_rule("b_comment") if DEBUG; |
1380
|
40
|
|
|
|
|
100
|
$self->any( |
1381
|
|
|
|
|
|
|
$self->func('b_non_content'), |
1382
|
|
|
|
|
|
|
$self->func('end_of_stream') |
1383
|
|
|
|
|
|
|
); |
1384
|
|
|
|
|
|
|
}; |
1385
|
|
|
|
|
|
|
|
1386
|
|
|
|
|
|
|
|
1387
|
|
|
|
|
|
|
|
1388
|
|
|
|
|
|
|
# [077] |
1389
|
|
|
|
|
|
|
# s-b-comment ::= |
1390
|
|
|
|
|
|
|
# ( s-separate-in-line |
1391
|
|
|
|
|
|
|
# c-nb-comment-text? )? |
1392
|
|
|
|
|
|
|
# b-comment |
1393
|
|
|
|
|
|
|
|
1394
|
|
|
|
|
|
|
rule '077', s_b_comment => sub { |
1395
|
28
|
|
|
28
|
|
66
|
my ($self) = @_; |
1396
|
28
|
|
|
|
|
38
|
debug_rule("s_b_comment") if DEBUG; |
1397
|
28
|
|
|
|
|
80
|
$self->all( |
1398
|
|
|
|
|
|
|
$self->rep(0, 1, |
1399
|
|
|
|
|
|
|
$self->all( |
1400
|
|
|
|
|
|
|
$self->func('s_separate_in_line'), |
1401
|
|
|
|
|
|
|
$self->rep(0, 1, $self->func('c_nb_comment_text')) |
1402
|
|
|
|
|
|
|
)), |
1403
|
|
|
|
|
|
|
$self->func('b_comment') |
1404
|
|
|
|
|
|
|
); |
1405
|
|
|
|
|
|
|
}; |
1406
|
|
|
|
|
|
|
|
1407
|
|
|
|
|
|
|
|
1408
|
|
|
|
|
|
|
|
1409
|
|
|
|
|
|
|
# [078] |
1410
|
|
|
|
|
|
|
# l-comment ::= |
1411
|
|
|
|
|
|
|
# s-separate-in-line c-nb-comment-text? |
1412
|
|
|
|
|
|
|
# b-comment |
1413
|
|
|
|
|
|
|
|
1414
|
|
|
|
|
|
|
rule '078', l_comment => sub { |
1415
|
12
|
|
|
12
|
|
39
|
my ($self) = @_; |
1416
|
12
|
|
|
|
|
17
|
debug_rule("l_comment") if DEBUG; |
1417
|
12
|
|
|
|
|
35
|
$self->all( |
1418
|
|
|
|
|
|
|
$self->func('s_separate_in_line'), |
1419
|
|
|
|
|
|
|
$self->rep(0, 1, $self->func('c_nb_comment_text')), |
1420
|
|
|
|
|
|
|
$self->func('b_comment') |
1421
|
|
|
|
|
|
|
); |
1422
|
|
|
|
|
|
|
}; |
1423
|
|
|
|
|
|
|
|
1424
|
|
|
|
|
|
|
|
1425
|
|
|
|
|
|
|
|
1426
|
|
|
|
|
|
|
# [079] |
1427
|
|
|
|
|
|
|
# s-l-comments ::= |
1428
|
|
|
|
|
|
|
# ( s-b-comment | ) |
1429
|
|
|
|
|
|
|
# l-comment* |
1430
|
|
|
|
|
|
|
|
1431
|
|
|
|
|
|
|
rule '079', s_l_comments => sub { |
1432
|
26
|
|
|
26
|
|
66
|
my ($self) = @_; |
1433
|
26
|
|
|
|
|
47
|
debug_rule("s_l_comments") if DEBUG; |
1434
|
26
|
|
|
|
|
76
|
$self->all( |
1435
|
|
|
|
|
|
|
$self->any( |
1436
|
|
|
|
|
|
|
$self->func('s_b_comment'), |
1437
|
|
|
|
|
|
|
$self->func('start_of_line') |
1438
|
|
|
|
|
|
|
), |
1439
|
|
|
|
|
|
|
$self->rep(0, undef, $self->func('l_comment')) |
1440
|
|
|
|
|
|
|
); |
1441
|
|
|
|
|
|
|
}; |
1442
|
|
|
|
|
|
|
|
1443
|
|
|
|
|
|
|
|
1444
|
|
|
|
|
|
|
|
1445
|
|
|
|
|
|
|
# [080] |
1446
|
|
|
|
|
|
|
# s-separate(n,c) ::= |
1447
|
|
|
|
|
|
|
# ( c = block-out => s-separate-lines(n) ) |
1448
|
|
|
|
|
|
|
# ( c = block-in => s-separate-lines(n) ) |
1449
|
|
|
|
|
|
|
# ( c = flow-out => s-separate-lines(n) ) |
1450
|
|
|
|
|
|
|
# ( c = flow-in => s-separate-lines(n) ) |
1451
|
|
|
|
|
|
|
# ( c = block-key => s-separate-in-line ) |
1452
|
|
|
|
|
|
|
# ( c = flow-key => s-separate-in-line ) |
1453
|
|
|
|
|
|
|
|
1454
|
|
|
|
|
|
|
rule '080', s_separate => sub { |
1455
|
20
|
|
|
20
|
|
57
|
my ($self, $n, $c) = @_; |
1456
|
20
|
|
|
|
|
35
|
debug_rule("s_separate",$n,$c) if DEBUG; |
1457
|
20
|
|
|
|
|
74
|
$self->case( |
1458
|
|
|
|
|
|
|
$c, |
1459
|
|
|
|
|
|
|
{ |
1460
|
|
|
|
|
|
|
'block-in' => [ $self->func('s_separate_lines'), $n ], |
1461
|
|
|
|
|
|
|
'block-key' => $self->func('s_separate_in_line'), |
1462
|
|
|
|
|
|
|
'block-out' => [ $self->func('s_separate_lines'), $n ], |
1463
|
|
|
|
|
|
|
'flow-in' => [ $self->func('s_separate_lines'), $n ], |
1464
|
|
|
|
|
|
|
'flow-key' => $self->func('s_separate_in_line'), |
1465
|
|
|
|
|
|
|
'flow-out' => [ $self->func('s_separate_lines'), $n ], |
1466
|
|
|
|
|
|
|
} |
1467
|
|
|
|
|
|
|
); |
1468
|
|
|
|
|
|
|
}; |
1469
|
|
|
|
|
|
|
|
1470
|
|
|
|
|
|
|
|
1471
|
|
|
|
|
|
|
|
1472
|
|
|
|
|
|
|
# [081] |
1473
|
|
|
|
|
|
|
# s-separate-lines(n) ::= |
1474
|
|
|
|
|
|
|
# ( s-l-comments |
1475
|
|
|
|
|
|
|
# s-flow-line-prefix(n) ) |
1476
|
|
|
|
|
|
|
# | s-separate-in-line |
1477
|
|
|
|
|
|
|
|
1478
|
|
|
|
|
|
|
rule '081', s_separate_lines => sub { |
1479
|
20
|
|
|
20
|
|
64
|
my ($self, $n) = @_; |
1480
|
20
|
|
|
|
|
30
|
debug_rule("s_separate_lines",$n) if DEBUG; |
1481
|
20
|
|
|
|
|
65
|
$self->any( |
1482
|
|
|
|
|
|
|
$self->all( |
1483
|
|
|
|
|
|
|
$self->func('s_l_comments'), |
1484
|
|
|
|
|
|
|
[ $self->func('s_flow_line_prefix'), $n ] |
1485
|
|
|
|
|
|
|
), |
1486
|
|
|
|
|
|
|
$self->func('s_separate_in_line') |
1487
|
|
|
|
|
|
|
); |
1488
|
|
|
|
|
|
|
}; |
1489
|
|
|
|
|
|
|
|
1490
|
|
|
|
|
|
|
|
1491
|
|
|
|
|
|
|
|
1492
|
|
|
|
|
|
|
# [082] |
1493
|
|
|
|
|
|
|
# l-directive ::= |
1494
|
|
|
|
|
|
|
# '%' |
1495
|
|
|
|
|
|
|
# ( ns-yaml-directive |
1496
|
|
|
|
|
|
|
# | ns-tag-directive |
1497
|
|
|
|
|
|
|
# | ns-reserved-directive ) |
1498
|
|
|
|
|
|
|
# s-l-comments |
1499
|
|
|
|
|
|
|
|
1500
|
|
|
|
|
|
|
rule '082', l_directive => sub { |
1501
|
2
|
|
|
2
|
|
5
|
my ($self) = @_; |
1502
|
2
|
|
|
|
|
3
|
debug_rule("l_directive") if DEBUG; |
1503
|
2
|
|
|
|
|
7
|
$self->all( |
1504
|
|
|
|
|
|
|
$self->chr('%'), |
1505
|
|
|
|
|
|
|
$self->any( |
1506
|
|
|
|
|
|
|
$self->func('ns_yaml_directive'), |
1507
|
|
|
|
|
|
|
$self->func('ns_tag_directive'), |
1508
|
|
|
|
|
|
|
$self->func('ns_reserved_directive') |
1509
|
|
|
|
|
|
|
), |
1510
|
|
|
|
|
|
|
$self->func('s_l_comments') |
1511
|
|
|
|
|
|
|
); |
1512
|
|
|
|
|
|
|
}; |
1513
|
|
|
|
|
|
|
|
1514
|
|
|
|
|
|
|
|
1515
|
|
|
|
|
|
|
|
1516
|
|
|
|
|
|
|
# [083] |
1517
|
|
|
|
|
|
|
# ns-reserved-directive ::= |
1518
|
|
|
|
|
|
|
# ns-directive-name |
1519
|
|
|
|
|
|
|
# ( s-separate-in-line ns-directive-parameter )* |
1520
|
|
|
|
|
|
|
|
1521
|
|
|
|
|
|
|
rule '083', ns_reserved_directive => sub { |
1522
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1523
|
0
|
|
|
|
|
0
|
debug_rule("ns_reserved_directive") if DEBUG; |
1524
|
0
|
|
|
|
|
0
|
$self->all( |
1525
|
|
|
|
|
|
|
$self->func('ns_directive_name'), |
1526
|
|
|
|
|
|
|
$self->rep(0, undef, |
1527
|
|
|
|
|
|
|
$self->all( |
1528
|
|
|
|
|
|
|
$self->func('s_separate_in_line'), |
1529
|
|
|
|
|
|
|
$self->func('ns_directive_parameter') |
1530
|
|
|
|
|
|
|
)) |
1531
|
|
|
|
|
|
|
); |
1532
|
|
|
|
|
|
|
}; |
1533
|
|
|
|
|
|
|
|
1534
|
|
|
|
|
|
|
|
1535
|
|
|
|
|
|
|
|
1536
|
|
|
|
|
|
|
# [084] |
1537
|
|
|
|
|
|
|
# ns-directive-name ::= |
1538
|
|
|
|
|
|
|
# ns-char+ |
1539
|
|
|
|
|
|
|
|
1540
|
|
|
|
|
|
|
rule '084', ns_directive_name => sub { |
1541
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1542
|
0
|
|
|
|
|
0
|
debug_rule("ns_directive_name") if DEBUG; |
1543
|
0
|
|
|
|
|
0
|
$self->rep(1, undef, $self->func('ns_char')); |
1544
|
|
|
|
|
|
|
}; |
1545
|
|
|
|
|
|
|
|
1546
|
|
|
|
|
|
|
|
1547
|
|
|
|
|
|
|
|
1548
|
|
|
|
|
|
|
# [085] |
1549
|
|
|
|
|
|
|
# ns-directive-parameter ::= |
1550
|
|
|
|
|
|
|
# ns-char+ |
1551
|
|
|
|
|
|
|
|
1552
|
|
|
|
|
|
|
rule '085', ns_directive_parameter => sub { |
1553
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1554
|
0
|
|
|
|
|
0
|
debug_rule("ns_directive_parameter") if DEBUG; |
1555
|
0
|
|
|
|
|
0
|
$self->rep(1, undef, $self->func('ns_char')); |
1556
|
|
|
|
|
|
|
}; |
1557
|
|
|
|
|
|
|
|
1558
|
|
|
|
|
|
|
|
1559
|
|
|
|
|
|
|
|
1560
|
|
|
|
|
|
|
# [086] |
1561
|
|
|
|
|
|
|
# ns-yaml-directive ::= |
1562
|
|
|
|
|
|
|
# 'Y' 'A' 'M' 'L' |
1563
|
|
|
|
|
|
|
# s-separate-in-line ns-yaml-version |
1564
|
|
|
|
|
|
|
|
1565
|
|
|
|
|
|
|
rule '086', ns_yaml_directive => sub { |
1566
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1567
|
0
|
|
|
|
|
0
|
debug_rule("ns_yaml_directive") if DEBUG; |
1568
|
0
|
|
|
|
|
0
|
$self->all( |
1569
|
|
|
|
|
|
|
$self->chr('Y'), |
1570
|
|
|
|
|
|
|
$self->chr('A'), |
1571
|
|
|
|
|
|
|
$self->chr('M'), |
1572
|
|
|
|
|
|
|
$self->chr('L'), |
1573
|
|
|
|
|
|
|
$self->func('s_separate_in_line'), |
1574
|
|
|
|
|
|
|
$self->func('ns_yaml_version') |
1575
|
|
|
|
|
|
|
); |
1576
|
|
|
|
|
|
|
}; |
1577
|
|
|
|
|
|
|
|
1578
|
|
|
|
|
|
|
|
1579
|
|
|
|
|
|
|
|
1580
|
|
|
|
|
|
|
# [087] |
1581
|
|
|
|
|
|
|
# ns-yaml-version ::= |
1582
|
|
|
|
|
|
|
# ns-dec-digit+ '.' ns-dec-digit+ |
1583
|
|
|
|
|
|
|
|
1584
|
|
|
|
|
|
|
rule '087', ns_yaml_version => sub { |
1585
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1586
|
0
|
|
|
|
|
0
|
debug_rule("ns_yaml_version") if DEBUG; |
1587
|
0
|
|
|
|
|
0
|
$self->all( |
1588
|
|
|
|
|
|
|
$self->rep(1, undef, $self->func('ns_dec_digit')), |
1589
|
|
|
|
|
|
|
$self->chr('.'), |
1590
|
|
|
|
|
|
|
$self->rep2(1, undef, $self->func('ns_dec_digit')) |
1591
|
|
|
|
|
|
|
); |
1592
|
|
|
|
|
|
|
}; |
1593
|
|
|
|
|
|
|
|
1594
|
|
|
|
|
|
|
|
1595
|
|
|
|
|
|
|
|
1596
|
|
|
|
|
|
|
# [088] |
1597
|
|
|
|
|
|
|
# ns-tag-directive ::= |
1598
|
|
|
|
|
|
|
# 'T' 'A' 'G' |
1599
|
|
|
|
|
|
|
# s-separate-in-line c-tag-handle |
1600
|
|
|
|
|
|
|
# s-separate-in-line ns-tag-prefix |
1601
|
|
|
|
|
|
|
|
1602
|
|
|
|
|
|
|
rule '088', ns_tag_directive => sub { |
1603
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1604
|
0
|
|
|
|
|
0
|
debug_rule("ns_tag_directive") if DEBUG; |
1605
|
0
|
|
|
|
|
0
|
$self->all( |
1606
|
|
|
|
|
|
|
$self->chr('T'), |
1607
|
|
|
|
|
|
|
$self->chr('A'), |
1608
|
|
|
|
|
|
|
$self->chr('G'), |
1609
|
|
|
|
|
|
|
$self->func('s_separate_in_line'), |
1610
|
|
|
|
|
|
|
$self->func('c_tag_handle'), |
1611
|
|
|
|
|
|
|
$self->func('s_separate_in_line'), |
1612
|
|
|
|
|
|
|
$self->func('ns_tag_prefix') |
1613
|
|
|
|
|
|
|
); |
1614
|
|
|
|
|
|
|
}; |
1615
|
|
|
|
|
|
|
|
1616
|
|
|
|
|
|
|
|
1617
|
|
|
|
|
|
|
|
1618
|
|
|
|
|
|
|
# [089] |
1619
|
|
|
|
|
|
|
# c-tag-handle ::= |
1620
|
|
|
|
|
|
|
# c-named-tag-handle |
1621
|
|
|
|
|
|
|
# | c-secondary-tag-handle |
1622
|
|
|
|
|
|
|
# | c-primary-tag-handle |
1623
|
|
|
|
|
|
|
|
1624
|
|
|
|
|
|
|
rule '089', c_tag_handle => sub { |
1625
|
26
|
|
|
26
|
|
61
|
my ($self) = @_; |
1626
|
26
|
|
|
|
|
46
|
debug_rule("c_tag_handle") if DEBUG; |
1627
|
26
|
|
|
|
|
82
|
$self->any( |
1628
|
|
|
|
|
|
|
$self->func('c_named_tag_handle'), |
1629
|
|
|
|
|
|
|
$self->func('c_secondary_tag_handle'), |
1630
|
|
|
|
|
|
|
$self->func('c_primary_tag_handle') |
1631
|
|
|
|
|
|
|
); |
1632
|
|
|
|
|
|
|
}; |
1633
|
|
|
|
|
|
|
|
1634
|
|
|
|
|
|
|
|
1635
|
|
|
|
|
|
|
|
1636
|
|
|
|
|
|
|
# [090] |
1637
|
|
|
|
|
|
|
# c-primary-tag-handle ::= |
1638
|
|
|
|
|
|
|
# '!' |
1639
|
|
|
|
|
|
|
|
1640
|
|
|
|
|
|
|
rule '090', c_primary_tag_handle => sub { |
1641
|
26
|
|
|
26
|
|
70
|
my ($self) = @_; |
1642
|
26
|
|
|
|
|
37
|
debug_rule("c_primary_tag_handle") if DEBUG; |
1643
|
26
|
|
|
|
|
72
|
$self->chr('!'); |
1644
|
|
|
|
|
|
|
}; |
1645
|
|
|
|
|
|
|
|
1646
|
|
|
|
|
|
|
|
1647
|
|
|
|
|
|
|
|
1648
|
|
|
|
|
|
|
# [091] |
1649
|
|
|
|
|
|
|
# c-secondary-tag-handle ::= |
1650
|
|
|
|
|
|
|
# '!' '!' |
1651
|
|
|
|
|
|
|
|
1652
|
|
|
|
|
|
|
rule '091', c_secondary_tag_handle => sub { |
1653
|
26
|
|
|
26
|
|
67
|
my ($self) = @_; |
1654
|
26
|
|
|
|
|
49
|
debug_rule("c_secondary_tag_handle") if DEBUG; |
1655
|
26
|
|
|
|
|
86
|
$self->all( |
1656
|
|
|
|
|
|
|
$self->chr('!'), |
1657
|
|
|
|
|
|
|
$self->chr('!') |
1658
|
|
|
|
|
|
|
); |
1659
|
|
|
|
|
|
|
}; |
1660
|
|
|
|
|
|
|
|
1661
|
|
|
|
|
|
|
|
1662
|
|
|
|
|
|
|
|
1663
|
|
|
|
|
|
|
# [092] |
1664
|
|
|
|
|
|
|
# c-named-tag-handle ::= |
1665
|
|
|
|
|
|
|
# '!' ns-word-char+ '!' |
1666
|
|
|
|
|
|
|
|
1667
|
|
|
|
|
|
|
rule '092', c_named_tag_handle => sub { |
1668
|
26
|
|
|
26
|
|
65
|
my ($self) = @_; |
1669
|
26
|
|
|
|
|
46
|
debug_rule("c_named_tag_handle") if DEBUG; |
1670
|
26
|
|
|
|
|
95
|
$self->all( |
1671
|
|
|
|
|
|
|
$self->chr('!'), |
1672
|
|
|
|
|
|
|
$self->rep(1, undef, $self->func('ns_word_char')), |
1673
|
|
|
|
|
|
|
$self->chr('!') |
1674
|
|
|
|
|
|
|
); |
1675
|
|
|
|
|
|
|
}; |
1676
|
|
|
|
|
|
|
|
1677
|
|
|
|
|
|
|
|
1678
|
|
|
|
|
|
|
|
1679
|
|
|
|
|
|
|
# [093] |
1680
|
|
|
|
|
|
|
# ns-tag-prefix ::= |
1681
|
|
|
|
|
|
|
# c-ns-local-tag-prefix | ns-global-tag-prefix |
1682
|
|
|
|
|
|
|
|
1683
|
|
|
|
|
|
|
rule '093', ns_tag_prefix => sub { |
1684
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1685
|
0
|
|
|
|
|
0
|
debug_rule("ns_tag_prefix") if DEBUG; |
1686
|
0
|
|
|
|
|
0
|
$self->any( |
1687
|
|
|
|
|
|
|
$self->func('c_ns_local_tag_prefix'), |
1688
|
|
|
|
|
|
|
$self->func('ns_global_tag_prefix') |
1689
|
|
|
|
|
|
|
); |
1690
|
|
|
|
|
|
|
}; |
1691
|
|
|
|
|
|
|
|
1692
|
|
|
|
|
|
|
|
1693
|
|
|
|
|
|
|
|
1694
|
|
|
|
|
|
|
# [094] |
1695
|
|
|
|
|
|
|
# c-ns-local-tag-prefix ::= |
1696
|
|
|
|
|
|
|
# '!' ns-uri-char* |
1697
|
|
|
|
|
|
|
|
1698
|
|
|
|
|
|
|
rule '094', c_ns_local_tag_prefix => sub { |
1699
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1700
|
0
|
|
|
|
|
0
|
debug_rule("c_ns_local_tag_prefix") if DEBUG; |
1701
|
0
|
|
|
|
|
0
|
$self->all( |
1702
|
|
|
|
|
|
|
$self->chr('!'), |
1703
|
|
|
|
|
|
|
$self->rep(0, undef, $self->func('ns_uri_char')) |
1704
|
|
|
|
|
|
|
); |
1705
|
|
|
|
|
|
|
}; |
1706
|
|
|
|
|
|
|
|
1707
|
|
|
|
|
|
|
|
1708
|
|
|
|
|
|
|
|
1709
|
|
|
|
|
|
|
# [095] |
1710
|
|
|
|
|
|
|
# ns-global-tag-prefix ::= |
1711
|
|
|
|
|
|
|
# ns-tag-char ns-uri-char* |
1712
|
|
|
|
|
|
|
|
1713
|
|
|
|
|
|
|
rule '095', ns_global_tag_prefix => sub { |
1714
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1715
|
0
|
|
|
|
|
0
|
debug_rule("ns_global_tag_prefix") if DEBUG; |
1716
|
0
|
|
|
|
|
0
|
$self->all( |
1717
|
|
|
|
|
|
|
$self->func('ns_tag_char'), |
1718
|
|
|
|
|
|
|
$self->rep(0, undef, $self->func('ns_uri_char')) |
1719
|
|
|
|
|
|
|
); |
1720
|
|
|
|
|
|
|
}; |
1721
|
|
|
|
|
|
|
|
1722
|
|
|
|
|
|
|
|
1723
|
|
|
|
|
|
|
|
1724
|
|
|
|
|
|
|
# [096] |
1725
|
|
|
|
|
|
|
# c-ns-properties(n,c) ::= |
1726
|
|
|
|
|
|
|
# ( c-ns-tag-property |
1727
|
|
|
|
|
|
|
# ( s-separate(n,c) c-ns-anchor-property )? ) |
1728
|
|
|
|
|
|
|
# | ( c-ns-anchor-property |
1729
|
|
|
|
|
|
|
# ( s-separate(n,c) c-ns-tag-property )? ) |
1730
|
|
|
|
|
|
|
|
1731
|
|
|
|
|
|
|
rule '096', c_ns_properties => sub { |
1732
|
22
|
|
|
22
|
|
70
|
my ($self, $n, $c) = @_; |
1733
|
22
|
|
|
|
|
33
|
debug_rule("c_ns_properties",$n,$c) if DEBUG; |
1734
|
22
|
|
|
|
|
76
|
$self->any( |
1735
|
|
|
|
|
|
|
$self->all( |
1736
|
|
|
|
|
|
|
$self->func('c_ns_tag_property'), |
1737
|
|
|
|
|
|
|
$self->rep(0, 1, |
1738
|
|
|
|
|
|
|
$self->all( |
1739
|
|
|
|
|
|
|
[ $self->func('s_separate'), $n, $c ], |
1740
|
|
|
|
|
|
|
$self->func('c_ns_anchor_property') |
1741
|
|
|
|
|
|
|
)) |
1742
|
|
|
|
|
|
|
), |
1743
|
|
|
|
|
|
|
$self->all( |
1744
|
|
|
|
|
|
|
$self->func('c_ns_anchor_property'), |
1745
|
|
|
|
|
|
|
$self->rep(0, 1, |
1746
|
|
|
|
|
|
|
$self->all( |
1747
|
|
|
|
|
|
|
[ $self->func('s_separate'), $n, $c ], |
1748
|
|
|
|
|
|
|
$self->func('c_ns_tag_property') |
1749
|
|
|
|
|
|
|
)) |
1750
|
|
|
|
|
|
|
) |
1751
|
|
|
|
|
|
|
); |
1752
|
|
|
|
|
|
|
}; |
1753
|
|
|
|
|
|
|
|
1754
|
|
|
|
|
|
|
|
1755
|
|
|
|
|
|
|
|
1756
|
|
|
|
|
|
|
# [097] |
1757
|
|
|
|
|
|
|
# c-ns-tag-property ::= |
1758
|
|
|
|
|
|
|
# c-verbatim-tag |
1759
|
|
|
|
|
|
|
# | c-ns-shorthand-tag |
1760
|
|
|
|
|
|
|
# | c-non-specific-tag |
1761
|
|
|
|
|
|
|
|
1762
|
|
|
|
|
|
|
rule '097', c_ns_tag_property => sub { |
1763
|
26
|
|
|
26
|
|
60
|
my ($self) = @_; |
1764
|
26
|
|
|
|
|
40
|
debug_rule("c_ns_tag_property") if DEBUG; |
1765
|
26
|
|
|
|
|
77
|
$self->any( |
1766
|
|
|
|
|
|
|
$self->func('c_verbatim_tag'), |
1767
|
|
|
|
|
|
|
$self->func('c_ns_shorthand_tag'), |
1768
|
|
|
|
|
|
|
$self->func('c_non_specific_tag') |
1769
|
|
|
|
|
|
|
); |
1770
|
|
|
|
|
|
|
}; |
1771
|
|
|
|
|
|
|
|
1772
|
|
|
|
|
|
|
|
1773
|
|
|
|
|
|
|
|
1774
|
|
|
|
|
|
|
# [098] |
1775
|
|
|
|
|
|
|
# c-verbatim-tag ::= |
1776
|
|
|
|
|
|
|
# '!' '<' ns-uri-char+ '>' |
1777
|
|
|
|
|
|
|
|
1778
|
|
|
|
|
|
|
rule '098', c_verbatim_tag => sub { |
1779
|
26
|
|
|
26
|
|
90
|
my ($self) = @_; |
1780
|
26
|
|
|
|
|
40
|
debug_rule("c_verbatim_tag") if DEBUG; |
1781
|
26
|
|
|
|
|
87
|
$self->all( |
1782
|
|
|
|
|
|
|
$self->chr('!'), |
1783
|
|
|
|
|
|
|
$self->chr('<'), |
1784
|
|
|
|
|
|
|
$self->rep(1, undef, $self->func('ns_uri_char')), |
1785
|
|
|
|
|
|
|
$self->chr('>') |
1786
|
|
|
|
|
|
|
); |
1787
|
|
|
|
|
|
|
}; |
1788
|
|
|
|
|
|
|
|
1789
|
|
|
|
|
|
|
|
1790
|
|
|
|
|
|
|
|
1791
|
|
|
|
|
|
|
# [099] |
1792
|
|
|
|
|
|
|
# c-ns-shorthand-tag ::= |
1793
|
|
|
|
|
|
|
# c-tag-handle ns-tag-char+ |
1794
|
|
|
|
|
|
|
|
1795
|
|
|
|
|
|
|
rule '099', c_ns_shorthand_tag => sub { |
1796
|
26
|
|
|
26
|
|
82
|
my ($self) = @_; |
1797
|
26
|
|
|
|
|
39
|
debug_rule("c_ns_shorthand_tag") if DEBUG; |
1798
|
26
|
|
|
|
|
118
|
$self->all( |
1799
|
|
|
|
|
|
|
$self->func('c_tag_handle'), |
1800
|
|
|
|
|
|
|
$self->rep(1, undef, $self->func('ns_tag_char')) |
1801
|
|
|
|
|
|
|
); |
1802
|
|
|
|
|
|
|
}; |
1803
|
|
|
|
|
|
|
|
1804
|
|
|
|
|
|
|
|
1805
|
|
|
|
|
|
|
|
1806
|
|
|
|
|
|
|
# [100] |
1807
|
|
|
|
|
|
|
# c-non-specific-tag ::= |
1808
|
|
|
|
|
|
|
# '!' |
1809
|
|
|
|
|
|
|
|
1810
|
|
|
|
|
|
|
rule '100', c_non_specific_tag => sub { |
1811
|
26
|
|
|
26
|
|
65
|
my ($self) = @_; |
1812
|
26
|
|
|
|
|
44
|
debug_rule("c_non_specific_tag") if DEBUG; |
1813
|
26
|
|
|
|
|
71
|
$self->chr('!'); |
1814
|
|
|
|
|
|
|
}; |
1815
|
|
|
|
|
|
|
|
1816
|
|
|
|
|
|
|
|
1817
|
|
|
|
|
|
|
|
1818
|
|
|
|
|
|
|
# [101] |
1819
|
|
|
|
|
|
|
# c-ns-anchor-property ::= |
1820
|
|
|
|
|
|
|
# '&' ns-anchor-name |
1821
|
|
|
|
|
|
|
|
1822
|
|
|
|
|
|
|
rule '101', c_ns_anchor_property => sub { |
1823
|
26
|
|
|
26
|
|
77
|
my ($self) = @_; |
1824
|
26
|
|
|
|
|
41
|
debug_rule("c_ns_anchor_property") if DEBUG; |
1825
|
26
|
|
|
|
|
87
|
$self->all( |
1826
|
|
|
|
|
|
|
$self->chr('&'), |
1827
|
|
|
|
|
|
|
$self->func('ns_anchor_name') |
1828
|
|
|
|
|
|
|
); |
1829
|
|
|
|
|
|
|
}; |
1830
|
|
|
|
|
|
|
|
1831
|
|
|
|
|
|
|
|
1832
|
|
|
|
|
|
|
|
1833
|
|
|
|
|
|
|
# [102] |
1834
|
|
|
|
|
|
|
# ns-anchor-char ::= |
1835
|
|
|
|
|
|
|
# ns-char - c-flow-indicator |
1836
|
|
|
|
|
|
|
|
1837
|
|
|
|
|
|
|
rule '102', ns_anchor_char => sub { |
1838
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1839
|
0
|
|
|
|
|
0
|
debug_rule("ns_anchor_char") if DEBUG; |
1840
|
0
|
|
|
|
|
0
|
$self->but( |
1841
|
|
|
|
|
|
|
$self->func('ns_char'), |
1842
|
|
|
|
|
|
|
$self->func('c_flow_indicator') |
1843
|
|
|
|
|
|
|
); |
1844
|
|
|
|
|
|
|
}; |
1845
|
|
|
|
|
|
|
|
1846
|
|
|
|
|
|
|
|
1847
|
|
|
|
|
|
|
|
1848
|
|
|
|
|
|
|
# [103] |
1849
|
|
|
|
|
|
|
# ns-anchor-name ::= |
1850
|
|
|
|
|
|
|
# ns-anchor-char+ |
1851
|
|
|
|
|
|
|
|
1852
|
|
|
|
|
|
|
rule '103', ns_anchor_name => sub { |
1853
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1854
|
0
|
|
|
|
|
0
|
debug_rule("ns_anchor_name") if DEBUG; |
1855
|
0
|
|
|
|
|
0
|
$self->rep(1, undef, $self->func('ns_anchor_char')); |
1856
|
|
|
|
|
|
|
}; |
1857
|
|
|
|
|
|
|
|
1858
|
|
|
|
|
|
|
|
1859
|
|
|
|
|
|
|
|
1860
|
|
|
|
|
|
|
# [104] |
1861
|
|
|
|
|
|
|
# c-ns-alias-node ::= |
1862
|
|
|
|
|
|
|
# '*' ns-anchor-name |
1863
|
|
|
|
|
|
|
|
1864
|
|
|
|
|
|
|
rule '104', c_ns_alias_node => sub { |
1865
|
16
|
|
|
16
|
|
48
|
my ($self) = @_; |
1866
|
16
|
|
|
|
|
30
|
debug_rule("c_ns_alias_node") if DEBUG; |
1867
|
16
|
|
|
|
|
55
|
$self->all( |
1868
|
|
|
|
|
|
|
$self->chr('*'), |
1869
|
|
|
|
|
|
|
$self->func('ns_anchor_name') |
1870
|
|
|
|
|
|
|
); |
1871
|
|
|
|
|
|
|
}; |
1872
|
|
|
|
|
|
|
|
1873
|
|
|
|
|
|
|
|
1874
|
|
|
|
|
|
|
|
1875
|
|
|
|
|
|
|
# [105] |
1876
|
|
|
|
|
|
|
# e-scalar ::= |
1877
|
|
|
|
|
|
|
# |
1878
|
|
|
|
|
|
|
|
1879
|
|
|
|
|
|
|
rule '105', e_scalar => sub { |
1880
|
6
|
|
|
6
|
|
17
|
my ($self) = @_; |
1881
|
6
|
|
|
|
|
13
|
debug_rule("e_scalar") if DEBUG; |
1882
|
6
|
|
|
|
|
17
|
$self->func('empty'); |
1883
|
|
|
|
|
|
|
}; |
1884
|
|
|
|
|
|
|
|
1885
|
|
|
|
|
|
|
|
1886
|
|
|
|
|
|
|
|
1887
|
|
|
|
|
|
|
# [106] |
1888
|
|
|
|
|
|
|
# e-node ::= |
1889
|
|
|
|
|
|
|
# e-scalar |
1890
|
|
|
|
|
|
|
|
1891
|
|
|
|
|
|
|
rule '106', e_node => sub { |
1892
|
6
|
|
|
6
|
|
17
|
my ($self) = @_; |
1893
|
6
|
|
|
|
|
11
|
debug_rule("e_node") if DEBUG; |
1894
|
6
|
|
|
|
|
23
|
$self->func('e_scalar'); |
1895
|
|
|
|
|
|
|
}; |
1896
|
|
|
|
|
|
|
|
1897
|
|
|
|
|
|
|
|
1898
|
|
|
|
|
|
|
|
1899
|
|
|
|
|
|
|
# [107] |
1900
|
|
|
|
|
|
|
# nb-double-char ::= |
1901
|
|
|
|
|
|
|
# c-ns-esc-char | ( nb-json - '\' - '"' ) |
1902
|
|
|
|
|
|
|
|
1903
|
|
|
|
|
|
|
rule '107', nb_double_char => sub { |
1904
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1905
|
0
|
|
|
|
|
0
|
debug_rule("nb_double_char") if DEBUG; |
1906
|
0
|
|
|
|
|
0
|
$self->any( |
1907
|
|
|
|
|
|
|
$self->func('c_ns_esc_char'), |
1908
|
|
|
|
|
|
|
$self->but( |
1909
|
|
|
|
|
|
|
$self->func('nb_json'), |
1910
|
|
|
|
|
|
|
$self->chr("\\"), |
1911
|
|
|
|
|
|
|
$self->chr('"') |
1912
|
|
|
|
|
|
|
) |
1913
|
|
|
|
|
|
|
); |
1914
|
|
|
|
|
|
|
}; |
1915
|
|
|
|
|
|
|
|
1916
|
|
|
|
|
|
|
|
1917
|
|
|
|
|
|
|
|
1918
|
|
|
|
|
|
|
# [108] |
1919
|
|
|
|
|
|
|
# ns-double-char ::= |
1920
|
|
|
|
|
|
|
# nb-double-char - s-white |
1921
|
|
|
|
|
|
|
|
1922
|
|
|
|
|
|
|
rule '108', ns_double_char => sub { |
1923
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1924
|
0
|
|
|
|
|
0
|
debug_rule("ns_double_char") if DEBUG; |
1925
|
0
|
|
|
|
|
0
|
$self->but( |
1926
|
|
|
|
|
|
|
$self->func('nb_double_char'), |
1927
|
|
|
|
|
|
|
$self->func('s_white') |
1928
|
|
|
|
|
|
|
); |
1929
|
|
|
|
|
|
|
}; |
1930
|
|
|
|
|
|
|
|
1931
|
|
|
|
|
|
|
|
1932
|
|
|
|
|
|
|
|
1933
|
|
|
|
|
|
|
# [109] |
1934
|
|
|
|
|
|
|
# c-double-quoted(n,c) ::= |
1935
|
|
|
|
|
|
|
# '"' nb-double-text(n,c) |
1936
|
|
|
|
|
|
|
# '"' |
1937
|
|
|
|
|
|
|
|
1938
|
|
|
|
|
|
|
rule '109', c_double_quoted => sub { |
1939
|
10
|
|
|
10
|
|
33
|
my ($self, $n, $c) = @_; |
1940
|
10
|
|
|
|
|
23
|
debug_rule("c_double_quoted",$n,$c) if DEBUG; |
1941
|
10
|
|
|
|
|
34
|
$self->all( |
1942
|
|
|
|
|
|
|
$self->chr('"'), |
1943
|
|
|
|
|
|
|
[ $self->func('nb_double_text'), $n, $c ], |
1944
|
|
|
|
|
|
|
$self->chr('"') |
1945
|
|
|
|
|
|
|
); |
1946
|
|
|
|
|
|
|
}; |
1947
|
|
|
|
|
|
|
|
1948
|
|
|
|
|
|
|
|
1949
|
|
|
|
|
|
|
|
1950
|
|
|
|
|
|
|
# [110] |
1951
|
|
|
|
|
|
|
# nb-double-text(n,c) ::= |
1952
|
|
|
|
|
|
|
# ( c = flow-out => nb-double-multi-line(n) ) |
1953
|
|
|
|
|
|
|
# ( c = flow-in => nb-double-multi-line(n) ) |
1954
|
|
|
|
|
|
|
# ( c = block-key => nb-double-one-line ) |
1955
|
|
|
|
|
|
|
# ( c = flow-key => nb-double-one-line ) |
1956
|
|
|
|
|
|
|
|
1957
|
|
|
|
|
|
|
rule '110', nb_double_text => sub { |
1958
|
0
|
|
|
0
|
|
0
|
my ($self, $n, $c) = @_; |
1959
|
0
|
|
|
|
|
0
|
debug_rule("nb_double_text",$n,$c) if DEBUG; |
1960
|
0
|
|
|
|
|
0
|
$self->case( |
1961
|
|
|
|
|
|
|
$c, |
1962
|
|
|
|
|
|
|
{ |
1963
|
|
|
|
|
|
|
'block-key' => $self->func('nb_double_one_line'), |
1964
|
|
|
|
|
|
|
'flow-in' => [ $self->func('nb_double_multi_line'), $n ], |
1965
|
|
|
|
|
|
|
'flow-key' => $self->func('nb_double_one_line'), |
1966
|
|
|
|
|
|
|
'flow-out' => [ $self->func('nb_double_multi_line'), $n ], |
1967
|
|
|
|
|
|
|
} |
1968
|
|
|
|
|
|
|
); |
1969
|
|
|
|
|
|
|
}; |
1970
|
|
|
|
|
|
|
|
1971
|
|
|
|
|
|
|
|
1972
|
|
|
|
|
|
|
|
1973
|
|
|
|
|
|
|
# [111] |
1974
|
|
|
|
|
|
|
# nb-double-one-line ::= |
1975
|
|
|
|
|
|
|
# nb-double-char* |
1976
|
|
|
|
|
|
|
|
1977
|
|
|
|
|
|
|
rule '111', nb_double_one_line => sub { |
1978
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1979
|
0
|
|
|
|
|
0
|
debug_rule("nb_double_one_line") if DEBUG; |
1980
|
0
|
|
|
|
|
0
|
$self->rep(0, undef, $self->func('nb_double_char')); |
1981
|
|
|
|
|
|
|
}; |
1982
|
|
|
|
|
|
|
|
1983
|
|
|
|
|
|
|
|
1984
|
|
|
|
|
|
|
|
1985
|
|
|
|
|
|
|
# [112] |
1986
|
|
|
|
|
|
|
# s-double-escaped(n) ::= |
1987
|
|
|
|
|
|
|
# s-white* '\' |
1988
|
|
|
|
|
|
|
# b-non-content |
1989
|
|
|
|
|
|
|
# l-empty(n,flow-in)* s-flow-line-prefix(n) |
1990
|
|
|
|
|
|
|
|
1991
|
|
|
|
|
|
|
rule '112', s_double_escaped => sub { |
1992
|
0
|
|
|
0
|
|
0
|
my ($self, $n) = @_; |
1993
|
0
|
|
|
|
|
0
|
debug_rule("s_double_escaped",$n) if DEBUG; |
1994
|
0
|
|
|
|
|
0
|
$self->all( |
1995
|
|
|
|
|
|
|
$self->rep(0, undef, $self->func('s_white')), |
1996
|
|
|
|
|
|
|
$self->chr("\\"), |
1997
|
|
|
|
|
|
|
$self->func('b_non_content'), |
1998
|
|
|
|
|
|
|
$self->rep2(0, undef, [ $self->func('l_empty'), $n, "flow-in" ]), |
1999
|
|
|
|
|
|
|
[ $self->func('s_flow_line_prefix'), $n ] |
2000
|
|
|
|
|
|
|
); |
2001
|
|
|
|
|
|
|
}; |
2002
|
|
|
|
|
|
|
|
2003
|
|
|
|
|
|
|
|
2004
|
|
|
|
|
|
|
|
2005
|
|
|
|
|
|
|
# [113] |
2006
|
|
|
|
|
|
|
# s-double-break(n) ::= |
2007
|
|
|
|
|
|
|
# s-double-escaped(n) | s-flow-folded(n) |
2008
|
|
|
|
|
|
|
|
2009
|
|
|
|
|
|
|
rule '113', s_double_break => sub { |
2010
|
0
|
|
|
0
|
|
0
|
my ($self, $n) = @_; |
2011
|
0
|
|
|
|
|
0
|
debug_rule("s_double_break",$n) if DEBUG; |
2012
|
0
|
|
|
|
|
0
|
$self->any( |
2013
|
|
|
|
|
|
|
[ $self->func('s_double_escaped'), $n ], |
2014
|
|
|
|
|
|
|
[ $self->func('s_flow_folded'), $n ] |
2015
|
|
|
|
|
|
|
); |
2016
|
|
|
|
|
|
|
}; |
2017
|
|
|
|
|
|
|
|
2018
|
|
|
|
|
|
|
|
2019
|
|
|
|
|
|
|
|
2020
|
|
|
|
|
|
|
# [114] |
2021
|
|
|
|
|
|
|
# nb-ns-double-in-line ::= |
2022
|
|
|
|
|
|
|
# ( s-white* ns-double-char )* |
2023
|
|
|
|
|
|
|
|
2024
|
|
|
|
|
|
|
rule '114', nb_ns_double_in_line => sub { |
2025
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
2026
|
0
|
|
|
|
|
0
|
debug_rule("nb_ns_double_in_line") if DEBUG; |
2027
|
0
|
|
|
|
|
0
|
$self->rep(0, undef, |
2028
|
|
|
|
|
|
|
$self->all( |
2029
|
|
|
|
|
|
|
$self->rep(0, undef, $self->func('s_white')), |
2030
|
|
|
|
|
|
|
$self->func('ns_double_char') |
2031
|
|
|
|
|
|
|
)); |
2032
|
|
|
|
|
|
|
}; |
2033
|
|
|
|
|
|
|
|
2034
|
|
|
|
|
|
|
|
2035
|
|
|
|
|
|
|
|
2036
|
|
|
|
|
|
|
# [115] |
2037
|
|
|
|
|
|
|
# s-double-next-line(n) ::= |
2038
|
|
|
|
|
|
|
# s-double-break(n) |
2039
|
|
|
|
|
|
|
# ( ns-double-char nb-ns-double-in-line |
2040
|
|
|
|
|
|
|
# ( s-double-next-line(n) | s-white* ) )? |
2041
|
|
|
|
|
|
|
|
2042
|
|
|
|
|
|
|
rule '115', s_double_next_line => sub { |
2043
|
0
|
|
|
0
|
|
0
|
my ($self, $n) = @_; |
2044
|
0
|
|
|
|
|
0
|
debug_rule("s_double_next_line",$n) if DEBUG; |
2045
|
0
|
|
|
|
|
0
|
$self->all( |
2046
|
|
|
|
|
|
|
[ $self->func('s_double_break'), $n ], |
2047
|
|
|
|
|
|
|
$self->rep(0, 1, |
2048
|
|
|
|
|
|
|
$self->all( |
2049
|
|
|
|
|
|
|
$self->func('ns_double_char'), |
2050
|
|
|
|
|
|
|
$self->func('nb_ns_double_in_line'), |
2051
|
|
|
|
|
|
|
$self->any( |
2052
|
|
|
|
|
|
|
[ $self->func('s_double_next_line'), $n ], |
2053
|
|
|
|
|
|
|
$self->rep(0, undef, $self->func('s_white')) |
2054
|
|
|
|
|
|
|
) |
2055
|
|
|
|
|
|
|
)) |
2056
|
|
|
|
|
|
|
); |
2057
|
|
|
|
|
|
|
}; |
2058
|
|
|
|
|
|
|
|
2059
|
|
|
|
|
|
|
|
2060
|
|
|
|
|
|
|
|
2061
|
|
|
|
|
|
|
# [116] |
2062
|
|
|
|
|
|
|
# nb-double-multi-line(n) ::= |
2063
|
|
|
|
|
|
|
# nb-ns-double-in-line |
2064
|
|
|
|
|
|
|
# ( s-double-next-line(n) | s-white* ) |
2065
|
|
|
|
|
|
|
|
2066
|
|
|
|
|
|
|
rule '116', nb_double_multi_line => sub { |
2067
|
0
|
|
|
0
|
|
0
|
my ($self, $n) = @_; |
2068
|
0
|
|
|
|
|
0
|
debug_rule("nb_double_multi_line",$n) if DEBUG; |
2069
|
0
|
|
|
|
|
0
|
$self->all( |
2070
|
|
|
|
|
|
|
$self->func('nb_ns_double_in_line'), |
2071
|
|
|
|
|
|
|
$self->any( |
2072
|
|
|
|
|
|
|
[ $self->func('s_double_next_line'), $n ], |
2073
|
|
|
|
|
|
|
$self->rep(0, undef, $self->func('s_white')) |
2074
|
|
|
|
|
|
|
) |
2075
|
|
|
|
|
|
|
); |
2076
|
|
|
|
|
|
|
}; |
2077
|
|
|
|
|
|
|
|
2078
|
|
|
|
|
|
|
|
2079
|
|
|
|
|
|
|
|
2080
|
|
|
|
|
|
|
# [117] |
2081
|
|
|
|
|
|
|
# c-quoted-quote ::= |
2082
|
|
|
|
|
|
|
# ''' ''' |
2083
|
|
|
|
|
|
|
|
2084
|
|
|
|
|
|
|
rule '117', c_quoted_quote => sub { |
2085
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
2086
|
0
|
|
|
|
|
0
|
debug_rule("c_quoted_quote") if DEBUG; |
2087
|
0
|
|
|
|
|
0
|
$self->all( |
2088
|
|
|
|
|
|
|
$self->chr("'"), |
2089
|
|
|
|
|
|
|
$self->chr("'") |
2090
|
|
|
|
|
|
|
); |
2091
|
|
|
|
|
|
|
}; |
2092
|
|
|
|
|
|
|
|
2093
|
|
|
|
|
|
|
|
2094
|
|
|
|
|
|
|
|
2095
|
|
|
|
|
|
|
# [118] |
2096
|
|
|
|
|
|
|
# nb-single-char ::= |
2097
|
|
|
|
|
|
|
# c-quoted-quote | ( nb-json - ''' ) |
2098
|
|
|
|
|
|
|
|
2099
|
|
|
|
|
|
|
rule '118', nb_single_char => sub { |
2100
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
2101
|
0
|
|
|
|
|
0
|
debug_rule("nb_single_char") if DEBUG; |
2102
|
0
|
|
|
|
|
0
|
$self->any( |
2103
|
|
|
|
|
|
|
$self->func('c_quoted_quote'), |
2104
|
|
|
|
|
|
|
$self->but( |
2105
|
|
|
|
|
|
|
$self->func('nb_json'), |
2106
|
|
|
|
|
|
|
$self->chr("'") |
2107
|
|
|
|
|
|
|
) |
2108
|
|
|
|
|
|
|
); |
2109
|
|
|
|
|
|
|
}; |
2110
|
|
|
|
|
|
|
|
2111
|
|
|
|
|
|
|
|
2112
|
|
|
|
|
|
|
|
2113
|
|
|
|
|
|
|
# [119] |
2114
|
|
|
|
|
|
|
# ns-single-char ::= |
2115
|
|
|
|
|
|
|
# nb-single-char - s-white |
2116
|
|
|
|
|
|
|
|
2117
|
|
|
|
|
|
|
rule '119', ns_single_char => sub { |
2118
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
2119
|
0
|
|
|
|
|
0
|
debug_rule("ns_single_char") if DEBUG; |
2120
|
0
|
|
|
|
|
0
|
$self->but( |
2121
|
|
|
|
|
|
|
$self->func('nb_single_char'), |
2122
|
|
|
|
|
|
|
$self->func('s_white') |
2123
|
|
|
|
|
|
|
); |
2124
|
|
|
|
|
|
|
}; |
2125
|
|
|
|
|
|
|
|
2126
|
|
|
|
|
|
|
|
2127
|
|
|
|
|
|
|
|
2128
|
|
|
|
|
|
|
# [120] |
2129
|
|
|
|
|
|
|
# c-single-quoted(n,c) ::= |
2130
|
|
|
|
|
|
|
# ''' nb-single-text(n,c) |
2131
|
|
|
|
|
|
|
# ''' |
2132
|
|
|
|
|
|
|
|
2133
|
|
|
|
|
|
|
rule '120', c_single_quoted => sub { |
2134
|
10
|
|
|
10
|
|
31
|
my ($self, $n, $c) = @_; |
2135
|
10
|
|
|
|
|
20
|
debug_rule("c_single_quoted",$n,$c) if DEBUG; |
2136
|
10
|
|
|
|
|
35
|
$self->all( |
2137
|
|
|
|
|
|
|
$self->chr("'"), |
2138
|
|
|
|
|
|
|
[ $self->func('nb_single_text'), $n, $c ], |
2139
|
|
|
|
|
|
|
$self->chr("'") |
2140
|
|
|
|
|
|
|
); |
2141
|
|
|
|
|
|
|
}; |
2142
|
|
|
|
|
|
|
|
2143
|
|
|
|
|
|
|
|
2144
|
|
|
|
|
|
|
|
2145
|
|
|
|
|
|
|
# [121] |
2146
|
|
|
|
|
|
|
# nb-single-text(n,c) ::= |
2147
|
|
|
|
|
|
|
# ( c = flow-out => nb-single-multi-line(n) ) |
2148
|
|
|
|
|
|
|
# ( c = flow-in => nb-single-multi-line(n) ) |
2149
|
|
|
|
|
|
|
# ( c = block-key => nb-single-one-line ) |
2150
|
|
|
|
|
|
|
# ( c = flow-key => nb-single-one-line ) |
2151
|
|
|
|
|
|
|
|
2152
|
|
|
|
|
|
|
rule '121', nb_single_text => sub { |
2153
|
0
|
|
|
0
|
|
0
|
my ($self, $n, $c) = @_; |
2154
|
0
|
|
|
|
|
0
|
debug_rule("nb_single_text",$n,$c) if DEBUG; |
2155
|
0
|
|
|
|
|
0
|
$self->case( |
2156
|
|
|
|
|
|
|
$c, |
2157
|
|
|
|
|
|
|
{ |
2158
|
|
|
|
|
|
|
'block-key' => $self->func('nb_single_one_line'), |
2159
|
|
|
|
|
|
|
'flow-in' => [ $self->func('nb_single_multi_line'), $n ], |
2160
|
|
|
|
|
|
|
'flow-key' => $self->func('nb_single_one_line'), |
2161
|
|
|
|
|
|
|
'flow-out' => [ $self->func('nb_single_multi_line'), $n ], |
2162
|
|
|
|
|
|
|
} |
2163
|
|
|
|
|
|
|
); |
2164
|
|
|
|
|
|
|
}; |
2165
|
|
|
|
|
|
|
|
2166
|
|
|
|
|
|
|
|
2167
|
|
|
|
|
|
|
|
2168
|
|
|
|
|
|
|
# [122] |
2169
|
|
|
|
|
|
|
# nb-single-one-line ::= |
2170
|
|
|
|
|
|
|
# nb-single-char* |
2171
|
|
|
|
|
|
|
|
2172
|
|
|
|
|
|
|
rule '122', nb_single_one_line => sub { |
2173
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
2174
|
0
|
|
|
|
|
0
|
debug_rule("nb_single_one_line") if DEBUG; |
2175
|
0
|
|
|
|
|
0
|
$self->rep(0, undef, $self->func('nb_single_char')); |
2176
|
|
|
|
|
|
|
}; |
2177
|
|
|
|
|
|
|
|
2178
|
|
|
|
|
|
|
|
2179
|
|
|
|
|
|
|
|
2180
|
|
|
|
|
|
|
# [123] |
2181
|
|
|
|
|
|
|
# nb-ns-single-in-line ::= |
2182
|
|
|
|
|
|
|
# ( s-white* ns-single-char )* |
2183
|
|
|
|
|
|
|
|
2184
|
|
|
|
|
|
|
rule '123', nb_ns_single_in_line => sub { |
2185
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
2186
|
0
|
|
|
|
|
0
|
debug_rule("nb_ns_single_in_line") if DEBUG; |
2187
|
0
|
|
|
|
|
0
|
$self->rep(0, undef, |
2188
|
|
|
|
|
|
|
$self->all( |
2189
|
|
|
|
|
|
|
$self->rep(0, undef, $self->func('s_white')), |
2190
|
|
|
|
|
|
|
$self->func('ns_single_char') |
2191
|
|
|
|
|
|
|
)); |
2192
|
|
|
|
|
|
|
}; |
2193
|
|
|
|
|
|
|
|
2194
|
|
|
|
|
|
|
|
2195
|
|
|
|
|
|
|
|
2196
|
|
|
|
|
|
|
# [124] |
2197
|
|
|
|
|
|
|
# s-single-next-line(n) ::= |
2198
|
|
|
|
|
|
|
# s-flow-folded(n) |
2199
|
|
|
|
|
|
|
# ( ns-single-char nb-ns-single-in-line |
2200
|
|
|
|
|
|
|
# ( s-single-next-line(n) | s-white* ) )? |
2201
|
|
|
|
|
|
|
|
2202
|
|
|
|
|
|
|
rule '124', s_single_next_line => sub { |
2203
|
0
|
|
|
0
|
|
0
|
my ($self, $n) = @_; |
2204
|
0
|
|
|
|
|
0
|
debug_rule("s_single_next_line",$n) if DEBUG; |
2205
|
0
|
|
|
|
|
0
|
$self->all( |
2206
|
|
|
|
|
|
|
[ $self->func('s_flow_folded'), $n ], |
2207
|
|
|
|
|
|
|
$self->rep(0, 1, |
2208
|
|
|
|
|
|
|
$self->all( |
2209
|
|
|
|
|
|
|
$self->func('ns_single_char'), |
2210
|
|
|
|
|
|
|
$self->func('nb_ns_single_in_line'), |
2211
|
|
|
|
|
|
|
$self->any( |
2212
|
|
|
|
|
|
|
[ $self->func('s_single_next_line'), $n ], |
2213
|
|
|
|
|
|
|
$self->rep(0, undef, $self->func('s_white')) |
2214
|
|
|
|
|
|
|
) |
2215
|
|
|
|
|
|
|
)) |
2216
|
|
|
|
|
|
|
); |
2217
|
|
|
|
|
|
|
}; |
2218
|
|
|
|
|
|
|
|
2219
|
|
|
|
|
|
|
|
2220
|
|
|
|
|
|
|
|
2221
|
|
|
|
|
|
|
# [125] |
2222
|
|
|
|
|
|
|
# nb-single-multi-line(n) ::= |
2223
|
|
|
|
|
|
|
# nb-ns-single-in-line |
2224
|
|
|
|
|
|
|
# ( s-single-next-line(n) | s-white* ) |
2225
|
|
|
|
|
|
|
|
2226
|
|
|
|
|
|
|
rule '125', nb_single_multi_line => sub { |
2227
|
0
|
|
|
0
|
|
0
|
my ($self, $n) = @_; |
2228
|
0
|
|
|
|
|
0
|
debug_rule("nb_single_multi_line",$n) if DEBUG; |
2229
|
0
|
|
|
|
|
0
|
$self->all( |
2230
|
|
|
|
|
|
|
$self->func('nb_ns_single_in_line'), |
2231
|
|
|
|
|
|
|
$self->any( |
2232
|
|
|
|
|
|
|
[ $self->func('s_single_next_line'), $n ], |
2233
|
|
|
|
|
|
|
$self->rep(0, undef, $self->func('s_white')) |
2234
|
|
|
|
|
|
|
) |
2235
|
|
|
|
|
|
|
); |
2236
|
|
|
|
|
|
|
}; |
2237
|
|
|
|
|
|
|
|
2238
|
|
|
|
|
|
|
|
2239
|
|
|
|
|
|
|
|
2240
|
|
|
|
|
|
|
# [126] |
2241
|
|
|
|
|
|
|
# ns-plain-first(c) ::= |
2242
|
|
|
|
|
|
|
# ( ns-char - c-indicator ) |
2243
|
|
|
|
|
|
|
# | ( ( '?' | ':' | '-' ) |
2244
|
|
|
|
|
|
|
# ) |
2245
|
|
|
|
|
|
|
|
2246
|
|
|
|
|
|
|
rule '126', ns_plain_first => sub { |
2247
|
16
|
|
|
16
|
|
42
|
my ($self, $c) = @_; |
2248
|
16
|
|
|
|
|
33
|
debug_rule("ns_plain_first",$c) if DEBUG; |
2249
|
16
|
|
|
|
|
51
|
$self->any( |
2250
|
|
|
|
|
|
|
$self->but( |
2251
|
|
|
|
|
|
|
$self->func('ns_char'), |
2252
|
|
|
|
|
|
|
$self->func('c_indicator') |
2253
|
|
|
|
|
|
|
), |
2254
|
|
|
|
|
|
|
$self->all( |
2255
|
|
|
|
|
|
|
$self->any( |
2256
|
|
|
|
|
|
|
$self->chr('?'), |
2257
|
|
|
|
|
|
|
$self->chr(':'), |
2258
|
|
|
|
|
|
|
$self->chr('-') |
2259
|
|
|
|
|
|
|
), |
2260
|
|
|
|
|
|
|
$self->chk('=', [ $self->func('ns_plain_safe'), $c ]) |
2261
|
|
|
|
|
|
|
) |
2262
|
|
|
|
|
|
|
); |
2263
|
|
|
|
|
|
|
}; |
2264
|
|
|
|
|
|
|
|
2265
|
|
|
|
|
|
|
|
2266
|
|
|
|
|
|
|
|
2267
|
|
|
|
|
|
|
# [127] |
2268
|
|
|
|
|
|
|
# ns-plain-safe(c) ::= |
2269
|
|
|
|
|
|
|
# ( c = flow-out => ns-plain-safe-out ) |
2270
|
|
|
|
|
|
|
# ( c = flow-in => ns-plain-safe-in ) |
2271
|
|
|
|
|
|
|
# ( c = block-key => ns-plain-safe-out ) |
2272
|
|
|
|
|
|
|
# ( c = flow-key => ns-plain-safe-in ) |
2273
|
|
|
|
|
|
|
|
2274
|
|
|
|
|
|
|
rule '127', ns_plain_safe => sub { |
2275
|
24
|
|
|
24
|
|
66
|
my ($self, $c) = @_; |
2276
|
24
|
|
|
|
|
34
|
debug_rule("ns_plain_safe",$c) if DEBUG; |
2277
|
24
|
|
|
|
|
91
|
$self->case( |
2278
|
|
|
|
|
|
|
$c, |
2279
|
|
|
|
|
|
|
{ |
2280
|
|
|
|
|
|
|
'block-key' => $self->func('ns_plain_safe_out'), |
2281
|
|
|
|
|
|
|
'flow-in' => $self->func('ns_plain_safe_in'), |
2282
|
|
|
|
|
|
|
'flow-key' => $self->func('ns_plain_safe_in'), |
2283
|
|
|
|
|
|
|
'flow-out' => $self->func('ns_plain_safe_out'), |
2284
|
|
|
|
|
|
|
} |
2285
|
|
|
|
|
|
|
); |
2286
|
|
|
|
|
|
|
}; |
2287
|
|
|
|
|
|
|
|
2288
|
|
|
|
|
|
|
|
2289
|
|
|
|
|
|
|
|
2290
|
|
|
|
|
|
|
# [128] |
2291
|
|
|
|
|
|
|
# ns-plain-safe-out ::= |
2292
|
|
|
|
|
|
|
# ns-char |
2293
|
|
|
|
|
|
|
|
2294
|
|
|
|
|
|
|
rule '128', ns_plain_safe_out => sub { |
2295
|
16
|
|
|
16
|
|
34
|
my ($self) = @_; |
2296
|
16
|
|
|
|
|
26
|
debug_rule("ns_plain_safe_out") if DEBUG; |
2297
|
16
|
|
|
|
|
35
|
$self->func('ns_char'); |
2298
|
|
|
|
|
|
|
}; |
2299
|
|
|
|
|
|
|
|
2300
|
|
|
|
|
|
|
|
2301
|
|
|
|
|
|
|
|
2302
|
|
|
|
|
|
|
# [129] |
2303
|
|
|
|
|
|
|
# ns-plain-safe-in ::= |
2304
|
|
|
|
|
|
|
# ns-char - c-flow-indicator |
2305
|
|
|
|
|
|
|
|
2306
|
|
|
|
|
|
|
rule '129', ns_plain_safe_in => sub { |
2307
|
8
|
|
|
8
|
|
28
|
my ($self) = @_; |
2308
|
8
|
|
|
|
|
20
|
debug_rule("ns_plain_safe_in") if DEBUG; |
2309
|
8
|
|
|
|
|
31
|
$self->but( |
2310
|
|
|
|
|
|
|
$self->func('ns_char'), |
2311
|
|
|
|
|
|
|
$self->func('c_flow_indicator') |
2312
|
|
|
|
|
|
|
); |
2313
|
|
|
|
|
|
|
}; |
2314
|
|
|
|
|
|
|
|
2315
|
|
|
|
|
|
|
|
2316
|
|
|
|
|
|
|
|
2317
|
|
|
|
|
|
|
# [130] |
2318
|
|
|
|
|
|
|
# ns-plain-char(c) ::= |
2319
|
|
|
|
|
|
|
# ( ns-plain-safe(c) - ':' - '#' ) |
2320
|
|
|
|
|
|
|
# | ( '#' ) |
2321
|
|
|
|
|
|
|
# | ( ':' ) |
2322
|
|
|
|
|
|
|
|
2323
|
|
|
|
|
|
|
rule '130', ns_plain_char => sub { |
2324
|
20
|
|
|
20
|
|
69
|
my ($self, $c) = @_; |
2325
|
20
|
|
|
|
|
33
|
debug_rule("ns_plain_char",$c) if DEBUG; |
2326
|
20
|
|
|
|
|
73
|
$self->any( |
2327
|
|
|
|
|
|
|
$self->but( |
2328
|
|
|
|
|
|
|
[ $self->func('ns_plain_safe'), $c ], |
2329
|
|
|
|
|
|
|
$self->chr(':'), |
2330
|
|
|
|
|
|
|
$self->chr('#') |
2331
|
|
|
|
|
|
|
), |
2332
|
|
|
|
|
|
|
$self->all( |
2333
|
|
|
|
|
|
|
$self->chk('<=', $self->func('ns_char')), |
2334
|
|
|
|
|
|
|
$self->chr('#') |
2335
|
|
|
|
|
|
|
), |
2336
|
|
|
|
|
|
|
$self->all( |
2337
|
|
|
|
|
|
|
$self->chr(':'), |
2338
|
|
|
|
|
|
|
$self->chk('=', [ $self->func('ns_plain_safe'), $c ]) |
2339
|
|
|
|
|
|
|
) |
2340
|
|
|
|
|
|
|
); |
2341
|
|
|
|
|
|
|
}; |
2342
|
|
|
|
|
|
|
|
2343
|
|
|
|
|
|
|
|
2344
|
|
|
|
|
|
|
|
2345
|
|
|
|
|
|
|
# [131] |
2346
|
|
|
|
|
|
|
# ns-plain(n,c) ::= |
2347
|
|
|
|
|
|
|
# ( c = flow-out => ns-plain-multi-line(n,c) ) |
2348
|
|
|
|
|
|
|
# ( c = flow-in => ns-plain-multi-line(n,c) ) |
2349
|
|
|
|
|
|
|
# ( c = block-key => ns-plain-one-line(c) ) |
2350
|
|
|
|
|
|
|
# ( c = flow-key => ns-plain-one-line(c) ) |
2351
|
|
|
|
|
|
|
|
2352
|
|
|
|
|
|
|
rule '131', ns_plain => sub { |
2353
|
16
|
|
|
16
|
|
67
|
my ($self, $n, $c) = @_; |
2354
|
16
|
|
|
|
|
30
|
debug_rule("ns_plain",$n,$c) if DEBUG; |
2355
|
16
|
|
|
|
|
57
|
$self->case( |
2356
|
|
|
|
|
|
|
$c, |
2357
|
|
|
|
|
|
|
{ |
2358
|
|
|
|
|
|
|
'block-key' => [ $self->func('ns_plain_one_line'), $c ], |
2359
|
|
|
|
|
|
|
'flow-in' => [ $self->func('ns_plain_multi_line'), $n, $c ], |
2360
|
|
|
|
|
|
|
'flow-key' => [ $self->func('ns_plain_one_line'), $c ], |
2361
|
|
|
|
|
|
|
'flow-out' => [ $self->func('ns_plain_multi_line'), $n, $c ], |
2362
|
|
|
|
|
|
|
} |
2363
|
|
|
|
|
|
|
); |
2364
|
|
|
|
|
|
|
}; |
2365
|
|
|
|
|
|
|
|
2366
|
|
|
|
|
|
|
|
2367
|
|
|
|
|
|
|
|
2368
|
|
|
|
|
|
|
# [132] |
2369
|
|
|
|
|
|
|
# nb-ns-plain-in-line(c) ::= |
2370
|
|
|
|
|
|
|
# ( s-white* |
2371
|
|
|
|
|
|
|
# ns-plain-char(c) )* |
2372
|
|
|
|
|
|
|
|
2373
|
|
|
|
|
|
|
rule '132', nb_ns_plain_in_line => sub { |
2374
|
12
|
|
|
12
|
|
45
|
my ($self, $c) = @_; |
2375
|
12
|
|
|
|
|
19
|
debug_rule("nb_ns_plain_in_line",$c) if DEBUG; |
2376
|
12
|
|
|
|
|
51
|
$self->rep(0, undef, |
2377
|
|
|
|
|
|
|
$self->all( |
2378
|
|
|
|
|
|
|
$self->rep(0, undef, $self->func('s_white')), |
2379
|
|
|
|
|
|
|
[ $self->func('ns_plain_char'), $c ] |
2380
|
|
|
|
|
|
|
)); |
2381
|
|
|
|
|
|
|
}; |
2382
|
|
|
|
|
|
|
|
2383
|
|
|
|
|
|
|
|
2384
|
|
|
|
|
|
|
|
2385
|
|
|
|
|
|
|
# [133] |
2386
|
|
|
|
|
|
|
# ns-plain-one-line(c) ::= |
2387
|
|
|
|
|
|
|
# ns-plain-first(c) |
2388
|
|
|
|
|
|
|
# nb-ns-plain-in-line(c) |
2389
|
|
|
|
|
|
|
|
2390
|
|
|
|
|
|
|
rule '133', ns_plain_one_line => sub { |
2391
|
16
|
|
|
16
|
|
48
|
my ($self, $c) = @_; |
2392
|
16
|
|
|
|
|
31
|
debug_rule("ns_plain_one_line",$c) if DEBUG; |
2393
|
16
|
|
|
|
|
66
|
$self->all( |
2394
|
|
|
|
|
|
|
[ $self->func('ns_plain_first'), $c ], |
2395
|
|
|
|
|
|
|
[ $self->func('nb_ns_plain_in_line'), $c ] |
2396
|
|
|
|
|
|
|
); |
2397
|
|
|
|
|
|
|
}; |
2398
|
|
|
|
|
|
|
|
2399
|
|
|
|
|
|
|
|
2400
|
|
|
|
|
|
|
|
2401
|
|
|
|
|
|
|
# [134] |
2402
|
|
|
|
|
|
|
# s-ns-plain-next-line(n,c) ::= |
2403
|
|
|
|
|
|
|
# s-flow-folded(n) |
2404
|
|
|
|
|
|
|
# ns-plain-char(c) nb-ns-plain-in-line(c) |
2405
|
|
|
|
|
|
|
|
2406
|
|
|
|
|
|
|
rule '134', s_ns_plain_next_line => sub { |
2407
|
4
|
|
|
4
|
|
17
|
my ($self, $n, $c) = @_; |
2408
|
4
|
|
|
|
|
9
|
debug_rule("s_ns_plain_next_line",$n,$c) if DEBUG; |
2409
|
4
|
|
|
|
|
16
|
$self->all( |
2410
|
|
|
|
|
|
|
[ $self->func('s_flow_folded'), $n ], |
2411
|
|
|
|
|
|
|
[ $self->func('ns_plain_char'), $c ], |
2412
|
|
|
|
|
|
|
[ $self->func('nb_ns_plain_in_line'), $c ] |
2413
|
|
|
|
|
|
|
); |
2414
|
|
|
|
|
|
|
}; |
2415
|
|
|
|
|
|
|
|
2416
|
|
|
|
|
|
|
|
2417
|
|
|
|
|
|
|
|
2418
|
|
|
|
|
|
|
# [135] |
2419
|
|
|
|
|
|
|
# ns-plain-multi-line(n,c) ::= |
2420
|
|
|
|
|
|
|
# ns-plain-one-line(c) |
2421
|
|
|
|
|
|
|
# s-ns-plain-next-line(n,c)* |
2422
|
|
|
|
|
|
|
|
2423
|
|
|
|
|
|
|
rule '135', ns_plain_multi_line => sub { |
2424
|
6
|
|
|
6
|
|
21
|
my ($self, $n, $c) = @_; |
2425
|
6
|
|
|
|
|
25
|
debug_rule("ns_plain_multi_line",$n,$c) if DEBUG; |
2426
|
6
|
|
|
|
|
23
|
$self->all( |
2427
|
|
|
|
|
|
|
[ $self->func('ns_plain_one_line'), $c ], |
2428
|
|
|
|
|
|
|
$self->rep(0, undef, [ $self->func('s_ns_plain_next_line'), $n, $c ]) |
2429
|
|
|
|
|
|
|
); |
2430
|
|
|
|
|
|
|
}; |
2431
|
|
|
|
|
|
|
|
2432
|
|
|
|
|
|
|
|
2433
|
|
|
|
|
|
|
|
2434
|
|
|
|
|
|
|
# [136] |
2435
|
|
|
|
|
|
|
# in-flow(c) ::= |
2436
|
|
|
|
|
|
|
# ( c = flow-out => flow-in ) |
2437
|
|
|
|
|
|
|
# ( c = flow-in => flow-in ) |
2438
|
|
|
|
|
|
|
# ( c = block-key => flow-key ) |
2439
|
|
|
|
|
|
|
# ( c = flow-key => flow-key ) |
2440
|
|
|
|
|
|
|
|
2441
|
|
|
|
|
|
|
rule '136', in_flow => sub { |
2442
|
2
|
|
|
2
|
|
7
|
my ($self, $c) = @_; |
2443
|
2
|
|
|
|
|
5
|
debug_rule("in_flow",$c) if DEBUG; |
2444
|
2
|
|
|
|
|
14
|
$self->flip( |
2445
|
|
|
|
|
|
|
$c, |
2446
|
|
|
|
|
|
|
{ |
2447
|
|
|
|
|
|
|
'block-key' => "flow-key", |
2448
|
|
|
|
|
|
|
'flow-in' => "flow-in", |
2449
|
|
|
|
|
|
|
'flow-key' => "flow-key", |
2450
|
|
|
|
|
|
|
'flow-out' => "flow-in", |
2451
|
|
|
|
|
|
|
} |
2452
|
|
|
|
|
|
|
); |
2453
|
|
|
|
|
|
|
}; |
2454
|
|
|
|
|
|
|
|
2455
|
|
|
|
|
|
|
|
2456
|
|
|
|
|
|
|
|
2457
|
|
|
|
|
|
|
# [137] |
2458
|
|
|
|
|
|
|
# c-flow-sequence(n,c) ::= |
2459
|
|
|
|
|
|
|
# '[' s-separate(n,c)? |
2460
|
|
|
|
|
|
|
# ns-s-flow-seq-entries(n,in-flow(c))? ']' |
2461
|
|
|
|
|
|
|
|
2462
|
|
|
|
|
|
|
rule '137', c_flow_sequence => sub { |
2463
|
12
|
|
|
12
|
|
41
|
my ($self, $n, $c) = @_; |
2464
|
12
|
|
|
|
|
19
|
debug_rule("c_flow_sequence",$n,$c) if DEBUG; |
2465
|
12
|
|
|
|
|
38
|
$self->all( |
2466
|
|
|
|
|
|
|
$self->chr('['), |
2467
|
|
|
|
|
|
|
$self->rep(0, 1, [ $self->func('s_separate'), $n, $c ]), |
2468
|
|
|
|
|
|
|
$self->rep2(0, 1, [ $self->func('ns_s_flow_seq_entries'), $n, [ $self->func('in_flow'), $c ] ]), |
2469
|
|
|
|
|
|
|
$self->chr(']') |
2470
|
|
|
|
|
|
|
); |
2471
|
|
|
|
|
|
|
}; |
2472
|
|
|
|
|
|
|
|
2473
|
|
|
|
|
|
|
|
2474
|
|
|
|
|
|
|
|
2475
|
|
|
|
|
|
|
# [138] |
2476
|
|
|
|
|
|
|
# ns-s-flow-seq-entries(n,c) ::= |
2477
|
|
|
|
|
|
|
# ns-flow-seq-entry(n,c) |
2478
|
|
|
|
|
|
|
# s-separate(n,c)? |
2479
|
|
|
|
|
|
|
# ( ',' s-separate(n,c)? |
2480
|
|
|
|
|
|
|
# ns-s-flow-seq-entries(n,c)? )? |
2481
|
|
|
|
|
|
|
|
2482
|
|
|
|
|
|
|
rule '138', ns_s_flow_seq_entries => sub { |
2483
|
4
|
|
|
4
|
|
13
|
my ($self, $n, $c) = @_; |
2484
|
4
|
|
|
|
|
9
|
debug_rule("ns_s_flow_seq_entries",$n,$c) if DEBUG; |
2485
|
4
|
|
|
|
|
14
|
$self->all( |
2486
|
|
|
|
|
|
|
[ $self->func('ns_flow_seq_entry'), $n, $c ], |
2487
|
|
|
|
|
|
|
$self->rep(0, 1, [ $self->func('s_separate'), $n, $c ]), |
2488
|
|
|
|
|
|
|
$self->rep2(0, 1, |
2489
|
|
|
|
|
|
|
$self->all( |
2490
|
|
|
|
|
|
|
$self->chr(','), |
2491
|
|
|
|
|
|
|
$self->rep(0, 1, [ $self->func('s_separate'), $n, $c ]), |
2492
|
|
|
|
|
|
|
$self->rep2(0, 1, [ $self->func('ns_s_flow_seq_entries'), $n, $c ]) |
2493
|
|
|
|
|
|
|
)) |
2494
|
|
|
|
|
|
|
); |
2495
|
|
|
|
|
|
|
}; |
2496
|
|
|
|
|
|
|
|
2497
|
|
|
|
|
|
|
|
2498
|
|
|
|
|
|
|
|
2499
|
|
|
|
|
|
|
# [139] |
2500
|
|
|
|
|
|
|
# ns-flow-seq-entry(n,c) ::= |
2501
|
|
|
|
|
|
|
# ns-flow-pair(n,c) | ns-flow-node(n,c) |
2502
|
|
|
|
|
|
|
|
2503
|
|
|
|
|
|
|
rule '139', ns_flow_seq_entry => sub { |
2504
|
4
|
|
|
4
|
|
15
|
my ($self, $n, $c) = @_; |
2505
|
4
|
|
|
|
|
8
|
debug_rule("ns_flow_seq_entry",$n,$c) if DEBUG; |
2506
|
4
|
|
|
|
|
13
|
$self->any( |
2507
|
|
|
|
|
|
|
[ $self->func('ns_flow_pair'), $n, $c ], |
2508
|
|
|
|
|
|
|
[ $self->func('ns_flow_node'), $n, $c ] |
2509
|
|
|
|
|
|
|
); |
2510
|
|
|
|
|
|
|
}; |
2511
|
|
|
|
|
|
|
|
2512
|
|
|
|
|
|
|
|
2513
|
|
|
|
|
|
|
|
2514
|
|
|
|
|
|
|
# [140] |
2515
|
|
|
|
|
|
|
# c-flow-mapping(n,c) ::= |
2516
|
|
|
|
|
|
|
# '{' s-separate(n,c)? |
2517
|
|
|
|
|
|
|
# ns-s-flow-map-entries(n,in-flow(c))? '}' |
2518
|
|
|
|
|
|
|
|
2519
|
|
|
|
|
|
|
rule '140', c_flow_mapping => sub { |
2520
|
10
|
|
|
10
|
|
36
|
my ($self, $n, $c) = @_; |
2521
|
10
|
|
|
|
|
18
|
debug_rule("c_flow_mapping",$n,$c) if DEBUG; |
2522
|
10
|
|
|
|
|
32
|
$self->all( |
2523
|
|
|
|
|
|
|
$self->chr('{'), |
2524
|
|
|
|
|
|
|
$self->rep(0, 1, [ $self->func('s_separate'), $n, $c ]), |
2525
|
|
|
|
|
|
|
$self->rep2(0, 1, [ $self->func('ns_s_flow_map_entries'), $n, [ $self->func('in_flow'), $c ] ]), |
2526
|
|
|
|
|
|
|
$self->chr('}') |
2527
|
|
|
|
|
|
|
); |
2528
|
|
|
|
|
|
|
}; |
2529
|
|
|
|
|
|
|
|
2530
|
|
|
|
|
|
|
|
2531
|
|
|
|
|
|
|
|
2532
|
|
|
|
|
|
|
# [141] |
2533
|
|
|
|
|
|
|
# ns-s-flow-map-entries(n,c) ::= |
2534
|
|
|
|
|
|
|
# ns-flow-map-entry(n,c) |
2535
|
|
|
|
|
|
|
# s-separate(n,c)? |
2536
|
|
|
|
|
|
|
# ( ',' s-separate(n,c)? |
2537
|
|
|
|
|
|
|
# ns-s-flow-map-entries(n,c)? )? |
2538
|
|
|
|
|
|
|
|
2539
|
|
|
|
|
|
|
rule '141', ns_s_flow_map_entries => sub { |
2540
|
0
|
|
|
0
|
|
0
|
my ($self, $n, $c) = @_; |
2541
|
0
|
|
|
|
|
0
|
debug_rule("ns_s_flow_map_entries",$n,$c) if DEBUG; |
2542
|
0
|
|
|
|
|
0
|
$self->all( |
2543
|
|
|
|
|
|
|
[ $self->func('ns_flow_map_entry'), $n, $c ], |
2544
|
|
|
|
|
|
|
$self->rep(0, 1, [ $self->func('s_separate'), $n, $c ]), |
2545
|
|
|
|
|
|
|
$self->rep2(0, 1, |
2546
|
|
|
|
|
|
|
$self->all( |
2547
|
|
|
|
|
|
|
$self->chr(','), |
2548
|
|
|
|
|
|
|
$self->rep(0, 1, [ $self->func('s_separate'), $n, $c ]), |
2549
|
|
|
|
|
|
|
$self->rep2(0, 1, [ $self->func('ns_s_flow_map_entries'), $n, $c ]) |
2550
|
|
|
|
|
|
|
)) |
2551
|
|
|
|
|
|
|
); |
2552
|
|
|
|
|
|
|
}; |
2553
|
|
|
|
|
|
|
|
2554
|
|
|
|
|
|
|
|
2555
|
|
|
|
|
|
|
|
2556
|
|
|
|
|
|
|
# [142] |
2557
|
|
|
|
|
|
|
# ns-flow-map-entry(n,c) ::= |
2558
|
|
|
|
|
|
|
# ( '?' s-separate(n,c) |
2559
|
|
|
|
|
|
|
# ns-flow-map-explicit-entry(n,c) ) |
2560
|
|
|
|
|
|
|
# | ns-flow-map-implicit-entry(n,c) |
2561
|
|
|
|
|
|
|
|
2562
|
|
|
|
|
|
|
rule '142', ns_flow_map_entry => sub { |
2563
|
0
|
|
|
0
|
|
0
|
my ($self, $n, $c) = @_; |
2564
|
0
|
|
|
|
|
0
|
debug_rule("ns_flow_map_entry",$n,$c) if DEBUG; |
2565
|
0
|
|
|
|
|
0
|
$self->any( |
2566
|
|
|
|
|
|
|
$self->all( |
2567
|
|
|
|
|
|
|
$self->chr('?'), |
2568
|
|
|
|
|
|
|
$self->chk( |
2569
|
|
|
|
|
|
|
'=', |
2570
|
|
|
|
|
|
|
$self->any( |
2571
|
|
|
|
|
|
|
$self->func('end_of_stream'), |
2572
|
|
|
|
|
|
|
$self->func('s_white'), |
2573
|
|
|
|
|
|
|
$self->func('b_break') |
2574
|
|
|
|
|
|
|
) |
2575
|
|
|
|
|
|
|
), |
2576
|
|
|
|
|
|
|
[ $self->func('s_separate'), $n, $c ], |
2577
|
|
|
|
|
|
|
[ $self->func('ns_flow_map_explicit_entry'), $n, $c ] |
2578
|
|
|
|
|
|
|
), |
2579
|
|
|
|
|
|
|
[ $self->func('ns_flow_map_implicit_entry'), $n, $c ] |
2580
|
|
|
|
|
|
|
); |
2581
|
|
|
|
|
|
|
}; |
2582
|
|
|
|
|
|
|
|
2583
|
|
|
|
|
|
|
|
2584
|
|
|
|
|
|
|
|
2585
|
|
|
|
|
|
|
# [143] |
2586
|
|
|
|
|
|
|
# ns-flow-map-explicit-entry(n,c) ::= |
2587
|
|
|
|
|
|
|
# ns-flow-map-implicit-entry(n,c) |
2588
|
|
|
|
|
|
|
# | ( e-node |
2589
|
|
|
|
|
|
|
# e-node ) |
2590
|
|
|
|
|
|
|
|
2591
|
|
|
|
|
|
|
rule '143', ns_flow_map_explicit_entry => sub { |
2592
|
0
|
|
|
0
|
|
0
|
my ($self, $n, $c) = @_; |
2593
|
0
|
|
|
|
|
0
|
debug_rule("ns_flow_map_explicit_entry",$n,$c) if DEBUG; |
2594
|
0
|
|
|
|
|
0
|
$self->any( |
2595
|
|
|
|
|
|
|
[ $self->func('ns_flow_map_implicit_entry'), $n, $c ], |
2596
|
|
|
|
|
|
|
$self->all( |
2597
|
|
|
|
|
|
|
$self->func('e_node'), |
2598
|
|
|
|
|
|
|
$self->func('e_node') |
2599
|
|
|
|
|
|
|
) |
2600
|
|
|
|
|
|
|
); |
2601
|
|
|
|
|
|
|
}; |
2602
|
|
|
|
|
|
|
|
2603
|
|
|
|
|
|
|
|
2604
|
|
|
|
|
|
|
|
2605
|
|
|
|
|
|
|
# [144] |
2606
|
|
|
|
|
|
|
# ns-flow-map-implicit-entry(n,c) ::= |
2607
|
|
|
|
|
|
|
# ns-flow-map-yaml-key-entry(n,c) |
2608
|
|
|
|
|
|
|
# | c-ns-flow-map-empty-key-entry(n,c) |
2609
|
|
|
|
|
|
|
# | c-ns-flow-map-json-key-entry(n,c) |
2610
|
|
|
|
|
|
|
|
2611
|
|
|
|
|
|
|
rule '144', ns_flow_map_implicit_entry => sub { |
2612
|
0
|
|
|
0
|
|
0
|
my ($self, $n, $c) = @_; |
2613
|
0
|
|
|
|
|
0
|
debug_rule("ns_flow_map_implicit_entry",$n,$c) if DEBUG; |
2614
|
0
|
|
|
|
|
0
|
$self->any( |
2615
|
|
|
|
|
|
|
[ $self->func('ns_flow_map_yaml_key_entry'), $n, $c ], |
2616
|
|
|
|
|
|
|
[ $self->func('c_ns_flow_map_empty_key_entry'), $n, $c ], |
2617
|
|
|
|
|
|
|
[ $self->func('c_ns_flow_map_json_key_entry'), $n, $c ] |
2618
|
|
|
|
|
|
|
); |
2619
|
|
|
|
|
|
|
}; |
2620
|
|
|
|
|
|
|
|
2621
|
|
|
|
|
|
|
|
2622
|
|
|
|
|
|
|
|
2623
|
|
|
|
|
|
|
# [145] |
2624
|
|
|
|
|
|
|
# ns-flow-map-yaml-key-entry(n,c) ::= |
2625
|
|
|
|
|
|
|
# ns-flow-yaml-node(n,c) |
2626
|
|
|
|
|
|
|
# ( ( s-separate(n,c)? |
2627
|
|
|
|
|
|
|
# c-ns-flow-map-separate-value(n,c) ) |
2628
|
|
|
|
|
|
|
# | e-node ) |
2629
|
|
|
|
|
|
|
|
2630
|
|
|
|
|
|
|
rule '145', ns_flow_map_yaml_key_entry => sub { |
2631
|
0
|
|
|
0
|
|
0
|
my ($self, $n, $c) = @_; |
2632
|
0
|
|
|
|
|
0
|
debug_rule("ns_flow_map_yaml_key_entry",$n,$c) if DEBUG; |
2633
|
0
|
|
|
|
|
0
|
$self->all( |
2634
|
|
|
|
|
|
|
[ $self->func('ns_flow_yaml_node'), $n, $c ], |
2635
|
|
|
|
|
|
|
$self->any( |
2636
|
|
|
|
|
|
|
$self->all( |
2637
|
|
|
|
|
|
|
$self->rep(0, 1, [ $self->func('s_separate'), $n, $c ]), |
2638
|
|
|
|
|
|
|
[ $self->func('c_ns_flow_map_separate_value'), $n, $c ] |
2639
|
|
|
|
|
|
|
), |
2640
|
|
|
|
|
|
|
$self->func('e_node') |
2641
|
|
|
|
|
|
|
) |
2642
|
|
|
|
|
|
|
); |
2643
|
|
|
|
|
|
|
}; |
2644
|
|
|
|
|
|
|
|
2645
|
|
|
|
|
|
|
|
2646
|
|
|
|
|
|
|
|
2647
|
|
|
|
|
|
|
# [146] |
2648
|
|
|
|
|
|
|
# c-ns-flow-map-empty-key-entry(n,c) ::= |
2649
|
|
|
|
|
|
|
# e-node |
2650
|
|
|
|
|
|
|
# c-ns-flow-map-separate-value(n,c) |
2651
|
|
|
|
|
|
|
|
2652
|
|
|
|
|
|
|
rule '146', c_ns_flow_map_empty_key_entry => sub { |
2653
|
4
|
|
|
4
|
|
14
|
my ($self, $n, $c) = @_; |
2654
|
4
|
|
|
|
|
7
|
debug_rule("c_ns_flow_map_empty_key_entry",$n,$c) if DEBUG; |
2655
|
4
|
|
|
|
|
17
|
$self->all( |
2656
|
|
|
|
|
|
|
$self->func('e_node'), |
2657
|
|
|
|
|
|
|
[ $self->func('c_ns_flow_map_separate_value'), $n, $c ] |
2658
|
|
|
|
|
|
|
); |
2659
|
|
|
|
|
|
|
}; |
2660
|
|
|
|
|
|
|
|
2661
|
|
|
|
|
|
|
|
2662
|
|
|
|
|
|
|
|
2663
|
|
|
|
|
|
|
# [147] |
2664
|
|
|
|
|
|
|
# c-ns-flow-map-separate-value(n,c) ::= |
2665
|
|
|
|
|
|
|
# ':' |
2666
|
|
|
|
|
|
|
# ( ( s-separate(n,c) ns-flow-node(n,c) ) |
2667
|
|
|
|
|
|
|
# | e-node ) |
2668
|
|
|
|
|
|
|
|
2669
|
|
|
|
|
|
|
rule '147', c_ns_flow_map_separate_value => sub { |
2670
|
8
|
|
|
8
|
|
25
|
my ($self, $n, $c) = @_; |
2671
|
8
|
|
|
|
|
129
|
debug_rule("c_ns_flow_map_separate_value",$n,$c) if DEBUG; |
2672
|
8
|
|
|
|
|
26
|
$self->all( |
2673
|
|
|
|
|
|
|
$self->chr(':'), |
2674
|
|
|
|
|
|
|
$self->chk('!', [ $self->func('ns_plain_safe'), $c ]), |
2675
|
|
|
|
|
|
|
$self->any( |
2676
|
|
|
|
|
|
|
$self->all( |
2677
|
|
|
|
|
|
|
[ $self->func('s_separate'), $n, $c ], |
2678
|
|
|
|
|
|
|
[ $self->func('ns_flow_node'), $n, $c ] |
2679
|
|
|
|
|
|
|
), |
2680
|
|
|
|
|
|
|
$self->func('e_node') |
2681
|
|
|
|
|
|
|
) |
2682
|
|
|
|
|
|
|
); |
2683
|
|
|
|
|
|
|
}; |
2684
|
|
|
|
|
|
|
|
2685
|
|
|
|
|
|
|
|
2686
|
|
|
|
|
|
|
|
2687
|
|
|
|
|
|
|
# [148] |
2688
|
|
|
|
|
|
|
# c-ns-flow-map-json-key-entry(n,c) ::= |
2689
|
|
|
|
|
|
|
# c-flow-json-node(n,c) |
2690
|
|
|
|
|
|
|
# ( ( s-separate(n,c)? |
2691
|
|
|
|
|
|
|
# c-ns-flow-map-adjacent-value(n,c) ) |
2692
|
|
|
|
|
|
|
# | e-node ) |
2693
|
|
|
|
|
|
|
|
2694
|
|
|
|
|
|
|
rule '148', c_ns_flow_map_json_key_entry => sub { |
2695
|
0
|
|
|
0
|
|
0
|
my ($self, $n, $c) = @_; |
2696
|
0
|
|
|
|
|
0
|
debug_rule("c_ns_flow_map_json_key_entry",$n,$c) if DEBUG; |
2697
|
0
|
|
|
|
|
0
|
$self->all( |
2698
|
|
|
|
|
|
|
[ $self->func('c_flow_json_node'), $n, $c ], |
2699
|
|
|
|
|
|
|
$self->any( |
2700
|
|
|
|
|
|
|
$self->all( |
2701
|
|
|
|
|
|
|
$self->rep(0, 1, [ $self->func('s_separate'), $n, $c ]), |
2702
|
|
|
|
|
|
|
[ $self->func('c_ns_flow_map_adjacent_value'), $n, $c ] |
2703
|
|
|
|
|
|
|
), |
2704
|
|
|
|
|
|
|
$self->func('e_node') |
2705
|
|
|
|
|
|
|
) |
2706
|
|
|
|
|
|
|
); |
2707
|
|
|
|
|
|
|
}; |
2708
|
|
|
|
|
|
|
|
2709
|
|
|
|
|
|
|
|
2710
|
|
|
|
|
|
|
|
2711
|
|
|
|
|
|
|
# [149] |
2712
|
|
|
|
|
|
|
# c-ns-flow-map-adjacent-value(n,c) ::= |
2713
|
|
|
|
|
|
|
# ':' ( ( |
2714
|
|
|
|
|
|
|
# s-separate(n,c)? |
2715
|
|
|
|
|
|
|
# ns-flow-node(n,c) ) |
2716
|
|
|
|
|
|
|
# | e-node ) |
2717
|
|
|
|
|
|
|
|
2718
|
|
|
|
|
|
|
rule '149', c_ns_flow_map_adjacent_value => sub { |
2719
|
0
|
|
|
0
|
|
0
|
my ($self, $n, $c) = @_; |
2720
|
0
|
|
|
|
|
0
|
debug_rule("c_ns_flow_map_adjacent_value",$n,$c) if DEBUG; |
2721
|
0
|
|
|
|
|
0
|
$self->all( |
2722
|
|
|
|
|
|
|
$self->chr(':'), |
2723
|
|
|
|
|
|
|
$self->any( |
2724
|
|
|
|
|
|
|
$self->all( |
2725
|
|
|
|
|
|
|
$self->rep(0, 1, [ $self->func('s_separate'), $n, $c ]), |
2726
|
|
|
|
|
|
|
[ $self->func('ns_flow_node'), $n, $c ] |
2727
|
|
|
|
|
|
|
), |
2728
|
|
|
|
|
|
|
$self->func('e_node') |
2729
|
|
|
|
|
|
|
) |
2730
|
|
|
|
|
|
|
); |
2731
|
|
|
|
|
|
|
}; |
2732
|
|
|
|
|
|
|
|
2733
|
|
|
|
|
|
|
|
2734
|
|
|
|
|
|
|
|
2735
|
|
|
|
|
|
|
# [150] |
2736
|
|
|
|
|
|
|
# ns-flow-pair(n,c) ::= |
2737
|
|
|
|
|
|
|
# ( '?' s-separate(n,c) |
2738
|
|
|
|
|
|
|
# ns-flow-map-explicit-entry(n,c) ) |
2739
|
|
|
|
|
|
|
# | ns-flow-pair-entry(n,c) |
2740
|
|
|
|
|
|
|
|
2741
|
|
|
|
|
|
|
rule '150', ns_flow_pair => sub { |
2742
|
4
|
|
|
4
|
|
14
|
my ($self, $n, $c) = @_; |
2743
|
4
|
|
|
|
|
9
|
debug_rule("ns_flow_pair",$n,$c) if DEBUG; |
2744
|
4
|
|
|
|
|
21
|
$self->any( |
2745
|
|
|
|
|
|
|
$self->all( |
2746
|
|
|
|
|
|
|
$self->chr('?'), |
2747
|
|
|
|
|
|
|
$self->chk( |
2748
|
|
|
|
|
|
|
'=', |
2749
|
|
|
|
|
|
|
$self->any( |
2750
|
|
|
|
|
|
|
$self->func('end_of_stream'), |
2751
|
|
|
|
|
|
|
$self->func('s_white'), |
2752
|
|
|
|
|
|
|
$self->func('b_break') |
2753
|
|
|
|
|
|
|
) |
2754
|
|
|
|
|
|
|
), |
2755
|
|
|
|
|
|
|
[ $self->func('s_separate'), $n, $c ], |
2756
|
|
|
|
|
|
|
[ $self->func('ns_flow_map_explicit_entry'), $n, $c ] |
2757
|
|
|
|
|
|
|
), |
2758
|
|
|
|
|
|
|
[ $self->func('ns_flow_pair_entry'), $n, $c ] |
2759
|
|
|
|
|
|
|
); |
2760
|
|
|
|
|
|
|
}; |
2761
|
|
|
|
|
|
|
|
2762
|
|
|
|
|
|
|
|
2763
|
|
|
|
|
|
|
|
2764
|
|
|
|
|
|
|
# [151] |
2765
|
|
|
|
|
|
|
# ns-flow-pair-entry(n,c) ::= |
2766
|
|
|
|
|
|
|
# ns-flow-pair-yaml-key-entry(n,c) |
2767
|
|
|
|
|
|
|
# | c-ns-flow-map-empty-key-entry(n,c) |
2768
|
|
|
|
|
|
|
# | c-ns-flow-pair-json-key-entry(n,c) |
2769
|
|
|
|
|
|
|
|
2770
|
|
|
|
|
|
|
rule '151', ns_flow_pair_entry => sub { |
2771
|
4
|
|
|
4
|
|
15
|
my ($self, $n, $c) = @_; |
2772
|
4
|
|
|
|
|
6
|
debug_rule("ns_flow_pair_entry",$n,$c) if DEBUG; |
2773
|
4
|
|
|
|
|
17
|
$self->any( |
2774
|
|
|
|
|
|
|
[ $self->func('ns_flow_pair_yaml_key_entry'), $n, $c ], |
2775
|
|
|
|
|
|
|
[ $self->func('c_ns_flow_map_empty_key_entry'), $n, $c ], |
2776
|
|
|
|
|
|
|
[ $self->func('c_ns_flow_pair_json_key_entry'), $n, $c ] |
2777
|
|
|
|
|
|
|
); |
2778
|
|
|
|
|
|
|
}; |
2779
|
|
|
|
|
|
|
|
2780
|
|
|
|
|
|
|
|
2781
|
|
|
|
|
|
|
|
2782
|
|
|
|
|
|
|
# [152] |
2783
|
|
|
|
|
|
|
# ns-flow-pair-yaml-key-entry(n,c) ::= |
2784
|
|
|
|
|
|
|
# ns-s-implicit-yaml-key(flow-key) |
2785
|
|
|
|
|
|
|
# c-ns-flow-map-separate-value(n,c) |
2786
|
|
|
|
|
|
|
|
2787
|
|
|
|
|
|
|
rule '152', ns_flow_pair_yaml_key_entry => sub { |
2788
|
4
|
|
|
4
|
|
17
|
my ($self, $n, $c) = @_; |
2789
|
4
|
|
|
|
|
7
|
debug_rule("ns_flow_pair_yaml_key_entry",$n,$c) if DEBUG; |
2790
|
4
|
|
|
|
|
14
|
$self->all( |
2791
|
|
|
|
|
|
|
[ $self->func('ns_s_implicit_yaml_key'), "flow-key" ], |
2792
|
|
|
|
|
|
|
[ $self->func('c_ns_flow_map_separate_value'), $n, $c ] |
2793
|
|
|
|
|
|
|
); |
2794
|
|
|
|
|
|
|
}; |
2795
|
|
|
|
|
|
|
|
2796
|
|
|
|
|
|
|
|
2797
|
|
|
|
|
|
|
|
2798
|
|
|
|
|
|
|
# [153] |
2799
|
|
|
|
|
|
|
# c-ns-flow-pair-json-key-entry(n,c) ::= |
2800
|
|
|
|
|
|
|
# c-s-implicit-json-key(flow-key) |
2801
|
|
|
|
|
|
|
# c-ns-flow-map-adjacent-value(n,c) |
2802
|
|
|
|
|
|
|
|
2803
|
|
|
|
|
|
|
rule '153', c_ns_flow_pair_json_key_entry => sub { |
2804
|
4
|
|
|
4
|
|
16
|
my ($self, $n, $c) = @_; |
2805
|
4
|
|
|
|
|
10
|
debug_rule("c_ns_flow_pair_json_key_entry",$n,$c) if DEBUG; |
2806
|
4
|
|
|
|
|
16
|
$self->all( |
2807
|
|
|
|
|
|
|
[ $self->func('c_s_implicit_json_key'), "flow-key" ], |
2808
|
|
|
|
|
|
|
[ $self->func('c_ns_flow_map_adjacent_value'), $n, $c ] |
2809
|
|
|
|
|
|
|
); |
2810
|
|
|
|
|
|
|
}; |
2811
|
|
|
|
|
|
|
|
2812
|
|
|
|
|
|
|
|
2813
|
|
|
|
|
|
|
|
2814
|
|
|
|
|
|
|
# [154] |
2815
|
|
|
|
|
|
|
# ns-s-implicit-yaml-key(c) ::= |
2816
|
|
|
|
|
|
|
# ns-flow-yaml-node(n/a,c) |
2817
|
|
|
|
|
|
|
# s-separate-in-line? |
2818
|
|
|
|
|
|
|
# |
2819
|
|
|
|
|
|
|
|
2820
|
|
|
|
|
|
|
rule '154', ns_s_implicit_yaml_key => sub { |
2821
|
10
|
|
|
10
|
|
34
|
my ($self, $c) = @_; |
2822
|
10
|
|
|
|
|
14
|
debug_rule("ns_s_implicit_yaml_key",$c) if DEBUG; |
2823
|
10
|
|
|
|
|
46
|
$self->all( |
2824
|
|
|
|
|
|
|
$self->max(1024), |
2825
|
|
|
|
|
|
|
[ $self->func('ns_flow_yaml_node'), undef, $c ], |
2826
|
|
|
|
|
|
|
$self->rep(0, 1, $self->func('s_separate_in_line')) |
2827
|
|
|
|
|
|
|
); |
2828
|
|
|
|
|
|
|
}; |
2829
|
|
|
|
|
|
|
|
2830
|
|
|
|
|
|
|
|
2831
|
|
|
|
|
|
|
|
2832
|
|
|
|
|
|
|
# [155] |
2833
|
|
|
|
|
|
|
# c-s-implicit-json-key(c) ::= |
2834
|
|
|
|
|
|
|
# c-flow-json-node(n/a,c) |
2835
|
|
|
|
|
|
|
# s-separate-in-line? |
2836
|
|
|
|
|
|
|
# |
2837
|
|
|
|
|
|
|
|
2838
|
|
|
|
|
|
|
rule '155', c_s_implicit_json_key => sub { |
2839
|
10
|
|
|
10
|
|
30
|
my ($self, $c) = @_; |
2840
|
10
|
|
|
|
|
15
|
debug_rule("c_s_implicit_json_key",$c) if DEBUG; |
2841
|
10
|
|
|
|
|
52
|
$self->all( |
2842
|
|
|
|
|
|
|
$self->max(1024), |
2843
|
|
|
|
|
|
|
[ $self->func('c_flow_json_node'), undef, $c ], |
2844
|
|
|
|
|
|
|
$self->rep(0, 1, $self->func('s_separate_in_line')) |
2845
|
|
|
|
|
|
|
); |
2846
|
|
|
|
|
|
|
}; |
2847
|
|
|
|
|
|
|
|
2848
|
|
|
|
|
|
|
|
2849
|
|
|
|
|
|
|
|
2850
|
|
|
|
|
|
|
# [156] |
2851
|
|
|
|
|
|
|
# ns-flow-yaml-content(n,c) ::= |
2852
|
|
|
|
|
|
|
# ns-plain(n,c) |
2853
|
|
|
|
|
|
|
|
2854
|
|
|
|
|
|
|
rule '156', ns_flow_yaml_content => sub { |
2855
|
16
|
|
|
16
|
|
56
|
my ($self, $n, $c) = @_; |
2856
|
16
|
|
|
|
|
26
|
debug_rule("ns_flow_yaml_content",$n,$c) if DEBUG; |
2857
|
16
|
|
|
|
|
67
|
[ $self->func('ns_plain'), $n, $c ]; |
2858
|
|
|
|
|
|
|
}; |
2859
|
|
|
|
|
|
|
|
2860
|
|
|
|
|
|
|
|
2861
|
|
|
|
|
|
|
|
2862
|
|
|
|
|
|
|
# [157] |
2863
|
|
|
|
|
|
|
# c-flow-json-content(n,c) ::= |
2864
|
|
|
|
|
|
|
# c-flow-sequence(n,c) | c-flow-mapping(n,c) |
2865
|
|
|
|
|
|
|
# | c-single-quoted(n,c) | c-double-quoted(n,c) |
2866
|
|
|
|
|
|
|
|
2867
|
|
|
|
|
|
|
rule '157', c_flow_json_content => sub { |
2868
|
12
|
|
|
12
|
|
49
|
my ($self, $n, $c) = @_; |
2869
|
12
|
|
|
|
|
18
|
debug_rule("c_flow_json_content",$n,$c) if DEBUG; |
2870
|
12
|
|
|
|
|
42
|
$self->any( |
2871
|
|
|
|
|
|
|
[ $self->func('c_flow_sequence'), $n, $c ], |
2872
|
|
|
|
|
|
|
[ $self->func('c_flow_mapping'), $n, $c ], |
2873
|
|
|
|
|
|
|
[ $self->func('c_single_quoted'), $n, $c ], |
2874
|
|
|
|
|
|
|
[ $self->func('c_double_quoted'), $n, $c ] |
2875
|
|
|
|
|
|
|
); |
2876
|
|
|
|
|
|
|
}; |
2877
|
|
|
|
|
|
|
|
2878
|
|
|
|
|
|
|
|
2879
|
|
|
|
|
|
|
|
2880
|
|
|
|
|
|
|
# [158] |
2881
|
|
|
|
|
|
|
# ns-flow-content(n,c) ::= |
2882
|
|
|
|
|
|
|
# ns-flow-yaml-content(n,c) | c-flow-json-content(n,c) |
2883
|
|
|
|
|
|
|
|
2884
|
|
|
|
|
|
|
rule '158', ns_flow_content => sub { |
2885
|
6
|
|
|
6
|
|
25
|
my ($self, $n, $c) = @_; |
2886
|
6
|
|
|
|
|
12
|
debug_rule("ns_flow_content",$n,$c) if DEBUG; |
2887
|
6
|
|
|
|
|
26
|
$self->any( |
2888
|
|
|
|
|
|
|
[ $self->func('ns_flow_yaml_content'), $n, $c ], |
2889
|
|
|
|
|
|
|
[ $self->func('c_flow_json_content'), $n, $c ] |
2890
|
|
|
|
|
|
|
); |
2891
|
|
|
|
|
|
|
}; |
2892
|
|
|
|
|
|
|
|
2893
|
|
|
|
|
|
|
|
2894
|
|
|
|
|
|
|
|
2895
|
|
|
|
|
|
|
# [159] |
2896
|
|
|
|
|
|
|
# ns-flow-yaml-node(n,c) ::= |
2897
|
|
|
|
|
|
|
# c-ns-alias-node |
2898
|
|
|
|
|
|
|
# | ns-flow-yaml-content(n,c) |
2899
|
|
|
|
|
|
|
# | ( c-ns-properties(n,c) |
2900
|
|
|
|
|
|
|
# ( ( s-separate(n,c) |
2901
|
|
|
|
|
|
|
# ns-flow-yaml-content(n,c) ) |
2902
|
|
|
|
|
|
|
# | e-scalar ) ) |
2903
|
|
|
|
|
|
|
|
2904
|
|
|
|
|
|
|
rule '159', ns_flow_yaml_node => sub { |
2905
|
10
|
|
|
10
|
|
41
|
my ($self, $n, $c) = @_; |
2906
|
10
|
|
|
|
|
21
|
debug_rule("ns_flow_yaml_node",$n,$c) if DEBUG; |
2907
|
10
|
|
|
|
|
35
|
$self->any( |
2908
|
|
|
|
|
|
|
$self->func('c_ns_alias_node'), |
2909
|
|
|
|
|
|
|
[ $self->func('ns_flow_yaml_content'), $n, $c ], |
2910
|
|
|
|
|
|
|
$self->all( |
2911
|
|
|
|
|
|
|
[ $self->func('c_ns_properties'), $n, $c ], |
2912
|
|
|
|
|
|
|
$self->any( |
2913
|
|
|
|
|
|
|
$self->all( |
2914
|
|
|
|
|
|
|
[ $self->func('s_separate'), $n, $c ], |
2915
|
|
|
|
|
|
|
[ $self->func('ns_flow_content'), $n, $c ] |
2916
|
|
|
|
|
|
|
), |
2917
|
|
|
|
|
|
|
$self->func('e_scalar') |
2918
|
|
|
|
|
|
|
) |
2919
|
|
|
|
|
|
|
) |
2920
|
|
|
|
|
|
|
); |
2921
|
|
|
|
|
|
|
}; |
2922
|
|
|
|
|
|
|
|
2923
|
|
|
|
|
|
|
|
2924
|
|
|
|
|
|
|
|
2925
|
|
|
|
|
|
|
# [160] |
2926
|
|
|
|
|
|
|
# c-flow-json-node(n,c) ::= |
2927
|
|
|
|
|
|
|
# ( c-ns-properties(n,c) |
2928
|
|
|
|
|
|
|
# s-separate(n,c) )? |
2929
|
|
|
|
|
|
|
# c-flow-json-content(n,c) |
2930
|
|
|
|
|
|
|
|
2931
|
|
|
|
|
|
|
rule '160', c_flow_json_node => sub { |
2932
|
10
|
|
|
10
|
|
32
|
my ($self, $n, $c) = @_; |
2933
|
10
|
|
|
|
|
17
|
debug_rule("c_flow_json_node",$n,$c) if DEBUG; |
2934
|
10
|
|
|
|
|
40
|
$self->all( |
2935
|
|
|
|
|
|
|
$self->rep(0, 1, |
2936
|
|
|
|
|
|
|
$self->all( |
2937
|
|
|
|
|
|
|
[ $self->func('c_ns_properties'), $n, $c ], |
2938
|
|
|
|
|
|
|
[ $self->func('s_separate'), $n, $c ] |
2939
|
|
|
|
|
|
|
)), |
2940
|
|
|
|
|
|
|
[ $self->func('c_flow_json_content'), $n, $c ] |
2941
|
|
|
|
|
|
|
); |
2942
|
|
|
|
|
|
|
}; |
2943
|
|
|
|
|
|
|
|
2944
|
|
|
|
|
|
|
|
2945
|
|
|
|
|
|
|
|
2946
|
|
|
|
|
|
|
# [161] |
2947
|
|
|
|
|
|
|
# ns-flow-node(n,c) ::= |
2948
|
|
|
|
|
|
|
# c-ns-alias-node |
2949
|
|
|
|
|
|
|
# | ns-flow-content(n,c) |
2950
|
|
|
|
|
|
|
# | ( c-ns-properties(n,c) |
2951
|
|
|
|
|
|
|
# ( ( s-separate(n,c) |
2952
|
|
|
|
|
|
|
# ns-flow-content(n,c) ) |
2953
|
|
|
|
|
|
|
# | e-scalar ) ) |
2954
|
|
|
|
|
|
|
|
2955
|
|
|
|
|
|
|
rule '161', ns_flow_node => sub { |
2956
|
6
|
|
|
6
|
|
20
|
my ($self, $n, $c) = @_; |
2957
|
6
|
|
|
|
|
126
|
debug_rule("ns_flow_node",$n,$c) if DEBUG; |
2958
|
6
|
|
|
|
|
29
|
$self->any( |
2959
|
|
|
|
|
|
|
$self->func('c_ns_alias_node'), |
2960
|
|
|
|
|
|
|
[ $self->func('ns_flow_content'), $n, $c ], |
2961
|
|
|
|
|
|
|
$self->all( |
2962
|
|
|
|
|
|
|
[ $self->func('c_ns_properties'), $n, $c ], |
2963
|
|
|
|
|
|
|
$self->any( |
2964
|
|
|
|
|
|
|
$self->all( |
2965
|
|
|
|
|
|
|
[ $self->func('s_separate'), $n, $c ], |
2966
|
|
|
|
|
|
|
[ $self->func('ns_flow_content'), $n, $c ] |
2967
|
|
|
|
|
|
|
), |
2968
|
|
|
|
|
|
|
$self->func('e_scalar') |
2969
|
|
|
|
|
|
|
) |
2970
|
|
|
|
|
|
|
) |
2971
|
|
|
|
|
|
|
); |
2972
|
|
|
|
|
|
|
}; |
2973
|
|
|
|
|
|
|
|
2974
|
|
|
|
|
|
|
|
2975
|
|
|
|
|
|
|
|
2976
|
|
|
|
|
|
|
# [162] |
2977
|
|
|
|
|
|
|
# c-b-block-header(m,t) ::= |
2978
|
|
|
|
|
|
|
# ( ( c-indentation-indicator(m) |
2979
|
|
|
|
|
|
|
# c-chomping-indicator(t) ) |
2980
|
|
|
|
|
|
|
# | ( c-chomping-indicator(t) |
2981
|
|
|
|
|
|
|
# c-indentation-indicator(m) ) ) |
2982
|
|
|
|
|
|
|
# s-b-comment |
2983
|
|
|
|
|
|
|
|
2984
|
|
|
|
|
|
|
rule '162', c_b_block_header => sub { |
2985
|
2
|
|
|
2
|
|
6
|
my ($self, $n) = @_; |
2986
|
2
|
|
|
|
|
5
|
debug_rule("c_b_block_header",$n) if DEBUG; |
2987
|
2
|
|
|
|
|
8
|
$self->all( |
2988
|
|
|
|
|
|
|
$self->any( |
2989
|
|
|
|
|
|
|
$self->all( |
2990
|
|
|
|
|
|
|
[ $self->func('c_indentation_indicator'), $n ], |
2991
|
|
|
|
|
|
|
$self->func('c_chomping_indicator'), |
2992
|
|
|
|
|
|
|
$self->chk( |
2993
|
|
|
|
|
|
|
'=', |
2994
|
|
|
|
|
|
|
$self->any( |
2995
|
|
|
|
|
|
|
$self->func('end_of_stream'), |
2996
|
|
|
|
|
|
|
$self->func('s_white'), |
2997
|
|
|
|
|
|
|
$self->func('b_break') |
2998
|
|
|
|
|
|
|
) |
2999
|
|
|
|
|
|
|
) |
3000
|
|
|
|
|
|
|
), |
3001
|
|
|
|
|
|
|
$self->all( |
3002
|
|
|
|
|
|
|
$self->func('c_chomping_indicator'), |
3003
|
|
|
|
|
|
|
[ $self->func('c_indentation_indicator'), $n ], |
3004
|
|
|
|
|
|
|
$self->chk( |
3005
|
|
|
|
|
|
|
'=', |
3006
|
|
|
|
|
|
|
$self->any( |
3007
|
|
|
|
|
|
|
$self->func('end_of_stream'), |
3008
|
|
|
|
|
|
|
$self->func('s_white'), |
3009
|
|
|
|
|
|
|
$self->func('b_break') |
3010
|
|
|
|
|
|
|
) |
3011
|
|
|
|
|
|
|
) |
3012
|
|
|
|
|
|
|
) |
3013
|
|
|
|
|
|
|
), |
3014
|
|
|
|
|
|
|
$self->func('s_b_comment') |
3015
|
|
|
|
|
|
|
); |
3016
|
|
|
|
|
|
|
}; |
3017
|
|
|
|
|
|
|
|
3018
|
|
|
|
|
|
|
|
3019
|
|
|
|
|
|
|
|
3020
|
|
|
|
|
|
|
# [163] |
3021
|
|
|
|
|
|
|
# c-indentation-indicator(m) ::= |
3022
|
|
|
|
|
|
|
# ( ns-dec-digit => m = ns-dec-digit - x:30 ) |
3023
|
|
|
|
|
|
|
# ( => m = auto-detect() ) |
3024
|
|
|
|
|
|
|
|
3025
|
|
|
|
|
|
|
rule '163', c_indentation_indicator => sub { |
3026
|
2
|
|
|
2
|
|
8
|
my ($self, $n) = @_; |
3027
|
2
|
|
|
|
|
4
|
debug_rule("c_indentation_indicator",$n) if DEBUG; |
3028
|
2
|
|
|
|
|
9
|
$self->any( |
3029
|
|
|
|
|
|
|
$self->if($self->func('ns_dec_digit'), $self->set('m', $self->ord($self->func('match')))), |
3030
|
|
|
|
|
|
|
$self->if($self->func('empty'), $self->set('m', [ $self->func('auto_detect'), $n ])) |
3031
|
|
|
|
|
|
|
); |
3032
|
|
|
|
|
|
|
}; |
3033
|
|
|
|
|
|
|
|
3034
|
|
|
|
|
|
|
|
3035
|
|
|
|
|
|
|
|
3036
|
|
|
|
|
|
|
# [164] |
3037
|
|
|
|
|
|
|
# c-chomping-indicator(t) ::= |
3038
|
|
|
|
|
|
|
# ( '-' => t = strip ) |
3039
|
|
|
|
|
|
|
# ( '+' => t = keep ) |
3040
|
|
|
|
|
|
|
# ( => t = clip ) |
3041
|
|
|
|
|
|
|
|
3042
|
|
|
|
|
|
|
rule '164', c_chomping_indicator => sub { |
3043
|
2
|
|
|
2
|
|
6
|
my ($self) = @_; |
3044
|
2
|
|
|
|
|
3
|
debug_rule("c_chomping_indicator") if DEBUG; |
3045
|
2
|
|
|
|
|
9
|
$self->any( |
3046
|
|
|
|
|
|
|
$self->if($self->chr('-'), $self->set('t', "strip")), |
3047
|
|
|
|
|
|
|
$self->if($self->chr('+'), $self->set('t', "keep")), |
3048
|
|
|
|
|
|
|
$self->if($self->func('empty'), $self->set('t', "clip")) |
3049
|
|
|
|
|
|
|
); |
3050
|
|
|
|
|
|
|
}; |
3051
|
|
|
|
|
|
|
|
3052
|
|
|
|
|
|
|
|
3053
|
|
|
|
|
|
|
|
3054
|
|
|
|
|
|
|
# [165] |
3055
|
|
|
|
|
|
|
# b-chomped-last(t) ::= |
3056
|
|
|
|
|
|
|
# ( t = strip => b-non-content | ) |
3057
|
|
|
|
|
|
|
# ( t = clip => b-as-line-feed | ) |
3058
|
|
|
|
|
|
|
# ( t = keep => b-as-line-feed | ) |
3059
|
|
|
|
|
|
|
|
3060
|
|
|
|
|
|
|
rule '165', b_chomped_last => sub { |
3061
|
2
|
|
|
2
|
|
8
|
my ($self, $t) = @_; |
3062
|
2
|
|
|
|
|
4
|
debug_rule("b_chomped_last",$t) if DEBUG; |
3063
|
2
|
|
|
|
|
8
|
$self->case( |
3064
|
|
|
|
|
|
|
$t, |
3065
|
|
|
|
|
|
|
{ |
3066
|
|
|
|
|
|
|
'clip' => $self->any( $self->func('b_as_line_feed'), $self->func('end_of_stream') ), |
3067
|
|
|
|
|
|
|
'keep' => $self->any( $self->func('b_as_line_feed'), $self->func('end_of_stream') ), |
3068
|
|
|
|
|
|
|
'strip' => $self->any( $self->func('b_non_content'), $self->func('end_of_stream') ), |
3069
|
|
|
|
|
|
|
} |
3070
|
|
|
|
|
|
|
); |
3071
|
|
|
|
|
|
|
}; |
3072
|
|
|
|
|
|
|
|
3073
|
|
|
|
|
|
|
|
3074
|
|
|
|
|
|
|
|
3075
|
|
|
|
|
|
|
# [166] |
3076
|
|
|
|
|
|
|
# l-chomped-empty(n,t) ::= |
3077
|
|
|
|
|
|
|
# ( t = strip => l-strip-empty(n) ) |
3078
|
|
|
|
|
|
|
# ( t = clip => l-strip-empty(n) ) |
3079
|
|
|
|
|
|
|
# ( t = keep => l-keep-empty(n) ) |
3080
|
|
|
|
|
|
|
|
3081
|
|
|
|
|
|
|
rule '166', l_chomped_empty => sub { |
3082
|
2
|
|
|
2
|
|
8
|
my ($self, $n, $t) = @_; |
3083
|
2
|
|
|
|
|
4
|
debug_rule("l_chomped_empty",$n,$t) if DEBUG; |
3084
|
2
|
|
|
|
|
7
|
$self->case( |
3085
|
|
|
|
|
|
|
$t, |
3086
|
|
|
|
|
|
|
{ |
3087
|
|
|
|
|
|
|
'clip' => [ $self->func('l_strip_empty'), $n ], |
3088
|
|
|
|
|
|
|
'keep' => [ $self->func('l_keep_empty'), $n ], |
3089
|
|
|
|
|
|
|
'strip' => [ $self->func('l_strip_empty'), $n ], |
3090
|
|
|
|
|
|
|
} |
3091
|
|
|
|
|
|
|
); |
3092
|
|
|
|
|
|
|
}; |
3093
|
|
|
|
|
|
|
|
3094
|
|
|
|
|
|
|
|
3095
|
|
|
|
|
|
|
|
3096
|
|
|
|
|
|
|
# [167] |
3097
|
|
|
|
|
|
|
# l-strip-empty(n) ::= |
3098
|
|
|
|
|
|
|
# ( s-indent(<=n) b-non-content )* |
3099
|
|
|
|
|
|
|
# l-trail-comments(n)? |
3100
|
|
|
|
|
|
|
|
3101
|
|
|
|
|
|
|
rule '167', l_strip_empty => sub { |
3102
|
2
|
|
|
2
|
|
5
|
my ($self, $n) = @_; |
3103
|
2
|
|
|
|
|
4
|
debug_rule("l_strip_empty",$n) if DEBUG; |
3104
|
2
|
|
|
|
|
8
|
$self->all( |
3105
|
|
|
|
|
|
|
$self->rep(0, undef, |
3106
|
|
|
|
|
|
|
$self->all( |
3107
|
|
|
|
|
|
|
[ $self->func('s_indent_le'), $n ], |
3108
|
|
|
|
|
|
|
$self->func('b_non_content') |
3109
|
|
|
|
|
|
|
)), |
3110
|
|
|
|
|
|
|
$self->rep2(0, 1, [ $self->func('l_trail_comments'), $n ]) |
3111
|
|
|
|
|
|
|
); |
3112
|
|
|
|
|
|
|
}; |
3113
|
|
|
|
|
|
|
|
3114
|
|
|
|
|
|
|
|
3115
|
|
|
|
|
|
|
|
3116
|
|
|
|
|
|
|
# [168] |
3117
|
|
|
|
|
|
|
# l-keep-empty(n) ::= |
3118
|
|
|
|
|
|
|
# l-empty(n,block-in)* |
3119
|
|
|
|
|
|
|
# l-trail-comments(n)? |
3120
|
|
|
|
|
|
|
|
3121
|
|
|
|
|
|
|
rule '168', l_keep_empty => sub { |
3122
|
0
|
|
|
0
|
|
0
|
my ($self, $n) = @_; |
3123
|
0
|
|
|
|
|
0
|
debug_rule("l_keep_empty",$n) if DEBUG; |
3124
|
0
|
|
|
|
|
0
|
$self->all( |
3125
|
|
|
|
|
|
|
$self->rep(0, undef, [ $self->func('l_empty'), $n, "block-in" ]), |
3126
|
|
|
|
|
|
|
$self->rep2(0, 1, [ $self->func('l_trail_comments'), $n ]) |
3127
|
|
|
|
|
|
|
); |
3128
|
|
|
|
|
|
|
}; |
3129
|
|
|
|
|
|
|
|
3130
|
|
|
|
|
|
|
|
3131
|
|
|
|
|
|
|
|
3132
|
|
|
|
|
|
|
# [169] |
3133
|
|
|
|
|
|
|
# l-trail-comments(n) ::= |
3134
|
|
|
|
|
|
|
# s-indent(
|
3135
|
|
|
|
|
|
|
# c-nb-comment-text b-comment |
3136
|
|
|
|
|
|
|
# l-comment* |
3137
|
|
|
|
|
|
|
|
3138
|
|
|
|
|
|
|
rule '169', l_trail_comments => sub { |
3139
|
2
|
|
|
2
|
|
8
|
my ($self, $n) = @_; |
3140
|
2
|
|
|
|
|
4
|
debug_rule("l_trail_comments",$n) if DEBUG; |
3141
|
2
|
|
|
|
|
8
|
$self->all( |
3142
|
|
|
|
|
|
|
[ $self->func('s_indent_lt'), $n ], |
3143
|
|
|
|
|
|
|
$self->func('c_nb_comment_text'), |
3144
|
|
|
|
|
|
|
$self->func('b_comment'), |
3145
|
|
|
|
|
|
|
$self->rep(0, undef, $self->func('l_comment')) |
3146
|
|
|
|
|
|
|
); |
3147
|
|
|
|
|
|
|
}; |
3148
|
|
|
|
|
|
|
|
3149
|
|
|
|
|
|
|
|
3150
|
|
|
|
|
|
|
|
3151
|
|
|
|
|
|
|
# [170] |
3152
|
|
|
|
|
|
|
# c-l+literal(n) ::= |
3153
|
|
|
|
|
|
|
# '|' c-b-block-header(m,t) |
3154
|
|
|
|
|
|
|
# l-literal-content(n+m,t) |
3155
|
|
|
|
|
|
|
|
3156
|
|
|
|
|
|
|
rule '170', c_l_literal => sub { |
3157
|
6
|
|
|
6
|
|
18
|
my ($self, $n) = @_; |
3158
|
6
|
|
|
|
|
9
|
debug_rule("c_l_literal",$n) if DEBUG; |
3159
|
6
|
|
|
|
|
23
|
$self->all( |
3160
|
|
|
|
|
|
|
$self->chr('|'), |
3161
|
|
|
|
|
|
|
[ $self->func('c_b_block_header'), $n ], |
3162
|
|
|
|
|
|
|
[ $self->func('l_literal_content'), $self->add($n, $self->m()), $self->t() ] |
3163
|
|
|
|
|
|
|
); |
3164
|
|
|
|
|
|
|
}; |
3165
|
|
|
|
|
|
|
|
3166
|
|
|
|
|
|
|
|
3167
|
|
|
|
|
|
|
|
3168
|
|
|
|
|
|
|
# [171] |
3169
|
|
|
|
|
|
|
# l-nb-literal-text(n) ::= |
3170
|
|
|
|
|
|
|
# l-empty(n,block-in)* |
3171
|
|
|
|
|
|
|
# s-indent(n) nb-char+ |
3172
|
|
|
|
|
|
|
|
3173
|
|
|
|
|
|
|
rule '171', l_nb_literal_text => sub { |
3174
|
8
|
|
|
8
|
|
23
|
my ($self, $n) = @_; |
3175
|
8
|
|
|
|
|
14
|
debug_rule("l_nb_literal_text",$n) if DEBUG; |
3176
|
8
|
|
|
|
|
31
|
$self->all( |
3177
|
|
|
|
|
|
|
$self->rep(0, undef, [ $self->func('l_empty'), $n, "block-in" ]), |
3178
|
|
|
|
|
|
|
[ $self->func('s_indent'), $n ], |
3179
|
|
|
|
|
|
|
$self->rep2(1, undef, $self->func('nb_char')) |
3180
|
|
|
|
|
|
|
); |
3181
|
|
|
|
|
|
|
}; |
3182
|
|
|
|
|
|
|
|
3183
|
|
|
|
|
|
|
|
3184
|
|
|
|
|
|
|
|
3185
|
|
|
|
|
|
|
# [172] |
3186
|
|
|
|
|
|
|
# b-nb-literal-next(n) ::= |
3187
|
|
|
|
|
|
|
# b-as-line-feed |
3188
|
|
|
|
|
|
|
# l-nb-literal-text(n) |
3189
|
|
|
|
|
|
|
|
3190
|
|
|
|
|
|
|
rule '172', b_nb_literal_next => sub { |
3191
|
6
|
|
|
6
|
|
20
|
my ($self, $n) = @_; |
3192
|
6
|
|
|
|
|
10
|
debug_rule("b_nb_literal_next",$n) if DEBUG; |
3193
|
6
|
|
|
|
|
29
|
$self->all( |
3194
|
|
|
|
|
|
|
$self->func('b_as_line_feed'), |
3195
|
|
|
|
|
|
|
[ $self->func('l_nb_literal_text'), $n ] |
3196
|
|
|
|
|
|
|
); |
3197
|
|
|
|
|
|
|
}; |
3198
|
|
|
|
|
|
|
|
3199
|
|
|
|
|
|
|
|
3200
|
|
|
|
|
|
|
|
3201
|
|
|
|
|
|
|
# [173] |
3202
|
|
|
|
|
|
|
# l-literal-content(n,t) ::= |
3203
|
|
|
|
|
|
|
# ( l-nb-literal-text(n) |
3204
|
|
|
|
|
|
|
# b-nb-literal-next(n)* |
3205
|
|
|
|
|
|
|
# b-chomped-last(t) )? |
3206
|
|
|
|
|
|
|
# l-chomped-empty(n,t) |
3207
|
|
|
|
|
|
|
|
3208
|
|
|
|
|
|
|
rule '173', l_literal_content => sub { |
3209
|
2
|
|
|
2
|
|
7
|
my ($self, $n, $t) = @_; |
3210
|
2
|
|
|
|
|
4
|
debug_rule("l_literal_content",$n,$t) if DEBUG; |
3211
|
2
|
|
|
|
|
11
|
$self->all( |
3212
|
|
|
|
|
|
|
$self->rep(0, 1, |
3213
|
|
|
|
|
|
|
$self->all( |
3214
|
|
|
|
|
|
|
[ $self->func('l_nb_literal_text'), $n ], |
3215
|
|
|
|
|
|
|
$self->rep(0, undef, [ $self->func('b_nb_literal_next'), $n ]), |
3216
|
|
|
|
|
|
|
[ $self->func('b_chomped_last'), $t ] |
3217
|
|
|
|
|
|
|
)), |
3218
|
|
|
|
|
|
|
[ $self->func('l_chomped_empty'), $n, $t ] |
3219
|
|
|
|
|
|
|
); |
3220
|
|
|
|
|
|
|
}; |
3221
|
|
|
|
|
|
|
|
3222
|
|
|
|
|
|
|
|
3223
|
|
|
|
|
|
|
|
3224
|
|
|
|
|
|
|
# [174] |
3225
|
|
|
|
|
|
|
# c-l+folded(n) ::= |
3226
|
|
|
|
|
|
|
# '>' c-b-block-header(m,t) |
3227
|
|
|
|
|
|
|
# l-folded-content(n+m,t) |
3228
|
|
|
|
|
|
|
|
3229
|
|
|
|
|
|
|
rule '174', c_l_folded => sub { |
3230
|
4
|
|
|
4
|
|
13
|
my ($self, $n) = @_; |
3231
|
4
|
|
|
|
|
10
|
debug_rule("c_l_folded",$n) if DEBUG; |
3232
|
4
|
|
|
|
|
14
|
$self->all( |
3233
|
|
|
|
|
|
|
$self->chr('>'), |
3234
|
|
|
|
|
|
|
[ $self->func('c_b_block_header'), $n ], |
3235
|
|
|
|
|
|
|
[ $self->func('l_folded_content'), $self->add($n, $self->m()), $self->t() ] |
3236
|
|
|
|
|
|
|
); |
3237
|
|
|
|
|
|
|
}; |
3238
|
|
|
|
|
|
|
|
3239
|
|
|
|
|
|
|
|
3240
|
|
|
|
|
|
|
|
3241
|
|
|
|
|
|
|
# [175] |
3242
|
|
|
|
|
|
|
# s-nb-folded-text(n) ::= |
3243
|
|
|
|
|
|
|
# s-indent(n) ns-char |
3244
|
|
|
|
|
|
|
# nb-char* |
3245
|
|
|
|
|
|
|
|
3246
|
|
|
|
|
|
|
rule '175', s_nb_folded_text => sub { |
3247
|
0
|
|
|
0
|
|
0
|
my ($self, $n) = @_; |
3248
|
0
|
|
|
|
|
0
|
debug_rule("s_nb_folded_text",$n) if DEBUG; |
3249
|
0
|
|
|
|
|
0
|
$self->all( |
3250
|
|
|
|
|
|
|
[ $self->func('s_indent'), $n ], |
3251
|
|
|
|
|
|
|
$self->func('ns_char'), |
3252
|
|
|
|
|
|
|
$self->rep(0, undef, $self->func('nb_char')) |
3253
|
|
|
|
|
|
|
); |
3254
|
|
|
|
|
|
|
}; |
3255
|
|
|
|
|
|
|
|
3256
|
|
|
|
|
|
|
|
3257
|
|
|
|
|
|
|
|
3258
|
|
|
|
|
|
|
# [176] |
3259
|
|
|
|
|
|
|
# l-nb-folded-lines(n) ::= |
3260
|
|
|
|
|
|
|
# s-nb-folded-text(n) |
3261
|
|
|
|
|
|
|
# ( b-l-folded(n,block-in) s-nb-folded-text(n) )* |
3262
|
|
|
|
|
|
|
|
3263
|
|
|
|
|
|
|
rule '176', l_nb_folded_lines => sub { |
3264
|
0
|
|
|
0
|
|
0
|
my ($self, $n) = @_; |
3265
|
0
|
|
|
|
|
0
|
debug_rule("l_nb_folded_lines",$n) if DEBUG; |
3266
|
0
|
|
|
|
|
0
|
$self->all( |
3267
|
|
|
|
|
|
|
[ $self->func('s_nb_folded_text'), $n ], |
3268
|
|
|
|
|
|
|
$self->rep(0, undef, |
3269
|
|
|
|
|
|
|
$self->all( |
3270
|
|
|
|
|
|
|
[ $self->func('b_l_folded'), $n, "block-in" ], |
3271
|
|
|
|
|
|
|
[ $self->func('s_nb_folded_text'), $n ] |
3272
|
|
|
|
|
|
|
)) |
3273
|
|
|
|
|
|
|
); |
3274
|
|
|
|
|
|
|
}; |
3275
|
|
|
|
|
|
|
|
3276
|
|
|
|
|
|
|
|
3277
|
|
|
|
|
|
|
|
3278
|
|
|
|
|
|
|
# [177] |
3279
|
|
|
|
|
|
|
# s-nb-spaced-text(n) ::= |
3280
|
|
|
|
|
|
|
# s-indent(n) s-white |
3281
|
|
|
|
|
|
|
# nb-char* |
3282
|
|
|
|
|
|
|
|
3283
|
|
|
|
|
|
|
rule '177', s_nb_spaced_text => sub { |
3284
|
0
|
|
|
0
|
|
0
|
my ($self, $n) = @_; |
3285
|
0
|
|
|
|
|
0
|
debug_rule("s_nb_spaced_text",$n) if DEBUG; |
3286
|
0
|
|
|
|
|
0
|
$self->all( |
3287
|
|
|
|
|
|
|
[ $self->func('s_indent'), $n ], |
3288
|
|
|
|
|
|
|
$self->func('s_white'), |
3289
|
|
|
|
|
|
|
$self->rep(0, undef, $self->func('nb_char')) |
3290
|
|
|
|
|
|
|
); |
3291
|
|
|
|
|
|
|
}; |
3292
|
|
|
|
|
|
|
|
3293
|
|
|
|
|
|
|
|
3294
|
|
|
|
|
|
|
|
3295
|
|
|
|
|
|
|
# [178] |
3296
|
|
|
|
|
|
|
# b-l-spaced(n) ::= |
3297
|
|
|
|
|
|
|
# b-as-line-feed |
3298
|
|
|
|
|
|
|
# l-empty(n,block-in)* |
3299
|
|
|
|
|
|
|
|
3300
|
|
|
|
|
|
|
rule '178', b_l_spaced => sub { |
3301
|
0
|
|
|
0
|
|
0
|
my ($self, $n) = @_; |
3302
|
0
|
|
|
|
|
0
|
debug_rule("b_l_spaced",$n) if DEBUG; |
3303
|
0
|
|
|
|
|
0
|
$self->all( |
3304
|
|
|
|
|
|
|
$self->func('b_as_line_feed'), |
3305
|
|
|
|
|
|
|
$self->rep(0, undef, [ $self->func('l_empty'), $n, "block-in" ]) |
3306
|
|
|
|
|
|
|
); |
3307
|
|
|
|
|
|
|
}; |
3308
|
|
|
|
|
|
|
|
3309
|
|
|
|
|
|
|
|
3310
|
|
|
|
|
|
|
|
3311
|
|
|
|
|
|
|
# [179] |
3312
|
|
|
|
|
|
|
# l-nb-spaced-lines(n) ::= |
3313
|
|
|
|
|
|
|
# s-nb-spaced-text(n) |
3314
|
|
|
|
|
|
|
# ( b-l-spaced(n) s-nb-spaced-text(n) )* |
3315
|
|
|
|
|
|
|
|
3316
|
|
|
|
|
|
|
rule '179', l_nb_spaced_lines => sub { |
3317
|
0
|
|
|
0
|
|
0
|
my ($self, $n) = @_; |
3318
|
0
|
|
|
|
|
0
|
debug_rule("l_nb_spaced_lines",$n) if DEBUG; |
3319
|
0
|
|
|
|
|
0
|
$self->all( |
3320
|
|
|
|
|
|
|
[ $self->func('s_nb_spaced_text'), $n ], |
3321
|
|
|
|
|
|
|
$self->rep(0, undef, |
3322
|
|
|
|
|
|
|
$self->all( |
3323
|
|
|
|
|
|
|
[ $self->func('b_l_spaced'), $n ], |
3324
|
|
|
|
|
|
|
[ $self->func('s_nb_spaced_text'), $n ] |
3325
|
|
|
|
|
|
|
)) |
3326
|
|
|
|
|
|
|
); |
3327
|
|
|
|
|
|
|
}; |
3328
|
|
|
|
|
|
|
|
3329
|
|
|
|
|
|
|
|
3330
|
|
|
|
|
|
|
|
3331
|
|
|
|
|
|
|
# [180] |
3332
|
|
|
|
|
|
|
# l-nb-same-lines(n) ::= |
3333
|
|
|
|
|
|
|
# l-empty(n,block-in)* |
3334
|
|
|
|
|
|
|
# ( l-nb-folded-lines(n) | l-nb-spaced-lines(n) ) |
3335
|
|
|
|
|
|
|
|
3336
|
|
|
|
|
|
|
rule '180', l_nb_same_lines => sub { |
3337
|
0
|
|
|
0
|
|
0
|
my ($self, $n) = @_; |
3338
|
0
|
|
|
|
|
0
|
debug_rule("l_nb_same_lines",$n) if DEBUG; |
3339
|
0
|
|
|
|
|
0
|
$self->all( |
3340
|
|
|
|
|
|
|
$self->rep(0, undef, [ $self->func('l_empty'), $n, "block-in" ]), |
3341
|
|
|
|
|
|
|
$self->any( |
3342
|
|
|
|
|
|
|
[ $self->func('l_nb_folded_lines'), $n ], |
3343
|
|
|
|
|
|
|
[ $self->func('l_nb_spaced_lines'), $n ] |
3344
|
|
|
|
|
|
|
) |
3345
|
|
|
|
|
|
|
); |
3346
|
|
|
|
|
|
|
}; |
3347
|
|
|
|
|
|
|
|
3348
|
|
|
|
|
|
|
|
3349
|
|
|
|
|
|
|
|
3350
|
|
|
|
|
|
|
# [181] |
3351
|
|
|
|
|
|
|
# l-nb-diff-lines(n) ::= |
3352
|
|
|
|
|
|
|
# l-nb-same-lines(n) |
3353
|
|
|
|
|
|
|
# ( b-as-line-feed l-nb-same-lines(n) )* |
3354
|
|
|
|
|
|
|
|
3355
|
|
|
|
|
|
|
rule '181', l_nb_diff_lines => sub { |
3356
|
0
|
|
|
0
|
|
0
|
my ($self, $n) = @_; |
3357
|
0
|
|
|
|
|
0
|
debug_rule("l_nb_diff_lines",$n) if DEBUG; |
3358
|
0
|
|
|
|
|
0
|
$self->all( |
3359
|
|
|
|
|
|
|
[ $self->func('l_nb_same_lines'), $n ], |
3360
|
|
|
|
|
|
|
$self->rep(0, undef, |
3361
|
|
|
|
|
|
|
$self->all( |
3362
|
|
|
|
|
|
|
$self->func('b_as_line_feed'), |
3363
|
|
|
|
|
|
|
[ $self->func('l_nb_same_lines'), $n ] |
3364
|
|
|
|
|
|
|
)) |
3365
|
|
|
|
|
|
|
); |
3366
|
|
|
|
|
|
|
}; |
3367
|
|
|
|
|
|
|
|
3368
|
|
|
|
|
|
|
|
3369
|
|
|
|
|
|
|
|
3370
|
|
|
|
|
|
|
# [182] |
3371
|
|
|
|
|
|
|
# l-folded-content(n,t) ::= |
3372
|
|
|
|
|
|
|
# ( l-nb-diff-lines(n) |
3373
|
|
|
|
|
|
|
# b-chomped-last(t) )? |
3374
|
|
|
|
|
|
|
# l-chomped-empty(n,t) |
3375
|
|
|
|
|
|
|
|
3376
|
|
|
|
|
|
|
rule '182', l_folded_content => sub { |
3377
|
0
|
|
|
0
|
|
0
|
my ($self, $n, $t) = @_; |
3378
|
0
|
|
|
|
|
0
|
debug_rule("l_folded_content",$n,$t) if DEBUG; |
3379
|
0
|
|
|
|
|
0
|
$self->all( |
3380
|
|
|
|
|
|
|
$self->rep(0, 1, |
3381
|
|
|
|
|
|
|
$self->all( |
3382
|
|
|
|
|
|
|
[ $self->func('l_nb_diff_lines'), $n ], |
3383
|
|
|
|
|
|
|
[ $self->func('b_chomped_last'), $t ] |
3384
|
|
|
|
|
|
|
)), |
3385
|
|
|
|
|
|
|
[ $self->func('l_chomped_empty'), $n, $t ] |
3386
|
|
|
|
|
|
|
); |
3387
|
|
|
|
|
|
|
}; |
3388
|
|
|
|
|
|
|
|
3389
|
|
|
|
|
|
|
|
3390
|
|
|
|
|
|
|
|
3391
|
|
|
|
|
|
|
# [183] |
3392
|
|
|
|
|
|
|
# l+block-sequence(n) ::= |
3393
|
|
|
|
|
|
|
# ( s-indent(n+m) |
3394
|
|
|
|
|
|
|
# c-l-block-seq-entry(n+m) )+ |
3395
|
|
|
|
|
|
|
# _0> |
3396
|
|
|
|
|
|
|
|
3397
|
|
|
|
|
|
|
rule '183', l_block_sequence => sub { |
3398
|
2
|
|
|
2
|
|
6
|
my ($self, $n) = @_; |
3399
|
2
|
50
|
|
|
|
7
|
my $m = $self->call([$self->func('auto_detect_indent'), $n], 'number') or return false; |
3400
|
2
|
|
|
|
|
6
|
debug_rule("l_block_sequence",$n) if DEBUG; |
3401
|
2
|
|
|
|
|
8
|
$self->all( |
3402
|
|
|
|
|
|
|
$self->rep(1, undef, |
3403
|
|
|
|
|
|
|
$self->all( |
3404
|
|
|
|
|
|
|
[ $self->func('s_indent'), $self->add($n, $m) ], |
3405
|
|
|
|
|
|
|
[ $self->func('c_l_block_seq_entry'), $self->add($n, $m) ] |
3406
|
|
|
|
|
|
|
)) |
3407
|
|
|
|
|
|
|
); |
3408
|
|
|
|
|
|
|
}; |
3409
|
|
|
|
|
|
|
|
3410
|
|
|
|
|
|
|
|
3411
|
|
|
|
|
|
|
|
3412
|
|
|
|
|
|
|
# [184] |
3413
|
|
|
|
|
|
|
# c-l-block-seq-entry(n) ::= |
3414
|
|
|
|
|
|
|
# '-' |
3415
|
|
|
|
|
|
|
# s-l+block-indented(n,block-in) |
3416
|
|
|
|
|
|
|
|
3417
|
|
|
|
|
|
|
rule '184', c_l_block_seq_entry => sub { |
3418
|
2
|
|
|
2
|
|
6
|
my ($self, $n) = @_; |
3419
|
2
|
|
|
|
|
3
|
debug_rule("c_l_block_seq_entry",$n) if DEBUG; |
3420
|
2
|
|
|
|
|
10
|
$self->all( |
3421
|
|
|
|
|
|
|
$self->chr('-'), |
3422
|
|
|
|
|
|
|
$self->chk('!', $self->func('ns_char')), |
3423
|
|
|
|
|
|
|
[ $self->func('s_l_block_indented'), $n, "block-in" ] |
3424
|
|
|
|
|
|
|
); |
3425
|
|
|
|
|
|
|
}; |
3426
|
|
|
|
|
|
|
|
3427
|
|
|
|
|
|
|
|
3428
|
|
|
|
|
|
|
|
3429
|
|
|
|
|
|
|
# [185] |
3430
|
|
|
|
|
|
|
# s-l+block-indented(n,c) ::= |
3431
|
|
|
|
|
|
|
# ( s-indent(m) |
3432
|
|
|
|
|
|
|
# ( ns-l-compact-sequence(n+1+m) |
3433
|
|
|
|
|
|
|
# | ns-l-compact-mapping(n+1+m) ) ) |
3434
|
|
|
|
|
|
|
# | s-l+block-node(n,c) |
3435
|
|
|
|
|
|
|
# | ( e-node s-l-comments ) |
3436
|
|
|
|
|
|
|
|
3437
|
|
|
|
|
|
|
rule '185', s_l_block_indented => sub { |
3438
|
0
|
|
|
0
|
|
0
|
my ($self, $n, $c) = @_; |
3439
|
0
|
|
|
|
|
0
|
my $m = $self->call([$self->func('auto_detect_indent'), $n], 'number'); |
3440
|
0
|
|
|
|
|
0
|
debug_rule("s_l_block_indented",$n,$c) if DEBUG; |
3441
|
0
|
|
|
|
|
0
|
$self->any( |
3442
|
|
|
|
|
|
|
$self->all( |
3443
|
|
|
|
|
|
|
[ $self->func('s_indent'), $m ], |
3444
|
|
|
|
|
|
|
$self->any( |
3445
|
|
|
|
|
|
|
[ $self->func('ns_l_compact_sequence'), $self->add($n, $self->add(1, $m)) ], |
3446
|
|
|
|
|
|
|
[ $self->func('ns_l_compact_mapping'), $self->add($n, $self->add(1, $m)) ] |
3447
|
|
|
|
|
|
|
) |
3448
|
|
|
|
|
|
|
), |
3449
|
|
|
|
|
|
|
[ $self->func('s_l_block_node'), $n, $c ], |
3450
|
|
|
|
|
|
|
$self->all( |
3451
|
|
|
|
|
|
|
$self->func('e_node'), |
3452
|
|
|
|
|
|
|
$self->func('s_l_comments') |
3453
|
|
|
|
|
|
|
) |
3454
|
|
|
|
|
|
|
); |
3455
|
|
|
|
|
|
|
}; |
3456
|
|
|
|
|
|
|
|
3457
|
|
|
|
|
|
|
|
3458
|
|
|
|
|
|
|
|
3459
|
|
|
|
|
|
|
# [186] |
3460
|
|
|
|
|
|
|
# ns-l-compact-sequence(n) ::= |
3461
|
|
|
|
|
|
|
# c-l-block-seq-entry(n) |
3462
|
|
|
|
|
|
|
# ( s-indent(n) c-l-block-seq-entry(n) )* |
3463
|
|
|
|
|
|
|
|
3464
|
|
|
|
|
|
|
rule '186', ns_l_compact_sequence => sub { |
3465
|
0
|
|
|
0
|
|
0
|
my ($self, $n) = @_; |
3466
|
0
|
|
|
|
|
0
|
debug_rule("ns_l_compact_sequence",$n) if DEBUG; |
3467
|
0
|
|
|
|
|
0
|
$self->all( |
3468
|
|
|
|
|
|
|
[ $self->func('c_l_block_seq_entry'), $n ], |
3469
|
|
|
|
|
|
|
$self->rep(0, undef, |
3470
|
|
|
|
|
|
|
$self->all( |
3471
|
|
|
|
|
|
|
[ $self->func('s_indent'), $n ], |
3472
|
|
|
|
|
|
|
[ $self->func('c_l_block_seq_entry'), $n ] |
3473
|
|
|
|
|
|
|
)) |
3474
|
|
|
|
|
|
|
); |
3475
|
|
|
|
|
|
|
}; |
3476
|
|
|
|
|
|
|
|
3477
|
|
|
|
|
|
|
|
3478
|
|
|
|
|
|
|
|
3479
|
|
|
|
|
|
|
# [187] |
3480
|
|
|
|
|
|
|
# l+block-mapping(n) ::= |
3481
|
|
|
|
|
|
|
# ( s-indent(n+m) |
3482
|
|
|
|
|
|
|
# ns-l-block-map-entry(n+m) )+ |
3483
|
|
|
|
|
|
|
# _0> |
3484
|
|
|
|
|
|
|
|
3485
|
|
|
|
|
|
|
rule '187', l_block_mapping => sub { |
3486
|
2
|
|
|
2
|
|
38
|
my ($self, $n) = @_; |
3487
|
2
|
50
|
|
|
|
12
|
my $m = $self->call([$self->func('auto_detect_indent'), $n], 'number') or return false; |
3488
|
2
|
|
|
|
|
5
|
debug_rule("l_block_mapping",$n) if DEBUG; |
3489
|
2
|
|
|
|
|
15
|
$self->all( |
3490
|
|
|
|
|
|
|
$self->rep(1, undef, |
3491
|
|
|
|
|
|
|
$self->all( |
3492
|
|
|
|
|
|
|
[ $self->func('s_indent'), $self->add($n, $m) ], |
3493
|
|
|
|
|
|
|
[ $self->func('ns_l_block_map_entry'), $self->add($n, $m) ] |
3494
|
|
|
|
|
|
|
)) |
3495
|
|
|
|
|
|
|
); |
3496
|
|
|
|
|
|
|
}; |
3497
|
|
|
|
|
|
|
|
3498
|
|
|
|
|
|
|
|
3499
|
|
|
|
|
|
|
|
3500
|
|
|
|
|
|
|
# [188] |
3501
|
|
|
|
|
|
|
# ns-l-block-map-entry(n) ::= |
3502
|
|
|
|
|
|
|
# c-l-block-map-explicit-entry(n) |
3503
|
|
|
|
|
|
|
# | ns-l-block-map-implicit-entry(n) |
3504
|
|
|
|
|
|
|
|
3505
|
|
|
|
|
|
|
rule '188', ns_l_block_map_entry => sub { |
3506
|
6
|
|
|
6
|
|
30
|
my ($self, $n) = @_; |
3507
|
6
|
|
|
|
|
11
|
debug_rule("ns_l_block_map_entry",$n) if DEBUG; |
3508
|
6
|
|
|
|
|
21
|
$self->any( |
3509
|
|
|
|
|
|
|
[ $self->func('c_l_block_map_explicit_entry'), $n ], |
3510
|
|
|
|
|
|
|
[ $self->func('ns_l_block_map_implicit_entry'), $n ] |
3511
|
|
|
|
|
|
|
); |
3512
|
|
|
|
|
|
|
}; |
3513
|
|
|
|
|
|
|
|
3514
|
|
|
|
|
|
|
|
3515
|
|
|
|
|
|
|
|
3516
|
|
|
|
|
|
|
# [189] |
3517
|
|
|
|
|
|
|
# c-l-block-map-explicit-entry(n) ::= |
3518
|
|
|
|
|
|
|
# c-l-block-map-explicit-key(n) |
3519
|
|
|
|
|
|
|
# ( l-block-map-explicit-value(n) |
3520
|
|
|
|
|
|
|
# | e-node ) |
3521
|
|
|
|
|
|
|
|
3522
|
|
|
|
|
|
|
rule '189', c_l_block_map_explicit_entry => sub { |
3523
|
6
|
|
|
6
|
|
21
|
my ($self, $n) = @_; |
3524
|
6
|
|
|
|
|
8
|
debug_rule("c_l_block_map_explicit_entry",$n) if DEBUG; |
3525
|
6
|
|
|
|
|
21
|
$self->all( |
3526
|
|
|
|
|
|
|
[ $self->func('c_l_block_map_explicit_key'), $n ], |
3527
|
|
|
|
|
|
|
$self->any( |
3528
|
|
|
|
|
|
|
[ $self->func('l_block_map_explicit_value'), $n ], |
3529
|
|
|
|
|
|
|
$self->func('e_node') |
3530
|
|
|
|
|
|
|
) |
3531
|
|
|
|
|
|
|
); |
3532
|
|
|
|
|
|
|
}; |
3533
|
|
|
|
|
|
|
|
3534
|
|
|
|
|
|
|
|
3535
|
|
|
|
|
|
|
|
3536
|
|
|
|
|
|
|
# [190] |
3537
|
|
|
|
|
|
|
# c-l-block-map-explicit-key(n) ::= |
3538
|
|
|
|
|
|
|
# '?' |
3539
|
|
|
|
|
|
|
# s-l+block-indented(n,block-out) |
3540
|
|
|
|
|
|
|
|
3541
|
|
|
|
|
|
|
rule '190', c_l_block_map_explicit_key => sub { |
3542
|
6
|
|
|
6
|
|
17
|
my ($self, $n) = @_; |
3543
|
6
|
|
|
|
|
11
|
debug_rule("c_l_block_map_explicit_key",$n) if DEBUG; |
3544
|
6
|
|
|
|
|
19
|
$self->all( |
3545
|
|
|
|
|
|
|
$self->chr('?'), |
3546
|
|
|
|
|
|
|
$self->chk( |
3547
|
|
|
|
|
|
|
'=', |
3548
|
|
|
|
|
|
|
$self->any( |
3549
|
|
|
|
|
|
|
$self->func('end_of_stream'), |
3550
|
|
|
|
|
|
|
$self->func('s_white'), |
3551
|
|
|
|
|
|
|
$self->func('b_break') |
3552
|
|
|
|
|
|
|
) |
3553
|
|
|
|
|
|
|
), |
3554
|
|
|
|
|
|
|
[ $self->func('s_l_block_indented'), $n, "block-out" ] |
3555
|
|
|
|
|
|
|
); |
3556
|
|
|
|
|
|
|
}; |
3557
|
|
|
|
|
|
|
|
3558
|
|
|
|
|
|
|
|
3559
|
|
|
|
|
|
|
|
3560
|
|
|
|
|
|
|
# [191] |
3561
|
|
|
|
|
|
|
# l-block-map-explicit-value(n) ::= |
3562
|
|
|
|
|
|
|
# s-indent(n) |
3563
|
|
|
|
|
|
|
# ':' s-l+block-indented(n,block-out) |
3564
|
|
|
|
|
|
|
|
3565
|
|
|
|
|
|
|
rule '191', l_block_map_explicit_value => sub { |
3566
|
0
|
|
|
0
|
|
0
|
my ($self, $n) = @_; |
3567
|
0
|
|
|
|
|
0
|
debug_rule("l_block_map_explicit_value",$n) if DEBUG; |
3568
|
0
|
|
|
|
|
0
|
$self->all( |
3569
|
|
|
|
|
|
|
[ $self->func('s_indent'), $n ], |
3570
|
|
|
|
|
|
|
$self->chr(':'), |
3571
|
|
|
|
|
|
|
[ $self->func('s_l_block_indented'), $n, "block-out" ] |
3572
|
|
|
|
|
|
|
); |
3573
|
|
|
|
|
|
|
}; |
3574
|
|
|
|
|
|
|
|
3575
|
|
|
|
|
|
|
|
3576
|
|
|
|
|
|
|
|
3577
|
|
|
|
|
|
|
# [192] |
3578
|
|
|
|
|
|
|
# ns-l-block-map-implicit-entry(n) ::= |
3579
|
|
|
|
|
|
|
# ( |
3580
|
|
|
|
|
|
|
# ns-s-block-map-implicit-key |
3581
|
|
|
|
|
|
|
# | e-node ) |
3582
|
|
|
|
|
|
|
# c-l-block-map-implicit-value(n) |
3583
|
|
|
|
|
|
|
|
3584
|
|
|
|
|
|
|
rule '192', ns_l_block_map_implicit_entry => sub { |
3585
|
6
|
|
|
6
|
|
25
|
my ($self, $n) = @_; |
3586
|
6
|
|
|
|
|
11
|
debug_rule("ns_l_block_map_implicit_entry",$n) if DEBUG; |
3587
|
6
|
|
|
|
|
19
|
$self->all( |
3588
|
|
|
|
|
|
|
$self->any( |
3589
|
|
|
|
|
|
|
$self->func('ns_s_block_map_implicit_key'), |
3590
|
|
|
|
|
|
|
$self->func('e_node') |
3591
|
|
|
|
|
|
|
), |
3592
|
|
|
|
|
|
|
[ $self->func('c_l_block_map_implicit_value'), $n ] |
3593
|
|
|
|
|
|
|
); |
3594
|
|
|
|
|
|
|
}; |
3595
|
|
|
|
|
|
|
|
3596
|
|
|
|
|
|
|
|
3597
|
|
|
|
|
|
|
|
3598
|
|
|
|
|
|
|
# [193] |
3599
|
|
|
|
|
|
|
# ns-s-block-map-implicit-key ::= |
3600
|
|
|
|
|
|
|
# c-s-implicit-json-key(block-key) |
3601
|
|
|
|
|
|
|
# | ns-s-implicit-yaml-key(block-key) |
3602
|
|
|
|
|
|
|
|
3603
|
|
|
|
|
|
|
rule '193', ns_s_block_map_implicit_key => sub { |
3604
|
6
|
|
|
6
|
|
18
|
my ($self) = @_; |
3605
|
6
|
|
|
|
|
11
|
debug_rule("ns_s_block_map_implicit_key") if DEBUG; |
3606
|
6
|
|
|
|
|
22
|
$self->any( |
3607
|
|
|
|
|
|
|
[ $self->func('c_s_implicit_json_key'), "block-key" ], |
3608
|
|
|
|
|
|
|
[ $self->func('ns_s_implicit_yaml_key'), "block-key" ] |
3609
|
|
|
|
|
|
|
); |
3610
|
|
|
|
|
|
|
}; |
3611
|
|
|
|
|
|
|
|
3612
|
|
|
|
|
|
|
|
3613
|
|
|
|
|
|
|
|
3614
|
|
|
|
|
|
|
# [194] |
3615
|
|
|
|
|
|
|
# c-l-block-map-implicit-value(n) ::= |
3616
|
|
|
|
|
|
|
# ':' ( |
3617
|
|
|
|
|
|
|
# s-l+block-node(n,block-out) |
3618
|
|
|
|
|
|
|
# | ( e-node s-l-comments ) ) |
3619
|
|
|
|
|
|
|
|
3620
|
|
|
|
|
|
|
rule '194', c_l_block_map_implicit_value => sub { |
3621
|
6
|
|
|
6
|
|
18
|
my ($self, $n) = @_; |
3622
|
6
|
|
|
|
|
10
|
debug_rule("c_l_block_map_implicit_value",$n) if DEBUG; |
3623
|
6
|
|
|
|
|
21
|
$self->all( |
3624
|
|
|
|
|
|
|
$self->chr(':'), |
3625
|
|
|
|
|
|
|
$self->any( |
3626
|
|
|
|
|
|
|
[ $self->func('s_l_block_node'), $n, "block-out" ], |
3627
|
|
|
|
|
|
|
$self->all( |
3628
|
|
|
|
|
|
|
$self->func('e_node'), |
3629
|
|
|
|
|
|
|
$self->func('s_l_comments') |
3630
|
|
|
|
|
|
|
) |
3631
|
|
|
|
|
|
|
) |
3632
|
|
|
|
|
|
|
); |
3633
|
|
|
|
|
|
|
}; |
3634
|
|
|
|
|
|
|
|
3635
|
|
|
|
|
|
|
|
3636
|
|
|
|
|
|
|
|
3637
|
|
|
|
|
|
|
# [195] |
3638
|
|
|
|
|
|
|
# ns-l-compact-mapping(n) ::= |
3639
|
|
|
|
|
|
|
# ns-l-block-map-entry(n) |
3640
|
|
|
|
|
|
|
# ( s-indent(n) ns-l-block-map-entry(n) )* |
3641
|
|
|
|
|
|
|
|
3642
|
|
|
|
|
|
|
rule '195', ns_l_compact_mapping => sub { |
3643
|
0
|
|
|
0
|
|
0
|
my ($self, $n) = @_; |
3644
|
0
|
|
|
|
|
0
|
debug_rule("ns_l_compact_mapping",$n) if DEBUG; |
3645
|
0
|
|
|
|
|
0
|
$self->all( |
3646
|
|
|
|
|
|
|
[ $self->func('ns_l_block_map_entry'), $n ], |
3647
|
|
|
|
|
|
|
$self->rep(0, undef, |
3648
|
|
|
|
|
|
|
$self->all( |
3649
|
|
|
|
|
|
|
[ $self->func('s_indent'), $n ], |
3650
|
|
|
|
|
|
|
[ $self->func('ns_l_block_map_entry'), $n ] |
3651
|
|
|
|
|
|
|
)) |
3652
|
|
|
|
|
|
|
); |
3653
|
|
|
|
|
|
|
}; |
3654
|
|
|
|
|
|
|
|
3655
|
|
|
|
|
|
|
|
3656
|
|
|
|
|
|
|
|
3657
|
|
|
|
|
|
|
# [196] |
3658
|
|
|
|
|
|
|
# s-l+block-node(n,c) ::= |
3659
|
|
|
|
|
|
|
# s-l+block-in-block(n,c) | s-l+flow-in-block(n) |
3660
|
|
|
|
|
|
|
|
3661
|
|
|
|
|
|
|
rule '196', s_l_block_node => sub { |
3662
|
6
|
|
|
6
|
|
21
|
my ($self, $n, $c) = @_; |
3663
|
6
|
|
|
|
|
13
|
debug_rule("s_l_block_node",$n,$c) if DEBUG; |
3664
|
6
|
|
|
|
|
24
|
$self->any( |
3665
|
|
|
|
|
|
|
[ $self->func('s_l_block_in_block'), $n, $c ], |
3666
|
|
|
|
|
|
|
[ $self->func('s_l_flow_in_block'), $n ] |
3667
|
|
|
|
|
|
|
); |
3668
|
|
|
|
|
|
|
}; |
3669
|
|
|
|
|
|
|
|
3670
|
|
|
|
|
|
|
|
3671
|
|
|
|
|
|
|
|
3672
|
|
|
|
|
|
|
# [197] |
3673
|
|
|
|
|
|
|
# s-l+flow-in-block(n) ::= |
3674
|
|
|
|
|
|
|
# s-separate(n+1,flow-out) |
3675
|
|
|
|
|
|
|
# ns-flow-node(n+1,flow-out) s-l-comments |
3676
|
|
|
|
|
|
|
|
3677
|
|
|
|
|
|
|
rule '197', s_l_flow_in_block => sub { |
3678
|
2
|
|
|
2
|
|
6
|
my ($self, $n) = @_; |
3679
|
2
|
|
|
|
|
4
|
debug_rule("s_l_flow_in_block",$n) if DEBUG; |
3680
|
2
|
|
|
|
|
9
|
$self->all( |
3681
|
|
|
|
|
|
|
[ $self->func('s_separate'), $self->add($n, 1), "flow-out" ], |
3682
|
|
|
|
|
|
|
[ $self->func('ns_flow_node'), $self->add($n, 1), "flow-out" ], |
3683
|
|
|
|
|
|
|
$self->func('s_l_comments') |
3684
|
|
|
|
|
|
|
); |
3685
|
|
|
|
|
|
|
}; |
3686
|
|
|
|
|
|
|
|
3687
|
|
|
|
|
|
|
|
3688
|
|
|
|
|
|
|
|
3689
|
|
|
|
|
|
|
# [198] |
3690
|
|
|
|
|
|
|
# s-l+block-in-block(n,c) ::= |
3691
|
|
|
|
|
|
|
# s-l+block-scalar(n,c) | s-l+block-collection(n,c) |
3692
|
|
|
|
|
|
|
|
3693
|
|
|
|
|
|
|
rule '198', s_l_block_in_block => sub { |
3694
|
6
|
|
|
6
|
|
18
|
my ($self, $n, $c) = @_; |
3695
|
6
|
|
|
|
|
13
|
debug_rule("s_l_block_in_block",$n,$c) if DEBUG; |
3696
|
6
|
|
|
|
|
19
|
$self->any( |
3697
|
|
|
|
|
|
|
[ $self->func('s_l_block_scalar'), $n, $c ], |
3698
|
|
|
|
|
|
|
[ $self->func('s_l_block_collection'), $n, $c ] |
3699
|
|
|
|
|
|
|
); |
3700
|
|
|
|
|
|
|
}; |
3701
|
|
|
|
|
|
|
|
3702
|
|
|
|
|
|
|
|
3703
|
|
|
|
|
|
|
|
3704
|
|
|
|
|
|
|
# [199] |
3705
|
|
|
|
|
|
|
# s-l+block-scalar(n,c) ::= |
3706
|
|
|
|
|
|
|
# s-separate(n+1,c) |
3707
|
|
|
|
|
|
|
# ( c-ns-properties(n+1,c) s-separate(n+1,c) )? |
3708
|
|
|
|
|
|
|
# ( c-l+literal(n) | c-l+folded(n) ) |
3709
|
|
|
|
|
|
|
|
3710
|
|
|
|
|
|
|
rule '199', s_l_block_scalar => sub { |
3711
|
6
|
|
|
6
|
|
21
|
my ($self, $n, $c) = @_; |
3712
|
6
|
|
|
|
|
13
|
debug_rule("s_l_block_scalar",$n,$c) if DEBUG; |
3713
|
6
|
|
|
|
|
20
|
$self->all( |
3714
|
|
|
|
|
|
|
[ $self->func('s_separate'), $self->add($n, 1), $c ], |
3715
|
|
|
|
|
|
|
$self->rep(0, 1, |
3716
|
|
|
|
|
|
|
$self->all( |
3717
|
|
|
|
|
|
|
[ $self->func('c_ns_properties'), $self->add($n, 1), $c ], |
3718
|
|
|
|
|
|
|
[ $self->func('s_separate'), $self->add($n, 1), $c ] |
3719
|
|
|
|
|
|
|
)), |
3720
|
|
|
|
|
|
|
$self->any( |
3721
|
|
|
|
|
|
|
[ $self->func('c_l_literal'), $n ], |
3722
|
|
|
|
|
|
|
[ $self->func('c_l_folded'), $n ] |
3723
|
|
|
|
|
|
|
) |
3724
|
|
|
|
|
|
|
); |
3725
|
|
|
|
|
|
|
}; |
3726
|
|
|
|
|
|
|
|
3727
|
|
|
|
|
|
|
|
3728
|
|
|
|
|
|
|
|
3729
|
|
|
|
|
|
|
# [200] |
3730
|
|
|
|
|
|
|
# s-l+block-collection(n,c) ::= |
3731
|
|
|
|
|
|
|
# ( s-separate(n+1,c) |
3732
|
|
|
|
|
|
|
# c-ns-properties(n+1,c) )? |
3733
|
|
|
|
|
|
|
# s-l-comments |
3734
|
|
|
|
|
|
|
# ( l+block-sequence(seq-spaces(n,c)) |
3735
|
|
|
|
|
|
|
# | l+block-mapping(n) ) |
3736
|
|
|
|
|
|
|
|
3737
|
|
|
|
|
|
|
rule '200', s_l_block_collection => sub { |
3738
|
4
|
|
|
4
|
|
12
|
my ($self, $n, $c) = @_; |
3739
|
4
|
|
|
|
|
10
|
debug_rule("s_l_block_collection",$n,$c) if DEBUG; |
3740
|
4
|
|
|
|
|
15
|
$self->all( |
3741
|
|
|
|
|
|
|
$self->rep(0, 1, |
3742
|
|
|
|
|
|
|
$self->all( |
3743
|
|
|
|
|
|
|
[ $self->func('s_separate'), $self->add($n, 1), $c ], |
3744
|
|
|
|
|
|
|
$self->any( |
3745
|
|
|
|
|
|
|
$self->all( |
3746
|
|
|
|
|
|
|
[ $self->func('c_ns_properties'), $self->add($n, 1), $c ], |
3747
|
|
|
|
|
|
|
$self->func('s_l_comments') |
3748
|
|
|
|
|
|
|
), |
3749
|
|
|
|
|
|
|
$self->all( |
3750
|
|
|
|
|
|
|
$self->func('c_ns_tag_property'), |
3751
|
|
|
|
|
|
|
$self->func('s_l_comments') |
3752
|
|
|
|
|
|
|
), |
3753
|
|
|
|
|
|
|
$self->all( |
3754
|
|
|
|
|
|
|
$self->func('c_ns_anchor_property'), |
3755
|
|
|
|
|
|
|
$self->func('s_l_comments') |
3756
|
|
|
|
|
|
|
) |
3757
|
|
|
|
|
|
|
) |
3758
|
|
|
|
|
|
|
)), |
3759
|
|
|
|
|
|
|
$self->func('s_l_comments'), |
3760
|
|
|
|
|
|
|
$self->any( |
3761
|
|
|
|
|
|
|
[ $self->func('l_block_sequence'), [ $self->func('seq_spaces'), $n, $c ] ], |
3762
|
|
|
|
|
|
|
[ $self->func('l_block_mapping'), $n ] |
3763
|
|
|
|
|
|
|
) |
3764
|
|
|
|
|
|
|
); |
3765
|
|
|
|
|
|
|
}; |
3766
|
|
|
|
|
|
|
|
3767
|
|
|
|
|
|
|
|
3768
|
|
|
|
|
|
|
|
3769
|
|
|
|
|
|
|
# [201] |
3770
|
|
|
|
|
|
|
# seq-spaces(n,c) ::= |
3771
|
|
|
|
|
|
|
# ( c = block-out => n-1 ) |
3772
|
|
|
|
|
|
|
# ( c = block-in => n ) |
3773
|
|
|
|
|
|
|
|
3774
|
|
|
|
|
|
|
rule '201', seq_spaces => sub { |
3775
|
2
|
|
|
2
|
|
8
|
my ($self, $n, $c) = @_; |
3776
|
2
|
|
|
|
|
5
|
debug_rule("seq_spaces",$n,$c) if DEBUG; |
3777
|
2
|
|
|
|
|
11
|
$self->flip( |
3778
|
|
|
|
|
|
|
$c, |
3779
|
|
|
|
|
|
|
{ |
3780
|
|
|
|
|
|
|
'block-in' => $n, |
3781
|
|
|
|
|
|
|
'block-out' => $self->sub($n, 1), |
3782
|
|
|
|
|
|
|
} |
3783
|
|
|
|
|
|
|
); |
3784
|
|
|
|
|
|
|
}; |
3785
|
|
|
|
|
|
|
|
3786
|
|
|
|
|
|
|
|
3787
|
|
|
|
|
|
|
|
3788
|
|
|
|
|
|
|
# [202] |
3789
|
|
|
|
|
|
|
# l-document-prefix ::= |
3790
|
|
|
|
|
|
|
# c-byte-order-mark? l-comment* |
3791
|
|
|
|
|
|
|
|
3792
|
|
|
|
|
|
|
rule '202', l_document_prefix => sub { |
3793
|
4
|
|
|
4
|
|
12
|
my ($self) = @_; |
3794
|
4
|
|
|
|
|
6
|
debug_rule("l_document_prefix") if DEBUG; |
3795
|
4
|
|
|
|
|
17
|
$self->all( |
3796
|
|
|
|
|
|
|
$self->rep(0, 1, $self->func('c_byte_order_mark')), |
3797
|
|
|
|
|
|
|
$self->rep2(0, undef, $self->func('l_comment')) |
3798
|
|
|
|
|
|
|
); |
3799
|
|
|
|
|
|
|
}; |
3800
|
|
|
|
|
|
|
|
3801
|
|
|
|
|
|
|
|
3802
|
|
|
|
|
|
|
|
3803
|
|
|
|
|
|
|
# [203] |
3804
|
|
|
|
|
|
|
# c-directives-end ::= |
3805
|
|
|
|
|
|
|
# '-' '-' '-' |
3806
|
|
|
|
|
|
|
|
3807
|
|
|
|
|
|
|
rule '203', c_directives_end => sub { |
3808
|
4
|
|
|
4
|
|
11
|
my ($self) = @_; |
3809
|
4
|
|
|
|
|
8
|
debug_rule("c_directives_end") if DEBUG; |
3810
|
4
|
|
|
|
|
12
|
$self->all( |
3811
|
|
|
|
|
|
|
$self->chr('-'), |
3812
|
|
|
|
|
|
|
$self->chr('-'), |
3813
|
|
|
|
|
|
|
$self->chr('-'), |
3814
|
|
|
|
|
|
|
$self->chk( |
3815
|
|
|
|
|
|
|
'=', |
3816
|
|
|
|
|
|
|
$self->any( |
3817
|
|
|
|
|
|
|
$self->func('end_of_stream'), |
3818
|
|
|
|
|
|
|
$self->func('s_white'), |
3819
|
|
|
|
|
|
|
$self->func('b_break') |
3820
|
|
|
|
|
|
|
) |
3821
|
|
|
|
|
|
|
) |
3822
|
|
|
|
|
|
|
); |
3823
|
|
|
|
|
|
|
}; |
3824
|
|
|
|
|
|
|
|
3825
|
|
|
|
|
|
|
|
3826
|
|
|
|
|
|
|
|
3827
|
|
|
|
|
|
|
# [204] |
3828
|
|
|
|
|
|
|
# c-document-end ::= |
3829
|
|
|
|
|
|
|
# '.' '.' '.' |
3830
|
|
|
|
|
|
|
|
3831
|
|
|
|
|
|
|
rule '204', c_document_end => sub { |
3832
|
2
|
|
|
2
|
|
5
|
my ($self) = @_; |
3833
|
2
|
|
|
|
|
3
|
debug_rule("c_document_end") if DEBUG; |
3834
|
2
|
|
|
|
|
11
|
$self->all( |
3835
|
|
|
|
|
|
|
$self->chr('.'), |
3836
|
|
|
|
|
|
|
$self->chr('.'), |
3837
|
|
|
|
|
|
|
$self->chr('.') |
3838
|
|
|
|
|
|
|
); |
3839
|
|
|
|
|
|
|
}; |
3840
|
|
|
|
|
|
|
|
3841
|
|
|
|
|
|
|
|
3842
|
|
|
|
|
|
|
|
3843
|
|
|
|
|
|
|
# [205] |
3844
|
|
|
|
|
|
|
# l-document-suffix ::= |
3845
|
|
|
|
|
|
|
# c-document-end s-l-comments |
3846
|
|
|
|
|
|
|
|
3847
|
|
|
|
|
|
|
rule '205', l_document_suffix => sub { |
3848
|
2
|
|
|
2
|
|
6
|
my ($self) = @_; |
3849
|
2
|
|
|
|
|
3
|
debug_rule("l_document_suffix") if DEBUG; |
3850
|
2
|
|
|
|
|
10
|
$self->all( |
3851
|
|
|
|
|
|
|
$self->func('c_document_end'), |
3852
|
|
|
|
|
|
|
$self->func('s_l_comments') |
3853
|
|
|
|
|
|
|
); |
3854
|
|
|
|
|
|
|
}; |
3855
|
|
|
|
|
|
|
|
3856
|
|
|
|
|
|
|
|
3857
|
|
|
|
|
|
|
|
3858
|
|
|
|
|
|
|
# [206] |
3859
|
|
|
|
|
|
|
# c-forbidden ::= |
3860
|
|
|
|
|
|
|
# |
3861
|
|
|
|
|
|
|
# ( c-directives-end | c-document-end ) |
3862
|
|
|
|
|
|
|
# ( b-char | s-white | ) |
3863
|
|
|
|
|
|
|
|
3864
|
|
|
|
|
|
|
rule '206', c_forbidden => sub { |
3865
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
3866
|
0
|
|
|
|
|
0
|
debug_rule("c_forbidden") if DEBUG; |
3867
|
0
|
|
|
|
|
0
|
$self->all( |
3868
|
|
|
|
|
|
|
$self->func('start_of_line'), |
3869
|
|
|
|
|
|
|
$self->any( |
3870
|
|
|
|
|
|
|
$self->func('c_directives_end'), |
3871
|
|
|
|
|
|
|
$self->func('c_document_end') |
3872
|
|
|
|
|
|
|
), |
3873
|
|
|
|
|
|
|
$self->any( |
3874
|
|
|
|
|
|
|
$self->func('b_char'), |
3875
|
|
|
|
|
|
|
$self->func('s_white'), |
3876
|
|
|
|
|
|
|
$self->func('end_of_stream') |
3877
|
|
|
|
|
|
|
) |
3878
|
|
|
|
|
|
|
); |
3879
|
|
|
|
|
|
|
}; |
3880
|
|
|
|
|
|
|
|
3881
|
|
|
|
|
|
|
|
3882
|
|
|
|
|
|
|
|
3883
|
|
|
|
|
|
|
# [207] |
3884
|
|
|
|
|
|
|
# l-bare-document ::= |
3885
|
|
|
|
|
|
|
# s-l+block-node(-1,block-in) |
3886
|
|
|
|
|
|
|
# |
3887
|
|
|
|
|
|
|
|
3888
|
|
|
|
|
|
|
rule '207', l_bare_document => sub { |
3889
|
2
|
|
|
2
|
|
15
|
my ($self) = @_; |
3890
|
2
|
|
|
|
|
4
|
debug_rule("l_bare_document") if DEBUG; |
3891
|
2
|
|
|
|
|
9
|
$self->all( |
3892
|
|
|
|
|
|
|
$self->exclude($self->func('c_forbidden')), |
3893
|
|
|
|
|
|
|
[ $self->func('s_l_block_node'), -1, "block-in" ] |
3894
|
|
|
|
|
|
|
); |
3895
|
|
|
|
|
|
|
}; |
3896
|
|
|
|
|
|
|
|
3897
|
|
|
|
|
|
|
|
3898
|
|
|
|
|
|
|
|
3899
|
|
|
|
|
|
|
# [208] |
3900
|
|
|
|
|
|
|
# l-explicit-document ::= |
3901
|
|
|
|
|
|
|
# c-directives-end |
3902
|
|
|
|
|
|
|
# ( l-bare-document |
3903
|
|
|
|
|
|
|
# | ( e-node s-l-comments ) ) |
3904
|
|
|
|
|
|
|
|
3905
|
|
|
|
|
|
|
rule '208', l_explicit_document => sub { |
3906
|
4
|
|
|
4
|
|
10
|
my ($self) = @_; |
3907
|
4
|
|
|
|
|
16
|
debug_rule("l_explicit_document") if DEBUG; |
3908
|
4
|
|
|
|
|
15
|
$self->all( |
3909
|
|
|
|
|
|
|
$self->func('c_directives_end'), |
3910
|
|
|
|
|
|
|
$self->any( |
3911
|
|
|
|
|
|
|
$self->func('l_bare_document'), |
3912
|
|
|
|
|
|
|
$self->all( |
3913
|
|
|
|
|
|
|
$self->func('e_node'), |
3914
|
|
|
|
|
|
|
$self->func('s_l_comments') |
3915
|
|
|
|
|
|
|
) |
3916
|
|
|
|
|
|
|
) |
3917
|
|
|
|
|
|
|
); |
3918
|
|
|
|
|
|
|
}; |
3919
|
|
|
|
|
|
|
|
3920
|
|
|
|
|
|
|
|
3921
|
|
|
|
|
|
|
|
3922
|
|
|
|
|
|
|
# [209] |
3923
|
|
|
|
|
|
|
# l-directive-document ::= |
3924
|
|
|
|
|
|
|
# l-directive+ |
3925
|
|
|
|
|
|
|
# l-explicit-document |
3926
|
|
|
|
|
|
|
|
3927
|
|
|
|
|
|
|
rule '209', l_directive_document => sub { |
3928
|
2
|
|
|
2
|
|
4
|
my ($self) = @_; |
3929
|
2
|
|
|
|
|
4
|
debug_rule("l_directive_document") if DEBUG; |
3930
|
2
|
|
|
|
|
8
|
$self->all( |
3931
|
|
|
|
|
|
|
$self->rep(1, undef, $self->func('l_directive')), |
3932
|
|
|
|
|
|
|
$self->func('l_explicit_document') |
3933
|
|
|
|
|
|
|
); |
3934
|
|
|
|
|
|
|
}; |
3935
|
|
|
|
|
|
|
|
3936
|
|
|
|
|
|
|
|
3937
|
|
|
|
|
|
|
|
3938
|
|
|
|
|
|
|
# [210] |
3939
|
|
|
|
|
|
|
# l-any-document ::= |
3940
|
|
|
|
|
|
|
# l-directive-document |
3941
|
|
|
|
|
|
|
# | l-explicit-document |
3942
|
|
|
|
|
|
|
# | l-bare-document |
3943
|
|
|
|
|
|
|
|
3944
|
|
|
|
|
|
|
rule '210', l_any_document => sub { |
3945
|
2
|
|
|
2
|
|
10
|
my ($self) = @_; |
3946
|
2
|
|
|
|
|
3
|
debug_rule("l_any_document") if DEBUG; |
3947
|
2
|
|
|
|
|
8
|
$self->any( |
3948
|
|
|
|
|
|
|
$self->func('l_directive_document'), |
3949
|
|
|
|
|
|
|
$self->func('l_explicit_document'), |
3950
|
|
|
|
|
|
|
$self->func('l_bare_document') |
3951
|
|
|
|
|
|
|
); |
3952
|
|
|
|
|
|
|
}; |
3953
|
|
|
|
|
|
|
|
3954
|
|
|
|
|
|
|
|
3955
|
|
|
|
|
|
|
|
3956
|
|
|
|
|
|
|
# [211] |
3957
|
|
|
|
|
|
|
# l-yaml-stream ::= |
3958
|
|
|
|
|
|
|
# l-document-prefix* l-any-document? |
3959
|
|
|
|
|
|
|
# ( ( l-document-suffix+ l-document-prefix* |
3960
|
|
|
|
|
|
|
# l-any-document? ) |
3961
|
|
|
|
|
|
|
# | ( l-document-prefix* l-explicit-document? ) )* |
3962
|
|
|
|
|
|
|
|
3963
|
|
|
|
|
|
|
rule '211', l_yaml_stream => sub { |
3964
|
2
|
|
|
2
|
|
5
|
my ($self) = @_; |
3965
|
2
|
|
|
|
|
4
|
debug_rule("l_yaml_stream") if DEBUG; |
3966
|
2
|
|
|
|
|
8
|
$self->all( |
3967
|
|
|
|
|
|
|
$self->func('l_document_prefix'), |
3968
|
|
|
|
|
|
|
$self->rep(0, 1, $self->func('l_any_document')), |
3969
|
|
|
|
|
|
|
$self->rep2(0, undef, |
3970
|
|
|
|
|
|
|
$self->any( |
3971
|
|
|
|
|
|
|
$self->all( |
3972
|
|
|
|
|
|
|
$self->func('l_document_suffix'), |
3973
|
|
|
|
|
|
|
$self->rep(0, undef, $self->func('l_document_prefix')), |
3974
|
|
|
|
|
|
|
$self->rep2(0, 1, $self->func('l_any_document')) |
3975
|
|
|
|
|
|
|
), |
3976
|
|
|
|
|
|
|
$self->all( |
3977
|
|
|
|
|
|
|
$self->func('l_document_prefix'), |
3978
|
|
|
|
|
|
|
$self->rep(0, 1, $self->func('l_explicit_document')) |
3979
|
|
|
|
|
|
|
) |
3980
|
|
|
|
|
|
|
)) |
3981
|
|
|
|
|
|
|
); |
3982
|
|
|
|
|
|
|
}; |
3983
|
|
|
|
|
|
|
|
3984
|
|
|
|
|
|
|
|
3985
|
|
|
|
|
|
|
|
3986
|
|
|
|
|
|
|
1; |
3987
|
|
|
|
|
|
|
|
3988
|
|
|
|
|
|
|
|
3989
|
|
|
|
|
|
|
### |
3990
|
|
|
|
|
|
|
# This is a parser class. It has a parse() method and parsing primitives for |
3991
|
|
|
|
|
|
|
# the grammar. It calls methods in the receiver class, when a rule matches: |
3992
|
|
|
|
|
|
|
### |
3993
|
|
|
|
|
|
|
|
3994
|
2
|
|
|
2
|
|
34
|
use v5.12; |
|
2
|
|
|
|
|
8
|
|
3995
|
|
|
|
|
|
|
|
3996
|
|
|
|
|
|
|
package PerlYamlReferenceParserParser; |
3997
|
|
|
|
|
|
|
|
3998
|
2
|
|
|
2
|
|
14
|
use PerlYamlReferenceParserPrelude; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
286
|
|
3999
|
2
|
|
|
2
|
|
17
|
use PerlYamlReferenceParserGrammar; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
63
|
|
4000
|
|
|
|
|
|
|
|
4001
|
2
|
|
|
2
|
|
20
|
use base 'PerlYamlReferenceParserGrammar'; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
262
|
|
4002
|
|
|
|
|
|
|
|
4003
|
2
|
|
|
2
|
|
15
|
use constant TRACE => $ENV{TRACE}; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
11218
|
|
4004
|
|
|
|
|
|
|
|
4005
|
0
|
|
|
0
|
0
|
0
|
sub receiver { $_[0]->{receiver} } |
4006
|
|
|
|
|
|
|
|
4007
|
|
|
|
|
|
|
sub new { |
4008
|
2
|
|
|
2
|
0
|
8
|
my ($class, $receiver) = @_; |
4009
|
|
|
|
|
|
|
|
4010
|
2
|
|
|
|
|
11
|
my $self = bless { |
4011
|
|
|
|
|
|
|
receiver => $receiver, |
4012
|
|
|
|
|
|
|
pos => 0, |
4013
|
|
|
|
|
|
|
end => 0, |
4014
|
|
|
|
|
|
|
state => [], |
4015
|
|
|
|
|
|
|
trace_num => 0, |
4016
|
|
|
|
|
|
|
trace_line => 0, |
4017
|
|
|
|
|
|
|
trace_on => true, |
4018
|
|
|
|
|
|
|
trace_off => 0, |
4019
|
|
|
|
|
|
|
trace_info => ['', '', ''], |
4020
|
|
|
|
|
|
|
}, $class; |
4021
|
|
|
|
|
|
|
|
4022
|
2
|
|
|
|
|
30
|
$receiver->{parser} = $self; |
4023
|
|
|
|
|
|
|
|
4024
|
2
|
|
|
|
|
8
|
return $self; |
4025
|
|
|
|
|
|
|
} |
4026
|
|
|
|
|
|
|
|
4027
|
|
|
|
|
|
|
sub parse { |
4028
|
2
|
|
|
2
|
0
|
8
|
my ($self, $input) = @_; |
4029
|
2
|
|
|
|
|
9
|
$self->{input} = $input; |
4030
|
|
|
|
|
|
|
|
4031
|
2
|
|
|
|
|
10
|
$self->{end} = length $self->{input}; |
4032
|
|
|
|
|
|
|
|
4033
|
2
|
|
|
|
|
2
|
$self->{trace_on} = not $self->trace_start if TRACE; |
4034
|
|
|
|
|
|
|
|
4035
|
2
|
|
|
|
|
5
|
my $ok; |
4036
|
2
|
|
|
|
|
6
|
eval { |
4037
|
2
|
|
|
|
|
8
|
$ok = $self->call($self->func('TOP')); |
4038
|
2
|
|
|
|
|
15
|
$self->trace_flush; |
4039
|
|
|
|
|
|
|
}; |
4040
|
2
|
50
|
|
|
|
8
|
if ($@) { |
4041
|
0
|
|
|
|
|
0
|
$self->trace_flush; |
4042
|
0
|
|
|
|
|
0
|
die $@; |
4043
|
|
|
|
|
|
|
} |
4044
|
|
|
|
|
|
|
|
4045
|
2
|
50
|
|
|
|
5
|
die "Parser failed" if not $ok; |
4046
|
|
|
|
|
|
|
die "Parser finished before end of input" |
4047
|
2
|
50
|
|
|
|
20
|
if $self->{pos} < $self->{end}; |
4048
|
|
|
|
|
|
|
|
4049
|
2
|
|
|
|
|
6
|
return true; |
4050
|
|
|
|
|
|
|
} |
4051
|
|
|
|
|
|
|
|
4052
|
|
|
|
|
|
|
sub state_curr { |
4053
|
16526
|
|
|
16526
|
0
|
24411
|
my ($self) = @_; |
4054
|
16526
|
100
|
|
|
|
42720
|
$self->{state}[-1] || { |
4055
|
|
|
|
|
|
|
name => undef, |
4056
|
|
|
|
|
|
|
doc => false, |
4057
|
|
|
|
|
|
|
lvl => 0, |
4058
|
|
|
|
|
|
|
beg => 0, |
4059
|
|
|
|
|
|
|
end => 0, |
4060
|
|
|
|
|
|
|
m => undef, |
4061
|
|
|
|
|
|
|
t => undef, |
4062
|
|
|
|
|
|
|
}; |
4063
|
|
|
|
|
|
|
} |
4064
|
|
|
|
|
|
|
|
4065
|
|
|
|
|
|
|
sub state_prev { |
4066
|
4
|
|
|
4
|
0
|
9
|
my ($self) = @_; |
4067
|
4
|
|
|
|
|
8
|
$self->{state}[-2] |
4068
|
|
|
|
|
|
|
} |
4069
|
|
|
|
|
|
|
|
4070
|
|
|
|
|
|
|
sub state_push { |
4071
|
6486
|
|
|
6486
|
0
|
10306
|
my ($self, $name) = @_; |
4072
|
|
|
|
|
|
|
|
4073
|
6486
|
|
|
|
|
10855
|
my $curr = $self->state_curr; |
4074
|
|
|
|
|
|
|
|
4075
|
6486
|
|
|
|
|
28242
|
push @{$self->{state}}, { |
4076
|
|
|
|
|
|
|
name => $name, |
4077
|
|
|
|
|
|
|
doc => $curr->{doc}, |
4078
|
|
|
|
|
|
|
lvl => $curr->{lvl} + 1, |
4079
|
|
|
|
|
|
|
beg => $self->{pos}, |
4080
|
|
|
|
|
|
|
end => undef, |
4081
|
|
|
|
|
|
|
m => $curr->{m}, |
4082
|
|
|
|
|
|
|
t => $curr->{t}, |
4083
|
6486
|
|
|
|
|
9120
|
}; |
4084
|
|
|
|
|
|
|
} |
4085
|
|
|
|
|
|
|
|
4086
|
|
|
|
|
|
|
sub state_pop { |
4087
|
6486
|
|
|
6486
|
0
|
9625
|
my ($self) = @_; |
4088
|
6486
|
|
|
|
|
7440
|
my $child = pop @{$self->{state}}; |
|
6486
|
|
|
|
|
11005
|
|
4089
|
6486
|
|
|
|
|
10395
|
my $curr = $self->state_curr; |
4090
|
6486
|
50
|
|
|
|
11982
|
return unless defined $curr; |
4091
|
6486
|
|
|
|
|
10462
|
$curr->{beg} = $child->{beg}; |
4092
|
6486
|
|
|
|
|
15661
|
$curr->{end} = $self->{pos}; |
4093
|
|
|
|
|
|
|
} |
4094
|
|
|
|
|
|
|
|
4095
|
|
|
|
|
|
|
sub call { |
4096
|
6488
|
|
|
6488
|
0
|
10987
|
my ($self, $func, $type) = @_; |
4097
|
6488
|
|
100
|
|
|
22004
|
$type //= 'boolean'; |
4098
|
|
|
|
|
|
|
|
4099
|
6488
|
|
|
|
|
9655
|
my $args = []; |
4100
|
6488
|
100
|
|
|
|
11750
|
($func, @$args) = @$func if isArray $func; |
4101
|
|
|
|
|
|
|
|
4102
|
6488
|
100
|
66
|
|
|
11882
|
return $func if isNumber $func or isString $func; |
4103
|
|
|
|
|
|
|
|
4104
|
6486
|
50
|
|
|
|
12812
|
FAIL "Bad call type '${\ typeof $func}' for '$func'" |
|
0
|
|
|
|
|
0
|
|
4105
|
|
|
|
|
|
|
unless isFunction $func; |
4106
|
|
|
|
|
|
|
|
4107
|
6486
|
|
33
|
|
|
14803
|
my $trace = $func->{trace} //= $func->{name}; |
4108
|
|
|
|
|
|
|
|
4109
|
6486
|
|
|
|
|
14550
|
$self->state_push($trace); |
4110
|
|
|
|
|
|
|
|
4111
|
6486
|
|
|
|
|
10442
|
$self->{trace_num}++; |
4112
|
6486
|
|
|
|
|
7758
|
$self->trace('?', $trace, $args) if TRACE; |
4113
|
|
|
|
|
|
|
|
4114
|
6486
|
100
|
|
|
|
13384
|
if ($func->{name} eq 'l_bare_document') { |
4115
|
2
|
|
|
|
|
7
|
$self->state_curr->{doc} = true; |
4116
|
|
|
|
|
|
|
} |
4117
|
|
|
|
|
|
|
|
4118
|
|
|
|
|
|
|
@$args = map { |
4119
|
6486
|
|
|
|
|
11187
|
isArray($_) ? $self->call($_, 'any') : |
4120
|
774
|
100
|
|
|
|
1235
|
isFunction($_) ? $_->{func}->() : |
|
|
100
|
|
|
|
|
|
4121
|
|
|
|
|
|
|
$_; |
4122
|
|
|
|
|
|
|
} @$args; |
4123
|
|
|
|
|
|
|
|
4124
|
6486
|
|
|
|
|
9195
|
my $pos = $self->{pos}; |
4125
|
6486
|
|
|
|
|
14352
|
$self->receive($func, 'try', $pos); |
4126
|
|
|
|
|
|
|
|
4127
|
6486
|
|
|
|
|
15492
|
my $value = $func->{func}->($self, @$args); |
4128
|
6486
|
|
100
|
|
|
20197
|
while (isFunction($value) or isArray($value)) { |
4129
|
2448
|
|
|
|
|
5879
|
$value = $self->call($value); |
4130
|
|
|
|
|
|
|
} |
4131
|
|
|
|
|
|
|
|
4132
|
6486
|
50
|
66
|
|
|
15793
|
FAIL "Calling '$trace' returned '${\ typeof($value)}' instead of '$type'" |
|
0
|
|
|
|
|
0
|
|
4133
|
|
|
|
|
|
|
if $type ne 'any' and typeof($value) ne $type; |
4134
|
|
|
|
|
|
|
|
4135
|
6486
|
|
|
|
|
10072
|
$self->{trace_num}++; |
4136
|
6486
|
100
|
|
|
|
10939
|
if ($type ne 'boolean') { |
4137
|
24
|
|
|
|
|
37
|
$self->trace('>', $value) if TRACE; |
4138
|
|
|
|
|
|
|
} |
4139
|
|
|
|
|
|
|
else { |
4140
|
6462
|
100
|
|
|
|
12998
|
if ($value) { |
4141
|
1906
|
|
|
|
|
11720
|
$self->trace('+', $trace) if TRACE; |
4142
|
1906
|
|
|
|
|
3600
|
$self->receive($func, 'got', $pos); |
4143
|
|
|
|
|
|
|
} |
4144
|
|
|
|
|
|
|
else { |
4145
|
4556
|
|
|
|
|
28364
|
$self->trace('x', $trace) if TRACE; |
4146
|
4556
|
|
|
|
|
8141
|
$self->receive($func, 'not', $pos); |
4147
|
|
|
|
|
|
|
} |
4148
|
|
|
|
|
|
|
} |
4149
|
|
|
|
|
|
|
|
4150
|
6486
|
|
|
|
|
14092
|
$self->state_pop; |
4151
|
6486
|
|
|
|
|
34741
|
return $value; |
4152
|
|
|
|
|
|
|
} |
4153
|
|
|
|
|
|
|
|
4154
|
|
|
|
|
|
|
sub receive { |
4155
|
12948
|
|
|
12948
|
0
|
21969
|
my ($self, $func, $type, $pos) = @_; |
4156
|
|
|
|
|
|
|
|
4157
|
12948
|
|
66
|
|
|
31115
|
$func->{receivers} //= $self->make_receivers; |
4158
|
12948
|
|
|
|
|
20441
|
my $receiver = $func->{receivers}{$type}; |
4159
|
12948
|
100
|
|
|
|
27519
|
return unless $receiver; |
4160
|
|
|
|
|
|
|
|
4161
|
|
|
|
|
|
|
$receiver->($self->{receiver}, { |
4162
|
186
|
|
|
|
|
556
|
text => substr($self->{input}, $pos, $self->{pos}-$pos), |
4163
|
|
|
|
|
|
|
state => $self->state_curr, |
4164
|
|
|
|
|
|
|
start => $pos, |
4165
|
|
|
|
|
|
|
}); |
4166
|
|
|
|
|
|
|
} |
4167
|
|
|
|
|
|
|
|
4168
|
|
|
|
|
|
|
sub make_receivers { |
4169
|
6378
|
|
|
6378
|
0
|
9755
|
my ($self) = @_; |
4170
|
6378
|
|
|
|
|
7653
|
my $i = @{$self->{state}}; |
|
6378
|
|
|
|
|
9892
|
|
4171
|
6378
|
|
|
|
|
9833
|
my $names = []; |
4172
|
6378
|
|
|
|
|
9038
|
my $n; |
4173
|
6378
|
|
100
|
|
|
28849
|
while ($i > 0 and not(($n = $self->{state}[--$i]{name}) =~ /_/)) { |
4174
|
5760
|
100
|
|
|
|
13446
|
if ($n =~ /^chr\((.)\)$/) { |
4175
|
788
|
|
|
|
|
1719
|
$n = hex_char $1; |
4176
|
|
|
|
|
|
|
} |
4177
|
|
|
|
|
|
|
else { |
4178
|
4972
|
|
|
|
|
12286
|
$n =~ s/\(.*//; |
4179
|
|
|
|
|
|
|
} |
4180
|
5760
|
|
|
|
|
26544
|
unshift @$names, $n; |
4181
|
|
|
|
|
|
|
} |
4182
|
6378
|
|
|
|
|
15701
|
my $name = join '__', $n, @$names; |
4183
|
|
|
|
|
|
|
|
4184
|
|
|
|
|
|
|
return { |
4185
|
|
|
|
|
|
|
try => $self->{receiver}->can("try__$name"), |
4186
|
|
|
|
|
|
|
got => $self->{receiver}->can("got__$name"), |
4187
|
6378
|
|
|
|
|
68786
|
not => $self->{receiver}->can("not__$name"), |
4188
|
|
|
|
|
|
|
}; |
4189
|
|
|
|
|
|
|
} |
4190
|
|
|
|
|
|
|
|
4191
|
|
|
|
|
|
|
# Match all subrule methods: |
4192
|
|
|
|
|
|
|
sub all { |
4193
|
864
|
|
|
864
|
0
|
1982
|
my ($self, @funcs) = @_; |
4194
|
|
|
|
|
|
|
name all => sub { |
4195
|
754
|
|
|
754
|
|
1173
|
my $pos = $self->{pos}; |
4196
|
754
|
|
|
|
|
1436
|
for my $func (@funcs) { |
4197
|
1074
|
50
|
|
|
|
4007
|
FAIL '*** Missing function in @all group:', \@funcs |
4198
|
|
|
|
|
|
|
unless defined $func; |
4199
|
|
|
|
|
|
|
|
4200
|
1074
|
100
|
|
|
|
2359
|
if (not $self->call($func)) { |
4201
|
612
|
|
|
|
|
4138
|
$self->{pos} = $pos; |
4202
|
612
|
|
|
|
|
1099
|
return false; |
4203
|
|
|
|
|
|
|
} |
4204
|
|
|
|
|
|
|
} |
4205
|
|
|
|
|
|
|
|
4206
|
142
|
|
|
|
|
1133
|
return true; |
4207
|
864
|
|
|
|
|
3131
|
}; |
4208
|
|
|
|
|
|
|
} |
4209
|
|
|
|
|
|
|
|
4210
|
|
|
|
|
|
|
# Match any subrule method. Rules are tried in order and stops on first match: |
4211
|
|
|
|
|
|
|
sub any { |
4212
|
886
|
|
|
886
|
0
|
2220
|
my ($self, @funcs) = @_; |
4213
|
|
|
|
|
|
|
name any => sub { |
4214
|
818
|
|
|
818
|
|
1560
|
for my $func (@funcs) { |
4215
|
2042
|
100
|
|
|
|
10898
|
if ($self->call($func)) { |
4216
|
322
|
|
|
|
|
2409
|
return true; |
4217
|
|
|
|
|
|
|
} |
4218
|
|
|
|
|
|
|
} |
4219
|
|
|
|
|
|
|
|
4220
|
496
|
|
|
|
|
3822
|
return false; |
4221
|
886
|
|
|
|
|
3863
|
}; |
4222
|
|
|
|
|
|
|
} |
4223
|
|
|
|
|
|
|
|
4224
|
|
|
|
|
|
|
sub may { |
4225
|
6
|
|
|
6
|
0
|
16
|
my ($self, $func) = @_; |
4226
|
|
|
|
|
|
|
name may => sub { |
4227
|
6
|
|
|
6
|
|
18
|
$self->call($func); |
4228
|
6
|
|
|
|
|
22
|
}; |
4229
|
|
|
|
|
|
|
} |
4230
|
|
|
|
|
|
|
|
4231
|
|
|
|
|
|
|
# Repeat a rule a certain number of times: |
4232
|
|
|
|
|
|
|
sub rep { |
4233
|
492
|
|
|
492
|
0
|
981
|
my ($self, $min, $max, $func) = @_; |
4234
|
|
|
|
|
|
|
name rep => sub { |
4235
|
274
|
50
|
66
|
274
|
|
880
|
return false if defined $max and $max < 0; |
4236
|
274
|
|
|
|
|
406
|
my $count = 0; |
4237
|
274
|
|
|
|
|
403
|
my $pos = $self->{pos}; |
4238
|
274
|
|
|
|
|
362
|
my $pos_start = $pos; |
4239
|
274
|
|
100
|
|
|
838
|
while (not(defined $max) or $count < $max) { |
4240
|
312
|
100
|
|
|
|
729
|
last unless $self->call($func); |
4241
|
84
|
100
|
|
|
|
676
|
last if $self->{pos} == $pos; |
4242
|
80
|
|
|
|
|
122
|
$count++; |
4243
|
80
|
|
|
|
|
297
|
$pos = $self->{pos}; |
4244
|
|
|
|
|
|
|
} |
4245
|
274
|
50
|
66
|
|
|
2458
|
if ($count >= $min and (not(defined $max) or $count <= $max)) { |
|
|
|
66
|
|
|
|
|
4246
|
216
|
|
|
|
|
513
|
return true; |
4247
|
|
|
|
|
|
|
} |
4248
|
58
|
|
|
|
|
133
|
$self->{pos} = $pos_start; |
4249
|
58
|
|
|
|
|
138
|
return false; |
4250
|
492
|
|
100
|
|
|
2351
|
}, "rep($min,${\ ($max // 'null')})"; |
|
492
|
|
|
|
|
1975
|
|
4251
|
|
|
|
|
|
|
} |
4252
|
|
|
|
|
|
|
sub rep2 { |
4253
|
48
|
|
|
48
|
0
|
145
|
my ($self, $min, $max, $func) = @_; |
4254
|
|
|
|
|
|
|
name rep2 => sub { |
4255
|
22
|
50
|
66
|
22
|
|
113
|
return false if defined $max and $max < 0; |
4256
|
22
|
|
|
|
|
44
|
my $count = 0; |
4257
|
22
|
|
|
|
|
53
|
my $pos = $self->{pos}; |
4258
|
22
|
|
|
|
|
35
|
my $pos_start = $pos; |
4259
|
22
|
|
100
|
|
|
94
|
while (not(defined $max) or $count < $max) { |
4260
|
48
|
100
|
|
|
|
137
|
last unless $self->call($func); |
4261
|
36
|
100
|
|
|
|
299
|
last if $self->{pos} == $pos; |
4262
|
32
|
|
|
|
|
50
|
$count++; |
4263
|
32
|
|
|
|
|
95
|
$pos = $self->{pos}; |
4264
|
|
|
|
|
|
|
} |
4265
|
22
|
50
|
66
|
|
|
203
|
if ($count >= $min and (not(defined $max) or $count <= $max)) { |
|
|
|
66
|
|
|
|
|
4266
|
22
|
|
|
|
|
51
|
return true; |
4267
|
|
|
|
|
|
|
} |
4268
|
0
|
|
|
|
|
0
|
$self->{pos} = $pos_start; |
4269
|
0
|
|
|
|
|
0
|
return false; |
4270
|
48
|
|
100
|
|
|
240
|
}, "rep2($min,${\ ($max // 'null')})"; |
|
48
|
|
|
|
|
249
|
|
4271
|
|
|
|
|
|
|
} |
4272
|
|
|
|
|
|
|
|
4273
|
|
|
|
|
|
|
# Call a rule depending on state value: |
4274
|
|
|
|
|
|
|
sub case { |
4275
|
72
|
|
|
72
|
0
|
178
|
my ($self, $var, $map) = @_; |
4276
|
|
|
|
|
|
|
name case => sub { |
4277
|
72
|
|
|
72
|
|
172
|
my $rule = $map->{$var}; |
4278
|
72
|
50
|
|
|
|
177
|
defined $rule or |
4279
|
|
|
|
|
|
|
FAIL "Can't find '$var' in:", $map; |
4280
|
72
|
|
|
|
|
197
|
$self->call($rule); |
4281
|
72
|
|
|
|
|
419
|
}, "case($var,${\ stringify $map})"; |
|
72
|
|
|
|
|
161
|
|
4282
|
|
|
|
|
|
|
} |
4283
|
|
|
|
|
|
|
|
4284
|
|
|
|
|
|
|
# Call a rule depending on state value: |
4285
|
|
|
|
|
|
|
sub flip { |
4286
|
4
|
|
|
4
|
0
|
12
|
my ($self, $var, $map) = @_; |
4287
|
4
|
|
|
|
|
10
|
my $value = $map->{$var}; |
4288
|
4
|
50
|
|
|
|
13
|
defined $value or |
4289
|
|
|
|
|
|
|
FAIL "Can't find '$var' in:", $map; |
4290
|
4
|
50
|
|
|
|
22
|
return $value if not ref $value; |
4291
|
0
|
|
|
|
|
0
|
return $self->call($value, 'number'); |
4292
|
|
|
|
|
|
|
} |
4293
|
|
|
|
|
|
|
name flip => \&flip; |
4294
|
|
|
|
|
|
|
|
4295
|
|
|
|
|
|
|
sub the_end { |
4296
|
1894
|
|
|
1894
|
0
|
3265
|
my ($self) = @_; |
4297
|
|
|
|
|
|
|
return ( |
4298
|
|
|
|
|
|
|
$self->{pos} >= $self->{end} or ( |
4299
|
|
|
|
|
|
|
$self->state_curr->{doc} and |
4300
|
|
|
|
|
|
|
$self->start_of_line and |
4301
|
1894
|
|
66
|
|
|
6029
|
substr($self->{input}, $self->{pos}) =~ |
4302
|
|
|
|
|
|
|
/^(?:---|\.\.\.)(?=\s|\z)/ |
4303
|
|
|
|
|
|
|
) |
4304
|
|
|
|
|
|
|
); |
4305
|
|
|
|
|
|
|
} |
4306
|
|
|
|
|
|
|
|
4307
|
|
|
|
|
|
|
# Match a single char: |
4308
|
|
|
|
|
|
|
sub chr { |
4309
|
2004
|
|
|
2004
|
0
|
3994
|
my ($self, $char) = @_; |
4310
|
|
|
|
|
|
|
name chr => sub { |
4311
|
1640
|
100
|
|
1640
|
|
3615
|
return false if $self->the_end; |
4312
|
1554
|
50
|
100
|
|
|
28599
|
if ( |
|
|
|
66
|
|
|
|
|
|
|
|
33
|
|
|
|
|
4313
|
|
|
|
|
|
|
$self->{pos} >= $self->{end} or ( |
4314
|
|
|
|
|
|
|
$self->state_curr->{doc} and |
4315
|
|
|
|
|
|
|
$self->start_of_line and |
4316
|
|
|
|
|
|
|
substr($self->{input}, $self->{pos}) =~ |
4317
|
|
|
|
|
|
|
/^(?:---|\.\.\.)(?=\s|\z)/ |
4318
|
|
|
|
|
|
|
) |
4319
|
|
|
|
|
|
|
) { |
4320
|
0
|
|
|
|
|
0
|
return false; |
4321
|
|
|
|
|
|
|
} |
4322
|
1554
|
100
|
|
|
|
21195
|
if (substr($self->{input}, $self->{pos}, 1) eq $char) { |
4323
|
120
|
|
|
|
|
557
|
$self->{pos}++; |
4324
|
120
|
|
|
|
|
257
|
return true; |
4325
|
|
|
|
|
|
|
} |
4326
|
1434
|
|
|
|
|
2699
|
return false; |
4327
|
2004
|
|
|
|
|
7275
|
}, "chr(${\ stringify($char)})"; |
|
2004
|
|
|
|
|
3969
|
|
4328
|
|
|
|
|
|
|
} |
4329
|
|
|
|
|
|
|
|
4330
|
|
|
|
|
|
|
# Match a char in a range: |
4331
|
|
|
|
|
|
|
sub rng { |
4332
|
330
|
|
|
330
|
0
|
711
|
my ($self, $low, $high) = @_; |
4333
|
|
|
|
|
|
|
name rng => sub { |
4334
|
78
|
50
|
|
78
|
|
227
|
return false if $self->the_end; |
4335
|
78
|
100
|
66
|
|
|
1683
|
if ( |
4336
|
|
|
|
|
|
|
$low le substr($self->{input}, $self->{pos}, 1) and |
4337
|
|
|
|
|
|
|
substr($self->{input}, $self->{pos}, 1) le $high |
4338
|
|
|
|
|
|
|
) { |
4339
|
76
|
|
|
|
|
122
|
$self->{pos}++; |
4340
|
76
|
|
|
|
|
164
|
return true; |
4341
|
|
|
|
|
|
|
} |
4342
|
2
|
|
|
|
|
9
|
return false; |
4343
|
330
|
|
|
|
|
1254
|
}, "rng(${\ stringify($low)},${\ stringify($high)})"; |
|
330
|
|
|
|
|
617
|
|
|
330
|
|
|
|
|
585
|
|
4344
|
|
|
|
|
|
|
} |
4345
|
|
|
|
|
|
|
|
4346
|
|
|
|
|
|
|
# Must match first rule but none of others: |
4347
|
|
|
|
|
|
|
sub but { |
4348
|
176
|
|
|
176
|
0
|
486
|
my ($self, @funcs) = @_; |
4349
|
|
|
|
|
|
|
name but => sub { |
4350
|
176
|
100
|
|
176
|
|
431
|
return false if $self->the_end; |
4351
|
174
|
|
|
|
|
3022
|
my $pos1 = $self->{pos}; |
4352
|
174
|
100
|
|
|
|
418
|
return false unless $self->call($funcs[0]); |
4353
|
166
|
|
|
|
|
1135
|
my $pos2 = $self->{pos}; |
4354
|
166
|
|
|
|
|
248
|
$self->{pos} = $pos1; |
4355
|
166
|
|
|
|
|
501
|
for my $func (@funcs[1..$#funcs]) { |
4356
|
250
|
100
|
|
|
|
993
|
if ($self->call($func)) { |
4357
|
24
|
|
|
|
|
214
|
$self->{pos} = $pos1; |
4358
|
24
|
|
|
|
|
59
|
return false; |
4359
|
|
|
|
|
|
|
} |
4360
|
|
|
|
|
|
|
} |
4361
|
142
|
|
|
|
|
1098
|
$self->{pos} = $pos2; |
4362
|
142
|
|
|
|
|
293
|
return true; |
4363
|
|
|
|
|
|
|
} |
4364
|
176
|
|
|
|
|
965
|
} |
4365
|
|
|
|
|
|
|
|
4366
|
|
|
|
|
|
|
sub chk { |
4367
|
84
|
|
|
84
|
0
|
236
|
my ($self, $type, $expr) = @_; |
4368
|
|
|
|
|
|
|
name chk => sub { |
4369
|
20
|
|
|
20
|
|
48
|
my $pos = $self->{pos}; |
4370
|
20
|
100
|
|
|
|
60
|
$self->{pos}-- if $type eq '<='; |
4371
|
20
|
|
|
|
|
48
|
my $ok = $self->call($expr); |
4372
|
20
|
|
|
|
|
36
|
$self->{pos} = $pos; |
4373
|
20
|
50
|
|
|
|
66
|
return $type eq '!' ? not($ok) : $ok; |
4374
|
84
|
|
|
|
|
386
|
}, "chk($type, ${\ stringify $expr})"; |
|
84
|
|
|
|
|
178
|
|
4375
|
|
|
|
|
|
|
} |
4376
|
|
|
|
|
|
|
|
4377
|
|
|
|
|
|
|
sub set { |
4378
|
10
|
|
|
10
|
0
|
26
|
my ($self, $var, $expr) = @_; |
4379
|
|
|
|
|
|
|
name set => sub { |
4380
|
4
|
|
|
4
|
|
14
|
my $value = $self->call($expr, 'any'); |
4381
|
4
|
50
|
|
|
|
18
|
return false if $value == -1; |
4382
|
4
|
50
|
|
|
|
13
|
$value = $self->auto_detect if $value eq 'auto-detect'; |
4383
|
4
|
|
|
|
|
8
|
my $state = $self->state_prev; |
4384
|
4
|
|
|
|
|
10
|
$state->{$var} = $value; |
4385
|
4
|
50
|
|
|
|
13
|
if ($state->{name} ne 'all') { |
4386
|
4
|
|
|
|
|
8
|
my $size = @{$self->{state}}; |
|
4
|
|
|
|
|
9
|
|
4387
|
4
|
|
|
|
|
12
|
for (my $i = 3; $i < $size; $i++) { |
4388
|
44
|
50
|
|
|
|
77
|
FAIL "failed to traverse state stack in 'set'" |
4389
|
|
|
|
|
|
|
if $i > $size - 2; |
4390
|
44
|
|
|
|
|
61
|
$state = $self->{state}[0 - $i]; |
4391
|
44
|
|
|
|
|
73
|
$state->{$var} = $value; |
4392
|
44
|
100
|
|
|
|
93
|
last if $state->{name} eq 's_l_block_scalar'; |
4393
|
|
|
|
|
|
|
} |
4394
|
|
|
|
|
|
|
} |
4395
|
4
|
|
|
|
|
14
|
return true; |
4396
|
10
|
|
|
|
|
59
|
}, "set('$var', ${\ stringify $expr})"; |
|
10
|
|
|
|
|
27
|
|
4397
|
|
|
|
|
|
|
} |
4398
|
|
|
|
|
|
|
|
4399
|
|
|
|
|
|
|
sub max { |
4400
|
20
|
|
|
20
|
0
|
49
|
my ($self, $max) = @_; |
4401
|
|
|
|
|
|
|
name max => sub { |
4402
|
20
|
|
|
20
|
|
58
|
return true; |
4403
|
20
|
|
|
|
|
92
|
}; |
4404
|
|
|
|
|
|
|
} |
4405
|
|
|
|
|
|
|
|
4406
|
|
|
|
|
|
|
sub exclude { |
4407
|
2
|
|
|
2
|
0
|
7
|
my ($self, $rule) = @_; |
4408
|
|
|
|
|
|
|
name exclude => sub { |
4409
|
2
|
|
|
2
|
|
8
|
return true; |
4410
|
2
|
|
|
|
|
10
|
}; |
4411
|
|
|
|
|
|
|
} |
4412
|
|
|
|
|
|
|
|
4413
|
|
|
|
|
|
|
sub add { |
4414
|
48
|
|
|
48
|
0
|
98
|
my ($self, $x, $y) = @_; |
4415
|
|
|
|
|
|
|
name add => sub { |
4416
|
42
|
100
|
|
42
|
|
85
|
$y = $self->call($y, 'number') if isFunction $y; |
4417
|
42
|
50
|
|
|
|
90
|
FAIL "y is '${\ stringify $y}', not number in 'add'" |
|
0
|
|
|
|
|
0
|
|
4418
|
|
|
|
|
|
|
unless isNumber $y; |
4419
|
42
|
|
|
|
|
148
|
return $x + $y; |
4420
|
48
|
|
|
|
|
217
|
}, "add($x,${\ stringify $y})"; |
|
48
|
|
|
|
|
109
|
|
4421
|
|
|
|
|
|
|
} |
4422
|
|
|
|
|
|
|
|
4423
|
|
|
|
|
|
|
sub sub { |
4424
|
2
|
|
|
2
|
0
|
7
|
my ($self, $x, $y) = @_; |
4425
|
|
|
|
|
|
|
name sub => sub { |
4426
|
0
|
|
|
0
|
|
0
|
return $x - $y; |
4427
|
2
|
|
|
|
|
18
|
}, "sub($x,$y)"; |
4428
|
|
|
|
|
|
|
} |
4429
|
|
|
|
|
|
|
|
4430
|
|
|
|
|
|
|
# This method does not need to return a function since it is never |
4431
|
|
|
|
|
|
|
# called in the grammar. |
4432
|
|
|
|
|
|
|
sub match { |
4433
|
6
|
|
|
6
|
0
|
15
|
my ($self) = @_; |
4434
|
6
|
|
|
|
|
10
|
my $state = $self->{state}; |
4435
|
6
|
|
|
|
|
16
|
my $i = @$state - 1; |
4436
|
6
|
|
66
|
|
|
34
|
while ($i > 0 && not defined $state->[$i]{end}) { |
4437
|
18
|
50
|
|
|
|
39
|
FAIL "Can't find match" if $i == 1; |
4438
|
18
|
|
|
|
|
48
|
$i--; |
4439
|
|
|
|
|
|
|
} |
4440
|
|
|
|
|
|
|
|
4441
|
6
|
|
|
|
|
14
|
my ($beg, $end) = @{$self->{state}[$i]}{qw}; |
|
6
|
|
|
|
|
20
|
|
4442
|
6
|
|
|
|
|
39
|
return substr($self->{input}, $beg, ($end - $beg)); |
4443
|
|
|
|
|
|
|
} |
4444
|
|
|
|
|
|
|
name match => \&match; |
4445
|
|
|
|
|
|
|
|
4446
|
|
|
|
|
|
|
sub len { |
4447
|
6
|
|
|
6
|
0
|
13
|
my ($self, $str) = @_; |
4448
|
|
|
|
|
|
|
name len => sub { |
4449
|
6
|
50
|
|
6
|
|
15
|
$str = $self->call($str, 'string') unless isString($str); |
4450
|
6
|
|
|
|
|
20
|
return length $str; |
4451
|
6
|
|
|
|
|
139
|
}; |
4452
|
|
|
|
|
|
|
} |
4453
|
|
|
|
|
|
|
|
4454
|
|
|
|
|
|
|
sub ord { |
4455
|
2
|
|
|
2
|
0
|
7
|
my ($self, $str) = @_; |
4456
|
|
|
|
|
|
|
name ord => sub { |
4457
|
|
|
|
|
|
|
# Should be `$self->call($str, 'string')`, but... Perl |
4458
|
0
|
0
|
|
0
|
|
0
|
$str = $self->call($str, 'number') unless isString($str); |
4459
|
0
|
|
|
|
|
0
|
return ord($str) - 48; |
4460
|
2
|
|
|
|
|
13
|
}; |
4461
|
|
|
|
|
|
|
} |
4462
|
|
|
|
|
|
|
|
4463
|
|
|
|
|
|
|
sub if { |
4464
|
10
|
|
|
10
|
0
|
25
|
my ($self, $test, $do_if_true) = @_; |
4465
|
|
|
|
|
|
|
name if => sub { |
4466
|
10
|
50
|
|
10
|
|
22
|
$test = $self->call($test, 'boolean') unless isBoolean $test; |
4467
|
10
|
100
|
|
|
|
38
|
if ($test) { |
4468
|
4
|
|
|
|
|
32
|
$self->call($do_if_true); |
4469
|
4
|
|
|
|
|
11
|
return true; |
4470
|
|
|
|
|
|
|
} |
4471
|
6
|
|
|
|
|
48
|
return false; |
4472
|
10
|
|
|
|
|
45
|
}; |
4473
|
|
|
|
|
|
|
} |
4474
|
|
|
|
|
|
|
|
4475
|
|
|
|
|
|
|
sub lt { |
4476
|
4
|
|
|
4
|
0
|
13
|
my ($self, $x, $y) = @_; |
4477
|
|
|
|
|
|
|
name lt => sub { |
4478
|
4
|
50
|
|
4
|
|
12
|
$x = $self->call($x, 'number') unless isNumber($x); |
4479
|
4
|
50
|
|
|
|
19
|
$y = $self->call($y, 'number') unless isNumber($y); |
4480
|
4
|
50
|
|
|
|
19
|
return $x < $y ? true : false; |
4481
|
4
|
|
|
|
|
22
|
}, "lt(${\ stringify $x},${\ stringify $y})"; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
11
|
|
4482
|
|
|
|
|
|
|
} |
4483
|
|
|
|
|
|
|
|
4484
|
|
|
|
|
|
|
sub le { |
4485
|
2
|
|
|
2
|
0
|
8
|
my ($self, $x, $y) = @_; |
4486
|
|
|
|
|
|
|
name le => sub { |
4487
|
2
|
50
|
|
2
|
|
6
|
$x = $self->call($x, 'number') unless isNumber($x); |
4488
|
2
|
50
|
|
|
|
9
|
$y = $self->call($y, 'number') unless isNumber($y); |
4489
|
2
|
50
|
|
|
|
11
|
return $x <= $y ? true : false; |
4490
|
2
|
|
|
|
|
9
|
}, "le(${\ stringify $x},${\ stringify $y})"; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
6
|
|
4491
|
|
|
|
|
|
|
} |
4492
|
|
|
|
|
|
|
|
4493
|
|
|
|
|
|
|
sub m { |
4494
|
10
|
|
|
10
|
0
|
21
|
my ($self) = @_; |
4495
|
|
|
|
|
|
|
name m => sub { |
4496
|
2
|
|
|
2
|
|
8
|
$self->state_curr->{m}; |
4497
|
10
|
|
|
|
|
43
|
}; |
4498
|
|
|
|
|
|
|
} |
4499
|
|
|
|
|
|
|
|
4500
|
|
|
|
|
|
|
sub t { |
4501
|
10
|
|
|
10
|
0
|
24
|
my ($self) = @_; |
4502
|
|
|
|
|
|
|
name t => sub { |
4503
|
2
|
|
|
2
|
|
8
|
$self->state_curr->{t}; |
4504
|
10
|
|
|
|
|
35
|
}; |
4505
|
|
|
|
|
|
|
} |
4506
|
|
|
|
|
|
|
|
4507
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
4508
|
|
|
|
|
|
|
# Special grammar rules |
4509
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
4510
|
|
|
|
|
|
|
sub start_of_line { |
4511
|
3364
|
|
|
3364
|
0
|
25270
|
my ($self) = @_; |
4512
|
|
|
|
|
|
|
( |
4513
|
|
|
|
|
|
|
$self->{pos} == 0 || |
4514
|
|
|
|
|
|
|
$self->{pos} >= $self->{end} || |
4515
|
3364
|
100
|
100
|
|
|
17688
|
substr($self->{input}, $self->{pos} - 1, 1) eq "\n" |
4516
|
|
|
|
|
|
|
) ? true : false; |
4517
|
|
|
|
|
|
|
} |
4518
|
|
|
|
|
|
|
name 'start_of_line', \&start_of_line; |
4519
|
|
|
|
|
|
|
|
4520
|
|
|
|
|
|
|
sub end_of_stream { |
4521
|
34
|
|
|
34
|
0
|
84
|
my ($self) = @_; |
4522
|
34
|
100
|
|
|
|
176
|
($self->{pos} >= $self->{end}) ? true : false; |
4523
|
|
|
|
|
|
|
} |
4524
|
|
|
|
|
|
|
name 'end_of_stream', \&end_of_stream; |
4525
|
|
|
|
|
|
|
|
4526
|
10
|
|
|
10
|
0
|
43
|
sub empty { true } |
4527
|
|
|
|
|
|
|
name 'empty', \∅ |
4528
|
|
|
|
|
|
|
|
4529
|
|
|
|
|
|
|
sub auto_detect_indent { |
4530
|
4
|
|
|
4
|
0
|
9
|
my ($self, $n) = @_; |
4531
|
4
|
|
|
|
|
9
|
my $pos = $self->{pos}; |
4532
|
4
|
|
33
|
|
|
29
|
my $in_seq = ($pos > 0 && substr($self->{input}, $pos - 1, 1) =~ /^[\-\?\:]$/); |
4533
|
4
|
50
|
|
|
|
28
|
substr($self->{input}, $pos) =~ /^ |
4534
|
|
|
|
|
|
|
( |
4535
|
|
|
|
|
|
|
(?: |
4536
|
|
|
|
|
|
|
\ * |
4537
|
|
|
|
|
|
|
(?:\#.*)? |
4538
|
|
|
|
|
|
|
\n |
4539
|
|
|
|
|
|
|
)* |
4540
|
|
|
|
|
|
|
) |
4541
|
|
|
|
|
|
|
(\ *) |
4542
|
|
|
|
|
|
|
/x or FAIL "auto_detect_indent"; |
4543
|
4
|
|
|
|
|
12
|
my $pre = $1; |
4544
|
4
|
|
|
|
|
9
|
my $m = length($2); |
4545
|
4
|
50
|
33
|
|
|
14
|
if ($in_seq and not length $pre) { |
4546
|
0
|
0
|
|
|
|
0
|
$m++ if $n == -1; |
4547
|
|
|
|
|
|
|
} |
4548
|
|
|
|
|
|
|
else { |
4549
|
4
|
|
|
|
|
8
|
$m -= $n; |
4550
|
|
|
|
|
|
|
} |
4551
|
4
|
50
|
|
|
|
9
|
$m = 0 if $m < 0; |
4552
|
4
|
|
|
|
|
10
|
return $m; |
4553
|
|
|
|
|
|
|
} |
4554
|
|
|
|
|
|
|
name 'auto_detect_indent', \&auto_detect_indent; |
4555
|
|
|
|
|
|
|
|
4556
|
|
|
|
|
|
|
sub auto_detect { |
4557
|
2
|
|
|
2
|
0
|
7
|
my ($self, $n) = @_; |
4558
|
2
|
50
|
|
|
|
26
|
substr($self->{input}, $self->{pos}) =~ /^.*\n((?:\ *\n)*)(\ *)/ |
4559
|
|
|
|
|
|
|
or return 1; |
4560
|
2
|
|
|
|
|
8
|
my $pre = $1; |
4561
|
2
|
|
|
|
|
7
|
my $m = length($2) - $n; |
4562
|
2
|
50
|
|
|
|
8
|
$m = 1 if $m < 1; |
4563
|
|
|
|
|
|
|
# XXX change 'die' to 'error' for reporting parse errors |
4564
|
2
|
50
|
|
|
|
41
|
die "Spaces found after indent in auto-detect (5LLU)" |
4565
|
|
|
|
|
|
|
if $pre =~ /^.{$m}./m; |
4566
|
2
|
|
|
|
|
9
|
return $m; |
4567
|
|
|
|
|
|
|
} |
4568
|
|
|
|
|
|
|
name 'auto_detect', \&auto_detect; |
4569
|
|
|
|
|
|
|
|
4570
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
4571
|
|
|
|
|
|
|
# Trace debugging |
4572
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
4573
|
|
|
|
|
|
|
sub trace_start { |
4574
|
0
|
|
|
0
|
0
|
0
|
'' || "$ENV{TRACE_START}"; |
4575
|
|
|
|
|
|
|
} |
4576
|
|
|
|
|
|
|
|
4577
|
|
|
|
|
|
|
sub trace_quiet { |
4578
|
0
|
0
|
|
0
|
0
|
0
|
return [] if $ENV{DEBUG}; |
4579
|
|
|
|
|
|
|
|
4580
|
0
|
|
|
|
|
0
|
my @small = ( |
4581
|
|
|
|
|
|
|
'b_as_line_feed', |
4582
|
|
|
|
|
|
|
's_indent', |
4583
|
|
|
|
|
|
|
'nb_char', |
4584
|
|
|
|
|
|
|
); |
4585
|
|
|
|
|
|
|
|
4586
|
0
|
|
|
|
|
0
|
my @noisy = ( |
4587
|
|
|
|
|
|
|
'c_directives_end', |
4588
|
|
|
|
|
|
|
'c_l_folded', |
4589
|
|
|
|
|
|
|
'c_l_literal', |
4590
|
|
|
|
|
|
|
'c_ns_alias_node', |
4591
|
|
|
|
|
|
|
'c_ns_anchor_property', |
4592
|
|
|
|
|
|
|
'c_ns_tag_property', |
4593
|
|
|
|
|
|
|
'l_directive_document', |
4594
|
|
|
|
|
|
|
'l_document_prefix', |
4595
|
|
|
|
|
|
|
'ns_flow_content', |
4596
|
|
|
|
|
|
|
'ns_plain', |
4597
|
|
|
|
|
|
|
's_l_comments', |
4598
|
|
|
|
|
|
|
's_separate', |
4599
|
|
|
|
|
|
|
); |
4600
|
|
|
|
|
|
|
|
4601
|
|
|
|
|
|
|
return [ |
4602
|
0
|
|
0
|
|
|
0
|
split(',', ($ENV{TRACE_QUIET} || '')), |
4603
|
|
|
|
|
|
|
@noisy, |
4604
|
|
|
|
|
|
|
]; |
4605
|
|
|
|
|
|
|
} |
4606
|
|
|
|
|
|
|
|
4607
|
|
|
|
|
|
|
sub trace { |
4608
|
0
|
|
|
0
|
0
|
0
|
my ($self, $type, $call, $args) = @_; |
4609
|
0
|
|
0
|
|
|
0
|
$args //= []; |
4610
|
|
|
|
|
|
|
|
4611
|
0
|
0
|
|
|
|
0
|
$call = "'$call'" if $call =~ /^($| |.* $)/; |
4612
|
0
|
0
|
0
|
|
|
0
|
return unless $self->{trace_on} or $call eq $self->trace_start; |
4613
|
|
|
|
|
|
|
|
4614
|
0
|
|
|
|
|
0
|
my $level = $self->state_curr->{lvl}; |
4615
|
0
|
|
|
|
|
0
|
my $indent = ' ' x $level; |
4616
|
0
|
0
|
|
|
|
0
|
if ($level > 0) { |
4617
|
0
|
|
|
|
|
0
|
my $l = length "$level"; |
4618
|
0
|
|
|
|
|
0
|
$indent = "$level" . substr($indent, $l); |
4619
|
|
|
|
|
|
|
} |
4620
|
|
|
|
|
|
|
|
4621
|
0
|
|
|
|
|
0
|
my $input = substr($self->{input}, $self->{pos}); |
4622
|
0
|
0
|
|
|
|
0
|
$input = substr($input, 0, 30) . '…' |
4623
|
|
|
|
|
|
|
if length($input) > 30; |
4624
|
0
|
|
|
|
|
0
|
$input =~ s/\t/\\t/g; |
4625
|
0
|
|
|
|
|
0
|
$input =~ s/\r/\\r/g; |
4626
|
0
|
|
|
|
|
0
|
$input =~ s/\n/\\n/g; |
4627
|
|
|
|
|
|
|
|
4628
|
|
|
|
|
|
|
my $line = sprintf( |
4629
|
|
|
|
|
|
|
"%s%s %-40s %4d '%s'\n", |
4630
|
|
|
|
|
|
|
$indent, |
4631
|
|
|
|
|
|
|
$type, |
4632
|
|
|
|
|
|
|
$self->trace_format_call($call, $args), |
4633
|
|
|
|
|
|
|
$self->{pos}, |
4634
|
0
|
|
|
|
|
0
|
$input, |
4635
|
|
|
|
|
|
|
); |
4636
|
|
|
|
|
|
|
|
4637
|
0
|
0
|
|
|
|
0
|
if ($ENV{DEBUG}) { |
4638
|
|
|
|
|
|
|
warn sprintf "%6d %s", |
4639
|
0
|
|
|
|
|
0
|
$self->{trace_num}, $line; |
4640
|
0
|
|
|
|
|
0
|
return; |
4641
|
|
|
|
|
|
|
} |
4642
|
|
|
|
|
|
|
|
4643
|
0
|
|
|
|
|
0
|
my $trace_info = undef; |
4644
|
0
|
|
|
|
|
0
|
$level = "${level}_$call"; |
4645
|
0
|
0
|
0
|
|
|
0
|
if ($type eq '?' and not $self->{trace_off}) { |
4646
|
0
|
|
|
|
|
0
|
$trace_info = [$type, $level, $line, $self->{trace_num}]; |
4647
|
|
|
|
|
|
|
} |
4648
|
0
|
0
|
|
|
|
0
|
if (grep $_ eq $call, @{$self->trace_quiet}) { |
|
0
|
|
|
|
|
0
|
|
4649
|
0
|
0
|
|
|
|
0
|
$self->{trace_off} += $type eq '?' ? 1 : -1; |
4650
|
|
|
|
|
|
|
} |
4651
|
0
|
0
|
0
|
|
|
0
|
if ($type ne '?' and not $self->{trace_off}) { |
4652
|
0
|
|
|
|
|
0
|
$trace_info = [$type, $level, $line, $self->{trace_num}]; |
4653
|
|
|
|
|
|
|
} |
4654
|
|
|
|
|
|
|
|
4655
|
0
|
0
|
|
|
|
0
|
if (defined $trace_info) { |
4656
|
|
|
|
|
|
|
my ($prev_type, $prev_level, $prev_line, $trace_num) = |
4657
|
0
|
|
|
|
|
0
|
@{$self->{trace_info}}; |
|
0
|
|
|
|
|
0
|
|
4658
|
0
|
0
|
0
|
|
|
0
|
if ($prev_type eq '?' and $prev_level eq $level) { |
4659
|
0
|
|
|
|
|
0
|
$trace_info->[1] = ''; |
4660
|
0
|
0
|
|
|
|
0
|
if ($line =~ /^\d*\ *\+/) { |
4661
|
0
|
|
|
|
|
0
|
$prev_line =~ s/\?/=/; |
4662
|
|
|
|
|
|
|
} |
4663
|
|
|
|
|
|
|
else { |
4664
|
0
|
|
|
|
|
0
|
$prev_line =~ s/\?/!/; |
4665
|
|
|
|
|
|
|
} |
4666
|
|
|
|
|
|
|
} |
4667
|
0
|
0
|
|
|
|
0
|
if ($prev_level) { |
4668
|
|
|
|
|
|
|
warn sprintf "%5d %6d %s", |
4669
|
0
|
|
|
|
|
0
|
++$self->{trace_line}, $trace_num, $prev_line; |
4670
|
|
|
|
|
|
|
} |
4671
|
|
|
|
|
|
|
|
4672
|
0
|
|
|
|
|
0
|
$self->{trace_info} = $trace_info; |
4673
|
|
|
|
|
|
|
} |
4674
|
|
|
|
|
|
|
|
4675
|
0
|
0
|
|
|
|
0
|
if ($call eq $self->trace_start) { |
4676
|
0
|
|
|
|
|
0
|
$self->{trace_on} = not $self->{trace_on}; |
4677
|
|
|
|
|
|
|
} |
4678
|
|
|
|
|
|
|
} |
4679
|
|
|
|
|
|
|
|
4680
|
|
|
|
|
|
|
sub trace_format_call { |
4681
|
0
|
|
|
0
|
0
|
0
|
my ($self, $call, $args) = @_; |
4682
|
0
|
0
|
|
|
|
0
|
return $call unless @$args; |
4683
|
0
|
|
|
|
|
0
|
my $list = join ',', map stringify($_), @$args; |
4684
|
0
|
|
|
|
|
0
|
return "$call($list)"; |
4685
|
|
|
|
|
|
|
} |
4686
|
|
|
|
|
|
|
|
4687
|
|
|
|
|
|
|
sub trace_flush { |
4688
|
2
|
|
|
2
|
0
|
4
|
my ($self) = @_; |
4689
|
2
|
|
|
|
|
5
|
my ($type, $level, $line, $count) = @{$self->{trace_info}}; |
|
2
|
|
|
|
|
8
|
|
4690
|
2
|
50
|
|
|
|
12
|
if (my $line = $self->{trace_info}[2]) { |
4691
|
|
|
|
|
|
|
warn sprintf "%5d %6d %s", |
4692
|
0
|
|
|
|
|
0
|
++$self->{trace_line}, $count, $line; |
4693
|
|
|
|
|
|
|
} |
4694
|
|
|
|
|
|
|
} |
4695
|
|
|
|
|
|
|
|
4696
|
|
|
|
|
|
|
1; |
4697
|
|
|
|
|
|
|
|
4698
|
|
|
|
|
|
|
# vim: sw=2: |
4699
|
|
|
|
|
|
|
|
4700
|
|
|
|
|
|
|
|
4701
|
2
|
|
|
2
|
|
29
|
use v5.12; |
|
2
|
|
|
|
|
8
|
|
4702
|
|
|
|
|
|
|
package PerlYamlReferenceParserReceiver; |
4703
|
2
|
|
|
2
|
|
22
|
use PerlYamlReferenceParserPrelude; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
8249
|
|
4704
|
|
|
|
|
|
|
|
4705
|
|
|
|
|
|
|
sub stream_start_event { |
4706
|
2
|
|
|
2
|
|
12
|
{ event => 'stream_start' }; |
4707
|
|
|
|
|
|
|
} |
4708
|
|
|
|
|
|
|
sub stream_end_event { |
4709
|
2
|
|
|
2
|
|
11
|
{ event => 'stream_end' }; |
4710
|
|
|
|
|
|
|
} |
4711
|
|
|
|
|
|
|
sub document_start_event { |
4712
|
4
|
|
33
|
4
|
|
22
|
{ event => 'document_start', explicit => (shift || false), version => undef }; |
4713
|
|
|
|
|
|
|
} |
4714
|
|
|
|
|
|
|
sub document_end_event { |
4715
|
2
|
|
33
|
2
|
|
14
|
{ event => 'document_end', explicit => (shift || false) }; |
4716
|
|
|
|
|
|
|
} |
4717
|
|
|
|
|
|
|
sub mapping_start_event { |
4718
|
6
|
|
66
|
6
|
|
41
|
{ event => 'mapping_start', flow => (shift || false) }; |
4719
|
|
|
|
|
|
|
} |
4720
|
|
|
|
|
|
|
sub mapping_end_event { |
4721
|
2
|
|
|
2
|
|
12
|
{ event => 'mapping_end' }; |
4722
|
|
|
|
|
|
|
} |
4723
|
|
|
|
|
|
|
sub sequence_start_event { |
4724
|
4
|
|
66
|
4
|
|
38
|
{ event => 'sequence_start', flow => (shift || false) }; |
4725
|
|
|
|
|
|
|
} |
4726
|
|
|
|
|
|
|
sub sequence_end_event { |
4727
|
2
|
|
|
2
|
|
9
|
{ event => 'sequence_end' }; |
4728
|
|
|
|
|
|
|
} |
4729
|
|
|
|
|
|
|
sub scalar_event { |
4730
|
20
|
|
|
20
|
|
57
|
my ($style, $value) = @_; |
4731
|
20
|
|
|
|
|
137
|
{ event => 'scalar', style => $style, value => $value }; |
4732
|
|
|
|
|
|
|
} |
4733
|
|
|
|
|
|
|
sub alias_event { |
4734
|
0
|
|
|
0
|
|
0
|
{ event => 'alias', name => (shift) }; |
4735
|
|
|
|
|
|
|
} |
4736
|
|
|
|
|
|
|
sub cache { |
4737
|
6
|
|
|
6
|
|
34
|
{ text => (shift) }; |
4738
|
|
|
|
|
|
|
} |
4739
|
|
|
|
|
|
|
|
4740
|
|
|
|
|
|
|
sub new { |
4741
|
2
|
|
|
2
|
|
19471
|
my ($class, %self) = @_; |
4742
|
2
|
|
|
|
|
26
|
bless { |
4743
|
|
|
|
|
|
|
%self, |
4744
|
|
|
|
|
|
|
event => [], |
4745
|
|
|
|
|
|
|
cache => [], |
4746
|
|
|
|
|
|
|
}, $class; |
4747
|
|
|
|
|
|
|
} |
4748
|
|
|
|
|
|
|
|
4749
|
|
|
|
|
|
|
sub send { |
4750
|
26
|
|
|
26
|
|
48
|
my ($self, $event) = @_; |
4751
|
26
|
100
|
|
|
|
49
|
if (my $callback = $self->{callback}) { |
4752
|
13
|
|
|
|
|
23
|
$callback->($event); |
4753
|
|
|
|
|
|
|
} |
4754
|
|
|
|
|
|
|
else { |
4755
|
13
|
|
|
|
|
16
|
push @{$self->{event}}, $event; |
|
13
|
|
|
|
|
38
|
|
4756
|
|
|
|
|
|
|
} |
4757
|
|
|
|
|
|
|
} |
4758
|
|
|
|
|
|
|
|
4759
|
|
|
|
|
|
|
sub add { |
4760
|
44
|
|
|
44
|
|
122
|
my ($self, $event) = @_; |
4761
|
44
|
100
|
|
|
|
133
|
if (defined $event->{event}) { |
4762
|
38
|
50
|
|
|
|
110
|
if (my $anchor = $self->{anchor}) { |
4763
|
0
|
|
|
|
|
0
|
$event->{anchor} = delete $self->{anchor}; |
4764
|
|
|
|
|
|
|
} |
4765
|
38
|
50
|
|
|
|
162
|
if (my $tag = $self->{tag}) { |
4766
|
0
|
|
|
|
|
0
|
$event->{tag} = delete $self->{tag}; |
4767
|
|
|
|
|
|
|
} |
4768
|
|
|
|
|
|
|
} |
4769
|
44
|
|
|
|
|
167
|
$self->push($event); |
4770
|
44
|
|
|
|
|
111
|
return $event; |
4771
|
|
|
|
|
|
|
} |
4772
|
|
|
|
|
|
|
|
4773
|
|
|
|
|
|
|
sub push { |
4774
|
74
|
|
|
74
|
|
155
|
my ($self, $event) = @_; |
4775
|
74
|
100
|
|
|
|
121
|
if (@{$self->{cache}}) { |
|
74
|
|
|
|
|
190
|
|
4776
|
52
|
|
|
|
|
97
|
push @{$self->{cache}[-1]}, $event; |
|
52
|
|
|
|
|
182
|
|
4777
|
|
|
|
|
|
|
} |
4778
|
|
|
|
|
|
|
else { |
4779
|
22
|
100
|
|
|
|
123
|
if ($event->{event} =~ /(mapping_start|sequence_start|scalar)/) { |
4780
|
14
|
|
|
|
|
33
|
$self->check_document_start; |
4781
|
|
|
|
|
|
|
} |
4782
|
22
|
|
|
|
|
121
|
$self->send($event); |
4783
|
|
|
|
|
|
|
} |
4784
|
|
|
|
|
|
|
} |
4785
|
|
|
|
|
|
|
|
4786
|
|
|
|
|
|
|
sub cache_up { |
4787
|
34
|
|
|
34
|
|
166
|
my ($self, $event) = @_; |
4788
|
34
|
|
|
|
|
71
|
CORE::push @{$self->{cache}}, []; |
|
34
|
|
|
|
|
90
|
|
4789
|
34
|
100
|
|
|
|
133
|
$self->add($event) if $event; |
4790
|
|
|
|
|
|
|
} |
4791
|
|
|
|
|
|
|
|
4792
|
|
|
|
|
|
|
sub cache_down { |
4793
|
6
|
|
|
6
|
|
22
|
my ($self, $event) = @_; |
4794
|
6
|
50
|
|
|
|
16
|
my $events = pop @{$self->{cache}} or FAIL 'cache_down'; |
|
6
|
|
|
|
|
28
|
|
4795
|
6
|
|
|
|
|
30
|
$self->push($_) for @$events; |
4796
|
6
|
100
|
|
|
|
27
|
$self->add($event) if $event; |
4797
|
|
|
|
|
|
|
} |
4798
|
|
|
|
|
|
|
|
4799
|
|
|
|
|
|
|
sub cache_drop { |
4800
|
28
|
|
|
28
|
|
71
|
my ($self) = @_; |
4801
|
28
|
50
|
|
|
|
54
|
my $events = pop @{$self->{cache}} or FAIL 'cache_drop'; |
|
28
|
|
|
|
|
97
|
|
4802
|
28
|
|
|
|
|
84
|
return $events; |
4803
|
|
|
|
|
|
|
} |
4804
|
|
|
|
|
|
|
|
4805
|
|
|
|
|
|
|
sub cache_get { |
4806
|
0
|
|
|
0
|
|
0
|
my ($self, $type) = @_; |
4807
|
|
|
|
|
|
|
return |
4808
|
|
|
|
|
|
|
$self->{cache}[-1] && |
4809
|
|
|
|
|
|
|
$self->{cache}[-1][0] && |
4810
|
|
|
|
|
|
|
$self->{cache}[-1][0]{event} eq $type && |
4811
|
0
|
|
0
|
|
|
0
|
$self->{cache}[-1][0]; |
4812
|
|
|
|
|
|
|
} |
4813
|
|
|
|
|
|
|
|
4814
|
|
|
|
|
|
|
sub check_document_start { |
4815
|
14
|
|
|
14
|
|
21
|
my ($self) = @_; |
4816
|
14
|
100
|
|
|
|
34
|
return unless $self->{document_start}; |
4817
|
2
|
|
|
|
|
12
|
$self->send($self->{document_start}); |
4818
|
2
|
|
|
|
|
5
|
delete $self->{document_start}; |
4819
|
2
|
|
|
|
|
8
|
$self->{document_end} = document_end_event; |
4820
|
|
|
|
|
|
|
} |
4821
|
|
|
|
|
|
|
|
4822
|
|
|
|
|
|
|
sub check_document_end { |
4823
|
4
|
|
|
4
|
|
10
|
my ($self) = @_; |
4824
|
4
|
100
|
|
|
|
15
|
return unless $self->{document_end}; |
4825
|
2
|
|
|
|
|
8
|
$self->send($self->{document_end}); |
4826
|
2
|
|
|
|
|
5
|
delete $self->{document_end}; |
4827
|
2
|
|
|
|
|
8
|
$self->{tag_map} = {}; |
4828
|
2
|
|
|
|
|
7
|
$self->{document_start} = document_start_event; |
4829
|
|
|
|
|
|
|
} |
4830
|
|
|
|
|
|
|
|
4831
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
4832
|
|
|
|
|
|
|
sub try__l_yaml_stream { |
4833
|
2
|
|
|
2
|
|
7
|
my ($self) = @_; |
4834
|
2
|
|
|
|
|
7
|
$self->add(stream_start_event); |
4835
|
2
|
|
|
|
|
4
|
$self->{tag_map} = {}; |
4836
|
2
|
|
|
|
|
8
|
$self->{document_start} = document_start_event; |
4837
|
2
|
|
|
|
|
74
|
delete $self->{document_end}; |
4838
|
|
|
|
|
|
|
} |
4839
|
|
|
|
|
|
|
sub got__l_yaml_stream { |
4840
|
2
|
|
|
2
|
|
7
|
my ($self) = @_; |
4841
|
2
|
|
|
|
|
7
|
$self->check_document_end; |
4842
|
2
|
|
|
|
|
36
|
$self->add(stream_end_event); |
4843
|
|
|
|
|
|
|
} |
4844
|
|
|
|
|
|
|
|
4845
|
|
|
|
|
|
|
sub got__ns_yaml_version { |
4846
|
0
|
|
|
0
|
|
0
|
my ($self, $o) = @_; |
4847
|
|
|
|
|
|
|
die "Multiple %YAML directives not allowed" |
4848
|
0
|
0
|
|
|
|
0
|
if defined $self->{document_start}{version}; |
4849
|
0
|
|
|
|
|
0
|
$self->{document_start}{version} = $o->{text}; |
4850
|
|
|
|
|
|
|
} |
4851
|
|
|
|
|
|
|
|
4852
|
|
|
|
|
|
|
sub got__c_tag_handle { |
4853
|
0
|
|
|
0
|
|
0
|
my ($self, $o) = @_; |
4854
|
0
|
|
|
|
|
0
|
$self->{tag_handle} = $o->{text}; |
4855
|
|
|
|
|
|
|
} |
4856
|
|
|
|
|
|
|
sub got__ns_tag_prefix { |
4857
|
0
|
|
|
0
|
|
0
|
my ($self, $o) = @_; |
4858
|
0
|
|
|
|
|
0
|
$self->{tag_map}{$self->{tag_handle}} = $o->{text}; |
4859
|
|
|
|
|
|
|
} |
4860
|
|
|
|
|
|
|
|
4861
|
|
|
|
|
|
|
sub got__c_directives_end { |
4862
|
2
|
|
|
2
|
|
6
|
my ($self) = @_; |
4863
|
2
|
|
|
|
|
12
|
$self->check_document_end; |
4864
|
2
|
|
|
|
|
6
|
$self->{document_start}{explicit} = true; |
4865
|
|
|
|
|
|
|
} |
4866
|
|
|
|
|
|
|
sub got__c_document_end { |
4867
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
4868
|
|
|
|
|
|
|
$self->{document_end}{explicit} = true |
4869
|
0
|
0
|
|
|
|
0
|
if defined $self->{document_end}; |
4870
|
0
|
|
|
|
|
0
|
$self->check_document_end; |
4871
|
|
|
|
|
|
|
} |
4872
|
|
|
|
|
|
|
|
4873
|
0
|
|
|
0
|
|
0
|
sub got__c_flow_mapping__all__x7b { $_[0]->add(mapping_start_event(true)) } |
4874
|
0
|
|
|
0
|
|
0
|
sub got__c_flow_mapping__all__x7d { $_[0]->add(mapping_end_event) } |
4875
|
|
|
|
|
|
|
|
4876
|
2
|
|
|
2
|
|
9
|
sub got__c_flow_sequence__all__x5b { $_[0]->add(sequence_start_event(true)) } |
4877
|
2
|
|
|
2
|
|
10
|
sub got__c_flow_sequence__all__x5d { $_[0]->add(sequence_end_event) } |
4878
|
|
|
|
|
|
|
|
4879
|
2
|
|
|
2
|
|
10
|
sub try__l_block_mapping { $_[0]->cache_up(mapping_start_event) } |
4880
|
2
|
|
|
2
|
|
10
|
sub got__l_block_mapping { $_[0]->cache_down(mapping_end_event) } |
4881
|
0
|
|
|
0
|
|
0
|
sub not__l_block_mapping { $_[0]->cache_drop } |
4882
|
|
|
|
|
|
|
|
4883
|
2
|
|
|
2
|
|
9
|
sub try__l_block_sequence { $_[0]->cache_up(sequence_start_event) } |
4884
|
0
|
|
|
0
|
|
0
|
sub got__l_block_sequence { $_[0]->cache_down(sequence_end_event) } |
4885
|
|
|
|
|
|
|
sub not__l_block_sequence { |
4886
|
2
|
|
|
2
|
|
6
|
my ($self) = @_; |
4887
|
2
|
|
|
|
|
8
|
my $event = $_[0]->cache_drop->[0]; |
4888
|
2
|
|
|
|
|
7
|
$self->{anchor} = $event->{anchor}; |
4889
|
2
|
|
|
|
|
9
|
$self->{tag} = $event->{tag}; |
4890
|
|
|
|
|
|
|
} |
4891
|
|
|
|
|
|
|
|
4892
|
0
|
|
|
0
|
|
0
|
sub try__ns_l_compact_mapping { $_[0]->cache_up(mapping_start_event) } |
4893
|
0
|
|
|
0
|
|
0
|
sub got__ns_l_compact_mapping { $_[0]->cache_down(mapping_end_event) } |
4894
|
0
|
|
|
0
|
|
0
|
sub not__ns_l_compact_mapping { $_[0]->cache_drop } |
4895
|
|
|
|
|
|
|
|
4896
|
0
|
|
|
0
|
|
0
|
sub try__ns_l_compact_sequence { $_[0]->cache_up(sequence_start_event) } |
4897
|
0
|
|
|
0
|
|
0
|
sub got__ns_l_compact_sequence { $_[0]->cache_down(sequence_end_event) } |
4898
|
0
|
|
|
0
|
|
0
|
sub not__ns_l_compact_sequence { $_[0]->cache_drop } |
4899
|
|
|
|
|
|
|
|
4900
|
4
|
|
|
4
|
|
19
|
sub try__ns_flow_pair { $_[0]->cache_up(mapping_start_event(true)) } |
4901
|
0
|
|
|
0
|
|
0
|
sub got__ns_flow_pair { $_[0]->cache_down(mapping_end_event) } |
4902
|
4
|
|
|
4
|
|
16
|
sub not__ns_flow_pair { $_[0]->cache_drop } |
4903
|
|
|
|
|
|
|
|
4904
|
6
|
|
|
6
|
|
23
|
sub try__ns_l_block_map_implicit_entry { $_[0]->cache_up } |
4905
|
4
|
|
|
4
|
|
59
|
sub got__ns_l_block_map_implicit_entry { $_[0]->cache_down } |
4906
|
2
|
|
|
2
|
|
11
|
sub not__ns_l_block_map_implicit_entry { $_[0]->cache_drop } |
4907
|
|
|
|
|
|
|
|
4908
|
6
|
|
|
6
|
|
31
|
sub try__c_l_block_map_explicit_entry { $_[0]->cache_up } |
4909
|
0
|
|
|
0
|
|
0
|
sub got__c_l_block_map_explicit_entry { $_[0]->cache_down } |
4910
|
6
|
|
|
6
|
|
26
|
sub not__c_l_block_map_explicit_entry { $_[0]->cache_drop } |
4911
|
|
|
|
|
|
|
|
4912
|
4
|
|
|
4
|
|
22
|
sub try__c_ns_flow_map_empty_key_entry { $_[0]->cache_up } |
4913
|
0
|
|
|
0
|
|
0
|
sub got__c_ns_flow_map_empty_key_entry { $_[0]->cache_down } |
4914
|
4
|
|
|
4
|
|
24
|
sub not__c_ns_flow_map_empty_key_entry { $_[0]->cache_drop } |
4915
|
|
|
|
|
|
|
|
4916
|
|
|
|
|
|
|
sub got__ns_plain { |
4917
|
12
|
|
|
12
|
|
45
|
my ($self, $o) = @_; |
4918
|
12
|
|
|
|
|
35
|
my $text = $o->{text}; |
4919
|
12
|
|
|
|
|
31
|
$text =~ s/(?:[\ \t]*\r?\n[\ \t]*)/\n/g; |
4920
|
12
|
0
|
|
|
|
28
|
$text =~ s/(\n)(\n*)/length($2) ? $2 : ' '/ge; |
|
0
|
|
|
|
|
0
|
|
4921
|
12
|
|
|
|
|
51
|
$self->add(scalar_event(plain => $text)); |
4922
|
|
|
|
|
|
|
} |
4923
|
|
|
|
|
|
|
|
4924
|
|
|
|
|
|
|
sub got__c_single_quoted { |
4925
|
0
|
|
|
0
|
|
0
|
my ($self, $o) = @_; |
4926
|
0
|
|
|
|
|
0
|
my $text = substr($o->{text}, 1, -1); |
4927
|
0
|
|
|
|
|
0
|
$text =~ s/(?:[\ \t]*\r?\n[\ \t]*)/\n/g; |
4928
|
0
|
0
|
|
|
|
0
|
$text =~ s/(\n)(\n*)/length($2) ? $2 : ' '/ge; |
|
0
|
|
|
|
|
0
|
|
4929
|
0
|
|
|
|
|
0
|
$text =~ s/''/'/g; |
4930
|
0
|
|
|
|
|
0
|
$self->add(scalar_event(single => $text)); |
4931
|
|
|
|
|
|
|
} |
4932
|
|
|
|
|
|
|
|
4933
|
|
|
|
|
|
|
sub got__c_double_quoted { |
4934
|
0
|
|
|
0
|
|
0
|
my ($self, $o) = @_; |
4935
|
0
|
|
|
|
|
0
|
my $text = substr($o->{text}, 1, -1); |
4936
|
0
|
|
|
|
|
0
|
$text =~ s/(?:[\ \t]*\r?\n[\ \t]*)/\n/g; |
4937
|
0
|
|
|
|
|
0
|
$text =~ s/\\\n[\ \t]*//g; |
4938
|
0
|
0
|
|
|
|
0
|
$text =~ s/(\n)(\n*)/length($2) ? $2 : ' '/ge; |
|
0
|
|
|
|
|
0
|
|
4939
|
0
|
|
|
|
|
0
|
$text =~ s/\\(["\/])/$1/g; |
4940
|
0
|
|
|
|
|
0
|
$text =~ s/\\ / /g; |
4941
|
0
|
|
|
|
|
0
|
$text =~ s/\\b/\b/g; |
4942
|
0
|
|
|
|
|
0
|
$text =~ s/\\t/\t/g; |
4943
|
0
|
|
|
|
|
0
|
$text =~ s/\\n/\n/g; |
4944
|
0
|
|
|
|
|
0
|
$text =~ s/\\r/\r/g; |
4945
|
0
|
|
|
|
|
0
|
$text =~ s/\\x([0-9a-fA-F]{2})/chr(hex($1))/eg; |
|
0
|
|
|
|
|
0
|
|
4946
|
0
|
|
|
|
|
0
|
$text =~ s/\\u([0-9a-fA-F]{4})/chr(hex($1))/eg; |
|
0
|
|
|
|
|
0
|
|
4947
|
0
|
|
|
|
|
0
|
$text =~ s/\\U([0-9a-fA-F]{8})/chr(hex($1))/eg; |
|
0
|
|
|
|
|
0
|
|
4948
|
0
|
|
|
|
|
0
|
$text =~ s/\\\\/\\/g; |
4949
|
0
|
|
|
|
|
0
|
$self->add(scalar_event(double => $text)); |
4950
|
|
|
|
|
|
|
} |
4951
|
|
|
|
|
|
|
|
4952
|
|
|
|
|
|
|
sub got__l_empty { |
4953
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
4954
|
0
|
0
|
|
|
|
0
|
$self->add(cache '') if $self->{in_scalar}; |
4955
|
|
|
|
|
|
|
} |
4956
|
|
|
|
|
|
|
sub got__l_nb_literal_text__all__rep2 { |
4957
|
6
|
|
|
6
|
|
21
|
my ($self, $o) = @_; |
4958
|
6
|
|
|
|
|
32
|
$self->add(cache $o->{text}); |
4959
|
|
|
|
|
|
|
} |
4960
|
|
|
|
|
|
|
sub try__c_l_literal { |
4961
|
6
|
|
|
6
|
|
23
|
my ($self) = @_; |
4962
|
6
|
|
|
|
|
22
|
$self->{in_scalar} = true; |
4963
|
6
|
|
|
|
|
47
|
$self->cache_up; |
4964
|
|
|
|
|
|
|
} |
4965
|
|
|
|
|
|
|
sub got__c_l_literal { |
4966
|
2
|
|
|
2
|
|
7
|
my ($self) = @_; |
4967
|
2
|
|
|
|
|
7
|
delete $self->{in_scalar}; |
4968
|
2
|
|
|
|
|
11
|
my $lines = $self->cache_drop; |
4969
|
2
|
50
|
33
|
|
|
50
|
pop @$lines if @$lines and $lines->[-1]{text} eq ''; |
4970
|
2
|
|
|
|
|
22
|
my $text = join '', map "$_->{text}\n", @$lines; |
4971
|
2
|
|
|
|
|
9
|
my $t = $self->{parser}->state_curr->{t}; |
4972
|
2
|
50
|
|
|
|
11
|
if ($t eq 'clip') { |
|
|
0
|
|
|
|
|
|
4973
|
2
|
|
|
|
|
14
|
$text =~ s/\n+\z/\n/; |
4974
|
|
|
|
|
|
|
} |
4975
|
|
|
|
|
|
|
elsif ($t eq 'strip') { |
4976
|
0
|
|
|
|
|
0
|
$text =~ s/\n+\z//; |
4977
|
|
|
|
|
|
|
} |
4978
|
2
|
|
|
|
|
11
|
$self->add(scalar_event(literal => $text)); |
4979
|
|
|
|
|
|
|
} |
4980
|
|
|
|
|
|
|
sub not__c_l_literal { |
4981
|
4
|
|
|
4
|
|
13
|
my ($self) = @_; |
4982
|
4
|
|
|
|
|
10
|
delete $self->{in_scalar}; |
4983
|
4
|
|
|
|
|
24
|
$_[0]->cache_drop; |
4984
|
|
|
|
|
|
|
} |
4985
|
|
|
|
|
|
|
|
4986
|
|
|
|
|
|
|
sub got__ns_char { |
4987
|
46
|
|
|
46
|
|
122
|
my ($self, $o) = @_; |
4988
|
46
|
50
|
|
|
|
147
|
$self->{first} = $o->{text} if $self->{in_scalar}; |
4989
|
|
|
|
|
|
|
} |
4990
|
|
|
|
|
|
|
sub got__s_white { |
4991
|
26
|
|
|
26
|
|
68
|
my ($self, $o) = @_; |
4992
|
26
|
50
|
|
|
|
100
|
$self->{first} = $o->{text} if $self->{in_scalar}; |
4993
|
|
|
|
|
|
|
} |
4994
|
|
|
|
|
|
|
sub got__s_nb_folded_text__all__rep { |
4995
|
0
|
|
|
0
|
|
0
|
my ($self, $o) = @_; |
4996
|
0
|
|
|
|
|
0
|
$self->add(cache "$self->{first}$o->{text}"); |
4997
|
|
|
|
|
|
|
} |
4998
|
|
|
|
|
|
|
sub got__s_nb_spaced_text__all__rep { |
4999
|
0
|
|
|
0
|
|
0
|
my ($self, $o) = @_; |
5000
|
0
|
|
|
|
|
0
|
$self->add(cache "$self->{first}$o->{text}"); |
5001
|
|
|
|
|
|
|
} |
5002
|
|
|
|
|
|
|
sub try__c_l_folded { |
5003
|
4
|
|
|
4
|
|
16
|
my ($self) = @_; |
5004
|
4
|
|
|
|
|
13
|
$self->{in_scalar} = true; |
5005
|
4
|
|
|
|
|
19
|
$self->{first} = ''; |
5006
|
4
|
|
|
|
|
12
|
$self->cache_up; |
5007
|
|
|
|
|
|
|
} |
5008
|
|
|
|
|
|
|
sub got__c_l_folded { |
5009
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
5010
|
0
|
|
|
|
|
0
|
delete $self->{in_scalar}; |
5011
|
|
|
|
|
|
|
|
5012
|
0
|
|
|
|
|
0
|
my @lines = map $_->{text}, @{$self->cache_drop}; |
|
0
|
|
|
|
|
0
|
|
5013
|
0
|
|
|
|
|
0
|
my $text = join "\n", @lines; |
5014
|
0
|
|
|
|
|
0
|
$text =~ s/^(\S.*)\n(?=\S)/$1 /gm; |
5015
|
0
|
|
|
|
|
0
|
$text =~ s/^(\S.*)\n(\n+)/$1$2/gm; |
5016
|
0
|
|
|
|
|
0
|
$text =~ s/^([\ \t]+\S.*)\n(\n+)(?=\S)/$1$2/gm; |
5017
|
0
|
|
|
|
|
0
|
$text .= "\n"; |
5018
|
|
|
|
|
|
|
|
5019
|
0
|
|
|
|
|
0
|
my $t = $self->{parser}->state_curr->{t}; |
5020
|
0
|
0
|
|
|
|
0
|
if ($t eq 'clip') { |
|
|
0
|
|
|
|
|
|
5021
|
0
|
|
|
|
|
0
|
$text =~ s/\n+\z/\n/; |
5022
|
0
|
0
|
|
|
|
0
|
$text = '' if $text eq "\n"; |
5023
|
|
|
|
|
|
|
} |
5024
|
|
|
|
|
|
|
elsif ($t eq 'strip') { |
5025
|
0
|
|
|
|
|
0
|
$text =~ s/\n+\z//; |
5026
|
|
|
|
|
|
|
} |
5027
|
0
|
|
|
|
|
0
|
$self->add(scalar_event(folded => $text)); |
5028
|
|
|
|
|
|
|
} |
5029
|
|
|
|
|
|
|
sub not__c_l_folded { |
5030
|
4
|
|
|
4
|
|
10
|
my ($self) = @_; |
5031
|
4
|
|
|
|
|
21
|
delete $self->{in_scalar}; |
5032
|
4
|
|
|
|
|
14
|
$_[0]->cache_drop; |
5033
|
|
|
|
|
|
|
} |
5034
|
|
|
|
|
|
|
|
5035
|
6
|
|
|
6
|
|
36
|
sub got__e_scalar { $_[0]->add(scalar_event(plain => '')) } |
5036
|
|
|
|
|
|
|
|
5037
|
|
|
|
|
|
|
sub not__s_l_block_collection__all__rep__all__any__all { |
5038
|
12
|
|
|
12
|
|
27
|
my ($self) = @_; |
5039
|
12
|
|
|
|
|
30
|
delete $self->{anchor}; |
5040
|
12
|
|
|
|
|
24
|
delete $self->{tag}; |
5041
|
|
|
|
|
|
|
} |
5042
|
|
|
|
|
|
|
|
5043
|
|
|
|
|
|
|
sub got__c_ns_anchor_property { |
5044
|
0
|
|
|
0
|
|
0
|
my ($self, $o) = @_; |
5045
|
0
|
|
|
|
|
0
|
$self->{anchor} = substr($o->{text}, 1); |
5046
|
|
|
|
|
|
|
} |
5047
|
|
|
|
|
|
|
|
5048
|
|
|
|
|
|
|
sub got__c_ns_tag_property { |
5049
|
0
|
|
|
0
|
|
0
|
my ($self, $o) = @_; |
5050
|
0
|
|
|
|
|
0
|
my $tag = $o->{text}; |
5051
|
0
|
|
|
|
|
0
|
my $prefix; |
5052
|
0
|
0
|
|
|
|
0
|
if ($tag =~ /^!<(.*)>$/) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
5053
|
0
|
|
|
|
|
0
|
$self->{tag} = $1; |
5054
|
|
|
|
|
|
|
} |
5055
|
|
|
|
|
|
|
elsif ($tag =~ /^!!(.*)/) { |
5056
|
0
|
0
|
|
|
|
0
|
if (defined($prefix = $self->{tag_map}{'!!'})) { |
5057
|
0
|
|
|
|
|
0
|
$self->{tag} = $prefix . substr($tag, 2); |
5058
|
|
|
|
|
|
|
} |
5059
|
|
|
|
|
|
|
else { |
5060
|
0
|
|
|
|
|
0
|
$self->{tag} = "tag:yaml.org,2002:$1"; |
5061
|
|
|
|
|
|
|
} |
5062
|
|
|
|
|
|
|
} |
5063
|
|
|
|
|
|
|
elsif ($tag =~ /^(!.*?!)/) { |
5064
|
0
|
|
|
|
|
0
|
$prefix = $self->{tag_map}{$1}; |
5065
|
0
|
0
|
|
|
|
0
|
if (defined $prefix) { |
5066
|
0
|
|
|
|
|
0
|
$self->{tag} = $prefix . substr($tag, length($1)); |
5067
|
|
|
|
|
|
|
} |
5068
|
|
|
|
|
|
|
else { |
5069
|
0
|
|
|
|
|
0
|
die "No %TAG entry for '$prefix'"; |
5070
|
|
|
|
|
|
|
} |
5071
|
|
|
|
|
|
|
} |
5072
|
|
|
|
|
|
|
elsif (defined($prefix = $self->{tag_map}{'!'})) { |
5073
|
0
|
|
|
|
|
0
|
$self->{tag} = $prefix . substr($tag, 1); |
5074
|
|
|
|
|
|
|
} |
5075
|
|
|
|
|
|
|
else { |
5076
|
0
|
|
|
|
|
0
|
$self->{tag} = $tag; |
5077
|
|
|
|
|
|
|
} |
5078
|
0
|
|
|
|
|
0
|
$self->{tag} =~ s/%([0-9a-fA-F]{2})/chr(hex($1))/eg; |
|
0
|
|
|
|
|
0
|
|
5079
|
|
|
|
|
|
|
} |
5080
|
|
|
|
|
|
|
|
5081
|
|
|
|
|
|
|
sub got__c_ns_alias_node { |
5082
|
0
|
|
|
0
|
|
0
|
my ($self, $o) = @_; |
5083
|
0
|
|
|
|
|
0
|
my $name = $o->{text}; |
5084
|
0
|
|
|
|
|
0
|
$name =~ s/^\*//; |
5085
|
0
|
|
|
|
|
0
|
$self->add(alias_event($name)); |
5086
|
|
|
|
|
|
|
} |
5087
|
|
|
|
|
|
|
|
5088
|
|
|
|
|
|
|
1; |
5089
|
|
|
|
|
|
|
|
5090
|
|
|
|
|
|
|
# vim: sw=2: |
5091
|
|
|
|
|
|
|
|
5092
|
|
|
|
|
|
|
|
5093
|
2
|
|
|
2
|
|
29
|
use v5.12; |
|
2
|
|
|
|
|
7
|
|
5094
|
|
|
|
|
|
|
package PerlYamlReferenceParserTestReceiver; |
5095
|
2
|
|
|
2
|
|
21
|
use base 'PerlYamlReferenceParserReceiver'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
921
|
|
5096
|
|
|
|
|
|
|
|
5097
|
2
|
|
|
2
|
|
19
|
use PerlYamlReferenceParserPrelude; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1466
|
|
5098
|
|
|
|
|
|
|
|
5099
|
|
|
|
|
|
|
my $event_map = { |
5100
|
|
|
|
|
|
|
stream_start => '+STR', |
5101
|
|
|
|
|
|
|
stream_end => '-STR', |
5102
|
|
|
|
|
|
|
document_start => '+DOC', |
5103
|
|
|
|
|
|
|
document_end => '-DOC', |
5104
|
|
|
|
|
|
|
mapping_start => '+MAP', |
5105
|
|
|
|
|
|
|
mapping_end => '-MAP', |
5106
|
|
|
|
|
|
|
sequence_start => '+SEQ', |
5107
|
|
|
|
|
|
|
sequence_end => '-SEQ', |
5108
|
|
|
|
|
|
|
scalar => '=VAL', |
5109
|
|
|
|
|
|
|
alias => '=ALI', |
5110
|
|
|
|
|
|
|
}; |
5111
|
|
|
|
|
|
|
|
5112
|
|
|
|
|
|
|
my $style_map = { |
5113
|
|
|
|
|
|
|
plain => ':', |
5114
|
|
|
|
|
|
|
single => "'", |
5115
|
|
|
|
|
|
|
double => '"', |
5116
|
|
|
|
|
|
|
literal => '|', |
5117
|
|
|
|
|
|
|
folded => '>', |
5118
|
|
|
|
|
|
|
}; |
5119
|
|
|
|
|
|
|
|
5120
|
|
|
|
|
|
|
sub output { |
5121
|
1
|
|
|
1
|
|
2
|
my ($self) = @_; |
5122
|
|
|
|
|
|
|
join '', map { |
5123
|
13
|
|
|
|
|
31
|
my $type = $event_map->{$_->{event}}; |
5124
|
13
|
|
|
|
|
20
|
my @event = ($type); |
5125
|
13
|
50
|
66
|
|
|
31
|
push @event, '---' if $type eq '+DOC' and $_->{explicit}; |
5126
|
13
|
50
|
66
|
|
|
37
|
push @event, '...' if $type eq '-DOC' and $_->{explicit}; |
5127
|
13
|
50
|
66
|
|
|
35
|
push @event, '{}' if $type eq '+MAP' and $_->{flow}; |
5128
|
13
|
50
|
66
|
|
|
37
|
push @event, '[]' if $type eq '+SEQ' and $_->{flow}; |
5129
|
13
|
50
|
|
|
|
32
|
push @event, "&$_->{anchor}" if $_->{anchor}; |
5130
|
13
|
50
|
|
|
|
23
|
push @event, "<$_->{tag}>" if $_->{tag}; |
5131
|
13
|
50
|
|
|
|
24
|
push @event, "*$_->{name}" if $_->{name}; |
5132
|
13
|
100
|
|
|
|
26
|
if (exists $_->{value}) { |
5133
|
5
|
|
|
|
|
11
|
my $style = $style_map->{$_->{style}}; |
5134
|
5
|
|
|
|
|
11
|
my $value = $_->{value}; |
5135
|
5
|
|
|
|
|
9
|
$value =~ s/\\/\\\\/g; |
5136
|
5
|
|
|
|
|
8
|
$value =~ s/\x08/\\b/g; |
5137
|
5
|
|
|
|
|
8
|
$value =~ s/\t/\\t/g; |
5138
|
5
|
|
|
|
|
9
|
$value =~ s/\n/\\n/g; |
5139
|
5
|
|
|
|
|
8
|
$value =~ s/\r/\\r/g; |
5140
|
5
|
|
|
|
|
7
|
$value =~ s/\x20\z//; |
5141
|
5
|
|
|
|
|
12
|
push @event, "$style$value"; |
5142
|
|
|
|
|
|
|
} |
5143
|
13
|
|
|
|
|
43
|
join(' ', @event) . "\n"; |
5144
|
1
|
|
|
|
|
2
|
} @{$self->{event}}; |
|
1
|
|
|
|
|
5
|
|
5145
|
|
|
|
|
|
|
} |
5146
|
|
|
|
|
|
|
|
5147
|
|
|
|
|
|
|
1; |
5148
|
|
|
|
|
|
|
|
5149
|
|
|
|
|
|
|
# vim: sw=2: |
5150
|
|
|
|
|
|
|
|