public override void ResolveReferences(IReferenceResolver referenceResolver) { var leftFunction = (ReferenceFunction)_leftFunction; _leftFunction = referenceResolver.Resolve(leftFunction.GetName()); var rightFunction = (ReferenceFunction)_rightFunction; _rightFunction = referenceResolver.Resolve(rightFunction.GetName()); }
public IScript LoadModule(string absoluteReference, string fromModule) { var logger = LogManager.GetCurrentClassLogger(); var fileInfo = _referenceResolver.Resolve(fromModule, absoluteReference); if (fileInfo.Exists == false) { logger.Error($"Referenced file does not exist: {absoluteReference} -> {fileInfo}"); return(null); } return(TryLoad(fileInfo)); }
public void Visit(MethodCallValue operand) { operand.Parent().Accept(this); object receiver = _value; MethodInfo method = _resolver.Resolve(operand.Method); try { _value = method.Invoke(IsStatic(method) ? null : receiver, Args(operand)); } catch (Exception exc) { Sharpen.Runtime.PrintStackTrace(exc); _value = null; } }
private dynamic Require(string fromModule, string moduleName) { var definition = _packageSystem.GetDefinition(fromModule, moduleName); if (definition == null) { LoadScript(_referenceResolver.Resolve(fromModule, moduleName)); definition = _packageSystem.GetDefinition(fromModule, moduleName); } if (definition != null) { return(definition()); } return(null); }
public override void ResolveReferences(IReferenceResolver referenceResolver) { var function = (ReferenceFunction)_function; _function = referenceResolver.Resolve(function.GetName()); }