blib/lib/Text/Nunjucks/Lexer/Token.pm

filter: Statementstmt 87.5% 14 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 2 totaltotal 77.2% 17 / 22 CC 1 SCAR 0.6
CC
1
Cov
88%
BUILDARGS
1.1
BUILDARGS
1.1
BEGIN
1.0
CRAP 1.1
« blib/lib/Text/Nunjucks/Runtime/None.pm ↑ Summary blib/lib/Text/Nunjucks/Lexer.pm »
1 package Text::Nunjucks::Lexer::Token;
2 # ABSTRACT: One lexer token -- type, value, line and column (lexer.js token())
3  
4 21 our $VERSION = '0.001';
5  
6 21 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 21 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 # upstream: function token(type, value, lineno, colno) -- the
10 # { type, value, lineno, colno } record the Tokenizer hands out.
11  
12 21 has type => ( is => 'ro' );
13 21 has value => ( is => 'ro' );
14 21 has lineno => ( is => 'ro' );
15 21 has colno => ( is => 'ro' );
16  
17 # token(type, value, lineno, colno) is positional upstream. `value` is a plain
18 # string for every token except a regex, whose value is the { body, flags }
19 # hashref upstream builds (its runtime representation is decided in k7).
20 327264 ▶sub BUILDARGS {
Subroutine BUILDARGS: called CC=1 SCAR=1.2
Pod undocumented
21 0 ▶ my ( $class, $type, $value, $lineno, $colno ) = @_;
Subroutine BUILDARGS: not called CC=1 SCAR=1.2
Pod undocumented
22 return {
23 0 type => $type,
24 value => $value,
25 lineno => $lineno,
26 colno => $colno
27 };
28 }
29  
30 21 1;
31  
32 __END__
« blib/lib/Text/Nunjucks/Runtime/None.pm ↑ Summary blib/lib/Text/Nunjucks/Lexer.pm »