Example #1
0
		protected ValueBase(ICompilationScope parent, Match ast, CompilationContext context, FileInfo source)
		{
			Source = source;
			Parent = parent;
			Ast = ast ?? throw new ArgumentNullException(nameof(ast));
			Name = ast[ElementAST.FunctionName].Text;
			_context = context;
		}
Example #2
0
        public CustomFunction(ICompilationScope parent, Match ast, CompilerStackFrame?stack, CompilationContext context, FileInfo source)
            : base(parent, ast, context, source)
        {
            _capturedCompilationStack = stack;
            _astBody   = ast[ElementAST.FunctionBody];
            _astAssign = ast[ElementAST.Binding];
            if (_astBody)
            {
                _drivers = ast[ElementAST.FunctionBody].Matches.ToDictionary(m => m[ElementAST.FunctionName].Text, m => m);

                // If there's no inputs or outputs, this is a namespace
                IsNamespace = (Ast[ElementAST.FunctionInputs] ? false : true);
                IsClass     = IsNamespace && (Ast[ElementAST.FunctionOutputs] ? true : false);

                if (IsNamespace)
                {
                    NamespaceMembers = _drivers.Keys.ToArray();
                }
            }
        }
Example #3
0
 public CustomType(ICompilationScope parent, Match ast, CompilationContext context, FileInfo source)
     : base(parent, ast, context, source)
 {
 }