/// <summary> /// Returns <c>true</c> if the literal depicts a constant. /// </summary> /// <param name="lit">literal</param> /// <param name="constValue">out parameter to receive the constant value, if the literal /// depicts a constant, otherwise <c>null</c></param> public static bool IsConst(this ILiteral lit, out object constValue) { IsConstLiteralVisitor vtor = new IsConstLiteralVisitor(); lit.Accept(vtor); constValue = vtor.ConstValue; return(vtor.Result); }
/// <summary> /// Returns <c>true</c> if the literal depicts a constant. /// </summary> /// <param name="lit">literal</param> /// <param name="constValue">out parameter to receive the constant value, if the literal /// depicts a constant, otherwise <c>null</c></param> public static bool IsConst(this ILiteral lit, out object constValue) { IsConstLiteralVisitor vtor = new IsConstLiteralVisitor(); lit.Accept(vtor); constValue = vtor.ConstValue; return vtor.Result; }