Пример #1
0
        public static LNode @nameof(LNode nameof, IMacroContext context)
        {
            if (nameof.ArgCount != 1)
            {
                return(null);
            }
            Symbol expr = EcsValidators.KeyNameComponentOf(nameof.Args[0]);

            return(F.Literal(expr.Name));
        }
Пример #2
0
 /// <summary>Retrieves the "key" name component for the nameof(...) macro.</summary>
 /// <remarks>
 /// The key name component of <c>global::Foo!int.Bar!T(x)</c> (in C# notation
 /// global::Foo&lt;int>.Bar&lt;T>(x)) is <c>Bar</c>. This example tree has the
 /// structure <c>((((global::Foo)!int).Bar)!T)(x)</c>).
 /// </remarks>
 public static Symbol KeyNameComponentOf(LNode name)
 {
     return(EcsValidators.KeyNameComponentOf(name));
 }