aboutsummaryrefslogtreecommitdiffstats
path: root/lib/LXRng/Lang/Undefined.pm
blob: c4c3c727a35e5112cbaa061da66a9b769daa5222 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package LXRng::Lang::Undefined;

use strict;
use Subst::Complex;

use base qw(LXRng::Lang::Generic);


sub doindex {
    return 0;
}

sub pathexp {
    return qr/$/;
}

sub reserved { 
    return {};
}

sub parsespec {
    return ['atom',	'\\\\.',	undef];
}

sub typemap {
    return {};
}

sub markuphandlers {
    my ($self, $context, $node, $markup) = @_;
    
    my $format_newline = $markup->make_format_newline($node);

    my %subst;
    $subst{'code'} = new Subst::Complex
	qr/\n/ => $format_newline,
	qr/[^\n]*/ => sub { $markup->format_raw(@_) };

    $subst{'start'} = new Subst::Complex
	qr/^/  => $format_newline;

    return \%subst;
}

1;