diff options
author | Arne Georg Gleditsch <argggh@lxr.linpro.no> | 2007-07-05 00:51:08 +0200 |
---|---|---|
committer | Arne Georg Gleditsch <argggh@lxr.linpro.no> | 2007-07-05 00:51:08 +0200 |
commit | e9fa4c98bb5f084739d3418ade3f0c51e34a0aa1 (patch) | |
tree | fec1d635625e031cde7cba1b0a1d95ee92ac760b /lib/LXRng/Lang/Undefined.pm |
Rebase tree.
Diffstat (limited to 'lib/LXRng/Lang/Undefined.pm')
-rw-r--r-- | lib/LXRng/Lang/Undefined.pm | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/lib/LXRng/Lang/Undefined.pm b/lib/LXRng/Lang/Undefined.pm new file mode 100644 index 0000000..c4c3c72 --- /dev/null +++ b/lib/LXRng/Lang/Undefined.pm @@ -0,0 +1,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; |