Exemple #1
0
        /// <summary>
        /// Evaluation of expression: reads the value of the variable from the given context.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        /// <exception cref="LocateableException">Unknown field!</exception>
        public object Evaluate(IEvaluationScope context)
        {
            if (!context.TryGetVariable(Identifier, out IVariableDefinition nameable))
            {
                throw new LocateableException(Location, "Unknown field!");
            }

            return(nameable.Value);
        }
Exemple #2
0
 /// <summary>
 /// Lookup THIS
 /// </summary>
 /// <param name="this"></param>
 /// <param name="variable"></param>
 /// <returns></returns>
 public static bool TryGetThis(this IEvaluationScope @this, out IVariableDefinition variable)
 {
     return(@this.TryGetVariable(ThisName, out variable));
 }