diff options
author | Arne Georg Gleditsch <argggh@lxr.linpro.no> | 2007-11-27 01:19:19 +0100 |
---|---|---|
committer | Arne Georg Gleditsch <argggh@lxr.linpro.no> | 2007-11-27 01:19:19 +0100 |
commit | f96ca283fc3c67a5cca850d6fce362d3b1ff83de (patch) | |
tree | 5caa4deeae051e3be061e8288b60177ee3f424e9 | |
parent | d5cd83a2cbc554a715338a152b0a507634e57d36 (diff) |
Since reference_file adds all symbols anyway, don't bother looking them up. Just strip the reserved identifiers.
-rw-r--r-- | lib/LXRng/Lang/C.pm | 7 | ||||
-rw-r--r-- | lib/LXRng/Markup/File.pm | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/lib/LXRng/Lang/C.pm b/lib/LXRng/Lang/C.pm index 1a826bd..a1ab17c 100644 --- a/lib/LXRng/Lang/C.pm +++ b/lib/LXRng/Lang/C.pm @@ -77,9 +77,8 @@ sub markuphandlers { my ($self, $context, $node, $markup) = @_; my $index = $context->config->{'index'}; - my $syms = $index->symbols_by_file($context->tree, $context->release, - $node->name); - my $idre = $self->identifier_re(); + my $idre = $self->identifier_re(); + my $res = $self->reserved(); my %subst; @@ -104,7 +103,7 @@ sub markuphandlers { $subst{'code'} = new Subst::Complex qr/\n/ => $format_newline, - qr/[^\n]*/ => sub { $markup->format_code($idre, $syms, @_) }; + qr/[^\n]*/ => sub { $markup->format_code($idre, $res, @_) }; $subst{'start'} = new Subst::Complex qr/^/ => $format_newline; diff --git a/lib/LXRng/Markup/File.pm b/lib/LXRng/Markup/File.pm index 3983a3c..084d4a6 100644 --- a/lib/LXRng/Markup/File.pm +++ b/lib/LXRng/Markup/File.pm @@ -74,14 +74,14 @@ sub format_include { } sub format_code { - my ($self, $idre, $syms, $frag) = @_; + my ($self, $idre, $res, $frag) = @_; my $tree = $self->context->vtree(); my $path = $self->context->path(); Subst::Complex::s($frag, $idre => sub { my $sym = $_[1]; - if (exists($$syms{$sym})) { + unless (exists($$res{$sym})) { $sym = safe_html($sym); return qq{<a href="+code=$sym" class="sref">$sym</a>} } |