Exemplo n.º 1
0
        public static IEnumerable <MacroInfo> AliasedMacros()
        {
            var ns         = (Symbol)typeof(Macros).Namespace;
            var les2macros = MacroInfo.GetMacros(typeof(Les2), null, ns);
            var list       = (from m in les2macros
                              where m.Names.Any(name => _aliasedMacros.Contains(name))
                              select m).ToList();

            // These macros are not listed in _aliasedMacros to avoid including extra macros
            // having the same name, e.g. defaultPseudoFunc and defaultCase both watch for
            // things named `default`, but we only want to include one of them here.
            list.Add(MacroInfoFor(LeMP.les2.to.ecs.Macros.defaultPseudoFunc));
            list.Add(MacroInfoFor(LeMP.les2.to.ecs.Macros.castOperator));
            list.Add(MacroInfoFor(LeMP.les2.to.ecs.Macros.of));
            list.Add(MacroInfoFor(LeMP.les2.to.ecs.Macros.quickFunction));
            list.Add(MacroInfoFor(LeMP.les2.to.ecs.Macros.quickFunctionWithColon));
            return(list);

            MacroInfo MacroInfoFor(LexicalMacro f) =>
            new MacroInfo(ns, f.Method.GetCustomAttributes(false).OfType <LexicalMacroAttribute>().Single(), f);
        }
Exemplo n.º 2
0
 public static List <MacroInfo> Aliases()
 {
     return(MacroInfo.GetMacros(typeof(A.AliasTest), null, (Symbol)"LeMP.Tests.B").ToList());
 }
Exemplo n.º 3
0
 public static IEnumerable <MacroInfo> AliasedMacros()
 {
     return(MacroInfo.GetMacros(typeof(LeMP.les3.to.ecs.Macros))
            .Select(mi => new MacroInfo(_myNamespace, mi, mi.Macro, deprecateAllNames: true)));
 }