public CheckLambdaContext(ParseInfo parseInfo, ILambdaApplier applier, string errorMessage, DocRange range, ParameterState parameterState)
 {
     ParseInfo      = parseInfo;
     Applier        = applier;
     ErrorMessage   = errorMessage;
     Range          = range;
     ParameterState = parameterState;
 }
 public IWorkshopTree Parse(ActionSet actionSet, MethodCall methodCall)
 {
     if (LambdaType.IsConstant())
     {
         ILambdaApplier lambda = (ILambdaApplier)actionSet.CurrentObject;
         return lambda.Invoke(actionSet, methodCall.ParameterValues);
     }
     return actionSet.DeltinScript.GetComponent<LambdaGroup>().Call(actionSet, methodCall);
 }
 public void Apply(ILambdaApplier applier)
 {
     if (!RegisterOccursLater)
     {
         // The arrow registration occurs now, parse the statement.
         applier.GetLambdaContent(Type);
     }
     else
     {
         // Otherwise, add it to the _apply list so we can apply it later.
         _apply.Add(applier);
     }
 }
        /// <summary>Gets the restricted calls and recursion from a lambda invocation.</summary>
        public static void LambdaInvokeApply(ParseInfo parseInfo, ILambdaApplier source, DocRange callRange)
        {
            if (!source.ResolvedSource) return;

            parseInfo.CurrentCallInfo?.Call(source.RecursiveCallHandler, callRange);

            // Add restricted calls.
            foreach (RestrictedCall call in source.CallInfo.RestrictedCalls)
                parseInfo.RestrictedCallHandler.RestrictedCall(new RestrictedCall(
                    call.CallType,
                    parseInfo.GetLocation(callRange),
                    RestrictedCall.Message_LambdaInvoke(source.GetLabel(false), call.CallType)
                ));
        }
Exemplo n.º 5
0
        /// <summary>Gets the restricted calls and recursion from a lambda invocation.</summary>
        public static void LambdaInvokeApply(ParseInfo parseInfo, ILambdaApplier source, DocRange callRange)
        {
            if (!source.ResolvedSource)
            {
                return;
            }

            if (source.RecursiveCallHandler != null)
            {
                parseInfo.CurrentCallInfo.Call(source.RecursiveCallHandler, callRange);
            }

            // Add restricted calls.
            foreach (var callType in source.GetRestrictedCallTypes())
            {
                parseInfo.RestrictedCallHandler.AddRestrictedCall(new RestrictedCall(
                                                                      callType,
                                                                      parseInfo.GetLocation(callRange),
                                                                      RestrictedCall.Message_LambdaInvoke(source.GetLabel(parseInfo.TranslateInfo, LabelInfo.RecursionError), callType)
                                                                      ));
            }
        }