Пример #1
0
 public static LNode Constructor(LNode cons, IMacroContext context)
 {
     if (cons.ArgCount >= 3 && cons.Args[1].IsIdNamed(S.This))
     {
         var    anc = context.Ancestors;
         LNode  space = anc.TryGet(anc.Count - 3, LNode.Missing), typeName;
         Symbol type = EcsValidators.SpaceStatementKind(space);
         if (type != null && anc[anc.Count - 2] == space.Args[2])
         {
             typeName = space.Args[0];
             return(cons.WithArgChanged(1, F.Id(KeyNameComponentOf(typeName))));
         }
     }
     return(null);
 }