Lines Matching refs:macro
50 line to start the next macro. Optionally, a macro can be ended with
52 trailing blank lines are included in the macro. You can also end a definition
60 Expansion itself is pretty simple, one macro can invoke another macro, but
61 you cannot nest the invoke of a macro in another macro (i.e. - can't do
74 Within a macro you can use ## to cause things to get joined together after
75 expansion (i.e. - "a##b" within a macro will become "ab").
91 A macro ends at the start of the next one, or an optional %PDDM-DEFINE-END
95 One macro can invoke another by simply using its name NAME(ARGS). You cannot
98 Within a macro you can use ## to cause things to get joined together after
99 processing (i.e. - "a##b" within a macro will become "ab").
110 # Regex for macro definition.
112 # Regex for macro's argument definition.
122 # Takes in a list of macro names and makes a regex that will match invokes
129 # Takes in a list of macro arg names and makes a regex that will match
157 """Holds a macro definition."""
212 raise PDDMError('Attempt to redefine macro: "%s"' % line)
218 raise PDDMError('Got DEFINE-END directive without an active macro:'
228 # Allow blank lines between macro definitions.
232 raise PDDMError('Hit a line that wasn\'t a directive and no open macro'
241 raise PDDMError('Failed to parse macro definition: "%s"' % input_line)
249 raise PDDMError('Empty arg name in macro definition: "%s"'
252 raise PDDMError('Invalid arg name "%s" in macro definition: "%s"'
255 raise PDDMError('Arg name "%s" used more than once in macro'
261 """Expands the macro reference.
264 macro_ref_str: String of a macro reference (i.e. foo(a, b)).
274 raise PDDMError('Failed to parse macro reference: "%s"' % macro_ref_str)
276 raise PDDMError('No macro named "%s".' % match.group('name'))
291 raise PDDMError('Found macro recursion, invoking "%s":%s' %
293 macro = self._macros[name]
296 if args_str or len(macro.args):
298 if len(args) != len(macro.args):
300 (len(macro.args), macro_ref_str,
303 result = self._ReplaceArgValues(macro, args, macro_ref_str, macro_stack)
304 # Expand any macro invokes.
316 macro, arg_values, macro_ref_to_report, macro_stack):
319 return macro.body
320 assert len(arg_values) == len(macro.args)
321 args = dict(zip(macro.args, arg_values))
350 macro_arg_ref_re = _MacroArgRefRe(macro.args)
351 return macro_arg_ref_re.sub(_lookupArg, macro.body)
406 """Binds the chunk to a macro collection.
448 """Section that is the result of an macro expansion."""
486 macro = line[directive_len:].strip()
488 expand_result = self._macro_collection.Expand(macro)
497 (e.message, macro,
510 """Section containing macro definitions"""