File: Preprocessor.pm

package info (click to toggle)
libextutils-xspp-perl 0.1800-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 992 kB
  • sloc: perl: 8,324; cpp: 125; makefile: 2
file content (21 lines) | stat: -r--r--r-- 372 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package ExtUtils::XSpp::Node::Preprocessor;
use strict;
use warnings;
use base 'ExtUtils::XSpp::Node::Raw';

sub init {
  my $this = shift;
  my %args = @_;

  $this->SUPER::init( %args );
  $this->{SYMBOL} = $args{symbol};
}

sub print {
  $_[0]->rows->[0] . "\n" .
    ( $_[0]->symbol ? '#define ' . $_[0]->symbol . "\n\n" : "\n" )
}

sub symbol { $_[0]->{SYMBOL} }

1;