MultiLanguage/JavaScript.pm untested

filter: Statementstmt 0.0% 0 / 22 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 37 CC 2 SCAR 10.6
CC
2
Cov
0%
match_regex
6.0
wrap
2.0
comment_start
2.0
CRAP 2.9
1 package Regexp::MultiLanguage::JavaScript;
2
3 use base qw(Regexp::MultiLanguage::BaseDialect);
4 use strict;
5 use warnings;
6
7 =head1 NAME
8
9 Regexp::MultiLanguage::JavaScript - JavaScript dialect for Regexp::MultiLanguage.
10
11 =head1 VERSION
12
13 Version 0.03
14
15 =cut
16
17 our $VERSION = 0.03;
18
19 =head1 SYNOPSIS
20
21 This module should not be used directly. Please read the documentation
22 for L<Regexp::MultiLanguage>
23
24 =cut
25
26 sub wrap {
27 return $_[1];
28 }
29
30 sub match_regex {
31 my ($this, $regex) = @_;
32
33 if ( $regex =~ /^m/ ) {
34 $regex = substr $regex, 1;
35 }
36
37 return "(value.match($regex))";
38 }
39
40 sub comment_start {
41 return '//';
42 }
43
44 sub make_function {
45 my ($this,$name,$expr) = @_;
46 my $prefix = $this->{'prefix'};
47 return "function $prefix$name(value) { return $expr }\n";
48 }
49
50 sub function_call {
51 my ($this,$name) = @_;
52 my $prefix = $this->{'prefix'};
53 return "$prefix$name( value )";
54 }
55
56 =head1 AUTHOR
57
58 Robby Walker, robwalker@cpan.org
59
60 =head1 COPYRIGHT & LICENSE
61
62 Copyright 2006 Robby Walker, all rights reserved.
63
64 This program is free software; you can redistribute it and/or modify it
65 under the same terms as Perl itself.
66
67 =cut
68
69 1;