Lines Matching refs:macro

17 Define new macro. The CODE reference will be called by call_macro(). You can
18 have two distinct definitions for and inline macro and for a standalone macro
27 Normaly CODE reference is passed all arguments up to next nested macro. Set
30 If the concat_until is present, the line is concated until the .Xx macro is
31 found. For example the following macro definition
51 Where C<CODE> is the CODE reference used to define macro called C<NAME>
55 Parse a line from the C<INPUT> filehandle. If a macro was detected it returns a
58 defined it calls it prior to passing argument to a macro, giving caller a
63 Call macro C<MACRO> with C<ARGS>. The CODE reference for macro C<MACRO> is
64 called and for all the nested macros. Every called macro returns a list which
91 provide a macro definition that should be executed on a .Bl call.
96 provide a macro definition that should be executed on a .El call.
189 # Default macro definitions start
289 # Default macro definitions end
295 my ($macro, $sub, %def) = @_;
298 $macros{ $macro } = {
304 if ($macros{ $macro }{concat_until}) {
305 $macros{ $macros{ $macro }{concat_until} } = { run => sub { @_ } };
306 $macros{ $macro }{greedy} = 1;
312 my ($macro) = @_;
313 croak "Macro <$macro> not defined" if not exists $macros{ $macro };
314 +{ %{ $macros{ $macro } } }
428 my ($macro, @args) = @_;
434 @args = _unquote(@args) if (!$macros{ $macro }{raw});
442 if ($macros{ $macro }{greedy}) {
452 if ($macros{ $macro }{concat_until}) {
455 die "EOF was reached and no $macros{ $macro }{concat_until} found"
458 if ($n_macro eq $macros{ $macro }{concat_until}) {
469 if ($macros{ $macro }{greedy}) {
470 #print "MACROG $macro (", (join ', ', @ret), ")\n";
471 return $macros{ $macro }{run}->(@ret);
474 #print "MACRO $macro (", (join ', ', @newargs), ")".(join ', ', @ret)."\n";
475 return $macros{ $macro }{run}->(@newargs), @ret;
497 my ($macro, @args) = quotewords(' ', 1, $line);
500 if ($macro && exists $macros{ $macro }) {
501 return ($macro, @args);