| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# ========================================== |
|
2
|
|
|
|
|
|
|
# Copyright (C) 2004 kyle dawkins |
|
3
|
|
|
|
|
|
|
# kyle-at-centralparksoftware.com |
|
4
|
|
|
|
|
|
|
# ObjectivePerl is free software; you can |
|
5
|
|
|
|
|
|
|
# redistribute and/or modify it under the |
|
6
|
|
|
|
|
|
|
# same terms as perl itself. |
|
7
|
|
|
|
|
|
|
# ========================================== |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package ObjectivePerl; |
|
10
|
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
18925
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
40
|
|
|
12
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
31
|
|
|
13
|
1
|
|
|
1
|
|
5
|
use vars qw($DEBUG_SOURCE $DEBUG_MESSAGING $DEBUG_ALL); |
|
|
1
|
|
|
|
|
6
|
|
|
|
1
|
|
|
|
|
79
|
|
|
14
|
1
|
|
|
1
|
|
2205
|
use Filter::Simple; |
|
|
1
|
|
|
|
|
32085
|
|
|
|
1
|
|
|
|
|
5
|
|
|
15
|
1
|
|
|
1
|
|
514
|
use ObjectivePerl::Runtime; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
27
|
|
|
16
|
1
|
|
|
1
|
|
521
|
use ObjectivePerl::Parser; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
use ObjectivePerl::InstanceVariable; |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# debug levels; these are a bitmask |
|
22
|
|
|
|
|
|
|
# so you can combine more than one using the | operator |
|
23
|
|
|
|
|
|
|
$DEBUG_SOURCE = 0x0001; |
|
24
|
|
|
|
|
|
|
$DEBUG_MESSAGING = 0x0002; |
|
25
|
|
|
|
|
|
|
$DEBUG_ALL = 0xffff; |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $parser = ObjectivePerl::Parser->new(); |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
FILTER { |
|
30
|
|
|
|
|
|
|
$parser->initWithString($_); |
|
31
|
|
|
|
|
|
|
$_ = join("", @{$parser->content()}); |
|
32
|
|
|
|
|
|
|
}; |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub import { |
|
35
|
|
|
|
|
|
|
my $module = shift; |
|
36
|
|
|
|
|
|
|
my %params = @_; |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
while (my ($key, $value) = each %params) { |
|
39
|
|
|
|
|
|
|
if ($key eq "class") { |
|
40
|
|
|
|
|
|
|
$parser->{_currentClass} = $value; |
|
41
|
|
|
|
|
|
|
next; |
|
42
|
|
|
|
|
|
|
} |
|
43
|
|
|
|
|
|
|
if ($key eq "debug") { |
|
44
|
|
|
|
|
|
|
my $debugLevel = $value || $DEBUG_ALL; |
|
45
|
|
|
|
|
|
|
$parser->setDebug($debugLevel); |
|
46
|
|
|
|
|
|
|
ObjectivePerl::Runtime->runtime()->setDebug($debugLevel); |
|
47
|
|
|
|
|
|
|
} |
|
48
|
|
|
|
|
|
|
if ($key eq "CamelBones" && $value) { |
|
49
|
|
|
|
|
|
|
$parser->setCamelBonesCompatibility(1); |
|
50
|
|
|
|
|
|
|
ObjectivePerl::Runtime->runtime()->setCamelBonesCompatibility(1); #needed? |
|
51
|
|
|
|
|
|
|
} |
|
52
|
|
|
|
|
|
|
# TODO: allow user to change start/end regexps, etc. |
|
53
|
|
|
|
|
|
|
} |
|
54
|
|
|
|
|
|
|
} |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
|
57
|
|
|
|
|
|
|
__END__ |