AddMacro() static private method

static private AddMacro ( MMap macros, MacroInfo info ) : void
macros MMap
info MacroInfo
return void
Example #1
0
 public MacroProcessorTask(MacroProcessor parent)
 {
     _parent = parent;
     _macros = parent.Macros.Clone();
     foreach (var mi in MacroProcessor.GetMacros(this.GetType(), null, _sink, this))
     {
         MacroProcessor.AddMacro(_macros, mi);
     }
     _macroNamespaces = new MSet <Symbol>(_macros.SelectMany(ms => ms.Value).Select(mi => mi.NamespaceSym).Where(ns => ns != null));
 }
Example #2
0
 public MacroProcessorTask(MacroProcessor parent)
 {
     _macros = parent._macros.Clone();
     // Braces must be handled specially by ApplyMacros itself, but we need
     // a macro method in order to get the special treatment, because as an
     // optimization, we ignore all symbols that are not in the macro table.
     MacroProcessor.AddMacro(_macros, new MacroInfo(null, S.Braces, OnBraces, MacroMode.Normal | MacroMode.Passive));
     MacroProcessor.AddMacro(_macros, new MacroInfo(null, S.Import, OnImport, MacroMode.Normal | MacroMode.Passive));
     MacroProcessor.AddMacro(_macros, new MacroInfo(null, _importMacros, OnImportMacros, MacroMode.Normal));
     MacroProcessor.AddMacro(_macros, new MacroInfo(null, _unimportMacros, OnUnimportMacros, MacroMode.Normal | MacroMode.Passive));
     MacroProcessor.AddMacro(_macros, new MacroInfo(null, _noLexicalMacros, NoLexicalMacros, MacroMode.NoReprocessing));
     _parent = parent;
 }