Lines Matching refs:macro

44 Define new macro. The CODE reference will be called by call_macro(). You can
45 have two distinct definitions for and inline macro and for a standalone macro
54 Normaly CODE reference is passed all arguments up to next nested macro. Set
57 If the concat_until is present, the line is concated until the .Xx macro is
58 found. For example the following macro definition
78 Where C<CODE> is the CODE reference used to define macro called C<NAME>
82 Parse a line from the C<INPUT> filehandle. If a macro was detected it returns a
85 defined it calls it prior to passing argument to a macro, giving caller a
90 Call macro C<MACRO> with C<ARGS>. The CODE reference for macro C<MACRO> is
91 called and for all the nested macros. Every called macro returns a list which
118 provide a macro definition that should be executed on a .Bl call.
123 provide a macro definition that should be executed on a .El call.
216 # Default macro definitions start
316 # Default macro definitions end
322 my ($macro, $sub, %def) = @_;
325 $macros{ $macro } = {
331 if ($macros{ $macro }{concat_until}) {
332 $macros{ $macros{ $macro }{concat_until} } = { run => sub { @_ } };
333 $macros{ $macro }{greedy} = 1;
339 my ($macro) = @_;
340 croak "Macro <$macro> not defined" if not exists $macros{ $macro };
341 +{ %{ $macros{ $macro } } }
455 my ($macro, @args) = @_;
461 @args = _unquote(@args) if (!$macros{ $macro }{raw});
469 if ($macros{ $macro }{greedy}) {
479 if ($macros{ $macro }{concat_until}) {
482 die "EOF was reached and no $macros{ $macro }{concat_until} found"
485 if ($n_macro eq $macros{ $macro }{concat_until}) {
496 if ($macros{ $macro }{greedy}) {
497 #print "MACROG $macro (", (join ', ', @ret), ")\n";
498 return $macros{ $macro }{run}->(@ret);
501 #print "MACRO $macro (", (join ', ', @newargs), ")".(join ', ', @ret)."\n";
502 return $macros{ $macro }{run}->(@newargs), @ret;
524 my ($macro, @args) = quotewords(' ', 1, $line);
527 if ($macro && exists $macros{ $macro }) {
528 return ($macro, @args);