line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
################################################################################ |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# Copyright (c) 2002-2020 Marcus Holland-Moritz. All rights reserved. |
4
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or modify |
5
|
|
|
|
|
|
|
# it under the same terms as Perl itself. |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
################################################################################ |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
################################################################################ |
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
# METHOD: parse |
13
|
|
|
|
|
|
|
# |
14
|
|
|
|
|
|
|
# WRITTEN BY: Marcus Holland-Moritz ON: Jan 2002 |
15
|
|
|
|
|
|
|
# CHANGED BY: ON: |
16
|
|
|
|
|
|
|
# |
17
|
|
|
|
|
|
|
################################################################################ |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
void |
20
|
|
|
|
|
|
|
CBC::parse(code) |
21
|
|
|
|
|
|
|
SV *code |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
PREINIT: |
24
|
20760
|
|
|
|
|
|
CBC_METHOD(parse); |
25
|
20760
|
|
|
|
|
|
SV *temp = NULL; |
26
|
|
|
|
|
|
|
STRLEN len; |
27
|
|
|
|
|
|
|
Buffer buf; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
CODE: |
30
|
|
|
|
|
|
|
CT_DEBUG_METHOD; |
31
|
|
|
|
|
|
|
|
32
|
20760
|
50
|
|
|
|
|
buf.buffer = SvPV(code, len); |
33
|
|
|
|
|
|
|
|
34
|
20760
|
100
|
|
|
|
|
if (!((len == 0) || (len >= 1 && (buf.buffer[len-1] == '\n' || |
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
35
|
935
|
|
|
|
|
|
buf.buffer[len-1] == '\r')))) |
36
|
|
|
|
|
|
|
{ |
37
|
|
|
|
|
|
|
/* append a newline to a temporary copy */ |
38
|
929
|
|
|
|
|
|
temp = newSVsv(code); |
39
|
929
|
|
|
|
|
|
sv_catpvn(temp, "\n", 1); |
40
|
929
|
50
|
|
|
|
|
buf.buffer = SvPV(temp, len); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
20760
|
|
|
|
|
|
buf.length = len; |
44
|
20760
|
|
|
|
|
|
buf.pos = 0; |
45
|
|
|
|
|
|
|
|
46
|
20760
|
|
|
|
|
|
(void) parse_buffer(NULL, &buf, &THIS->cfg, &THIS->cpi); |
47
|
|
|
|
|
|
|
|
48
|
20760
|
100
|
|
|
|
|
if (temp) |
49
|
929
|
|
|
|
|
|
SvREFCNT_dec(temp); |
50
|
|
|
|
|
|
|
|
51
|
20760
|
|
|
|
|
|
handle_parse_errors(aTHX_ THIS->cpi.errorStack); |
52
|
|
|
|
|
|
|
|
53
|
20626
|
100
|
|
|
|
|
if (GIMME_V != G_VOID) |
|
|
100
|
|
|
|
|
|
54
|
22
|
|
|
|
|
|
XSRETURN(1); |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
################################################################################ |
58
|
|
|
|
|
|
|
# |
59
|
|
|
|
|
|
|
# METHOD: parse_file |
60
|
|
|
|
|
|
|
# |
61
|
|
|
|
|
|
|
# WRITTEN BY: Marcus Holland-Moritz ON: Jan 2002 |
62
|
|
|
|
|
|
|
# CHANGED BY: ON: |
63
|
|
|
|
|
|
|
# |
64
|
|
|
|
|
|
|
################################################################################ |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
void |
67
|
|
|
|
|
|
|
CBC::parse_file(file) |
68
|
|
|
|
|
|
|
const char *file |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
PREINIT: |
71
|
130
|
|
|
|
|
|
CBC_METHOD(parse_file); |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
CODE: |
74
|
|
|
|
|
|
|
CT_DEBUG_METHOD1("'%s'", file); |
75
|
|
|
|
|
|
|
|
76
|
130
|
|
|
|
|
|
(void) parse_buffer(file, NULL, &THIS->cfg, &THIS->cpi); |
77
|
|
|
|
|
|
|
|
78
|
130
|
|
|
|
|
|
handle_parse_errors(aTHX_ THIS->cpi.errorStack); |
79
|
|
|
|
|
|
|
|
80
|
100
|
50
|
|
|
|
|
if (GIMME_V != G_VOID) |
|
|
100
|
|
|
|
|
|
81
|
13
|
|
|
|
|
|
XSRETURN(1); |
82
|
|
|
|
|
|
|
|