コード例 #1
0
ファイル: FunctionList.cs プロジェクト: hahoyer/reni.cs
 int CreateFunctionInstance(TypeBase args, FunctionSyntax syntax, CompoundView compoundView)
 {
     var index = _list.Count;
     var f = new FunctionType(index, syntax, compoundView, args);
     _list.Add(f);
     return index;
 }
コード例 #2
0
ファイル: FunctionSyntax.cs プロジェクト: hahoyer/reni.cs
 internal static Result<Parser.Value> Create
     (Syntax left, bool isImplicit, bool isMetaFunction, Syntax right, Syntax syntax)
 {
     var leftvalue = left?.Value;
     var rightvalue = right?.Value;
     var target = new FunctionSyntax
         (leftvalue?.Target, isImplicit, isMetaFunction, rightvalue?.Target,syntax);
     var issues = leftvalue?.Issues.plus(rightvalue?.Issues);
     return new Result<Parser.Value>(target, issues);
 }
コード例 #3
0
ファイル: FunctionType.cs プロジェクト: hahoyer/reni.cs
 internal FunctionType
     (int index, FunctionSyntax body, CompoundView compoundView, TypeBase argsType)
 {
     Getter = new GetterFunction(this, index, body.Getter);
     Setter = body.Setter == null ? null : new SetterFunction(this, index, body.Setter);
     Index = index;
     Body = body;
     _compoundView = compoundView;
     ArgsType = argsType;
     StopByObjectIds();
 }
コード例 #4
0
ファイル: FunctionList.cs プロジェクト: hahoyer/reni.cs
 internal IEnumerable<FunctionType> Find(FunctionSyntax syntax, CompoundView compoundView)
     => _dictionary[syntax][compoundView].Select(item => _list[item.Value]);
コード例 #5
0
ファイル: FunctionList.cs プロジェクト: hahoyer/reni.cs
 internal FunctionType Find
     (FunctionSyntax syntax, CompoundView compoundView, TypeBase argsType)
 {
     var index = _dictionary[syntax][compoundView][argsType];
     return _list[index];
 }
コード例 #6
0
ファイル: CompoundView.cs プロジェクト: hahoyer/reni.cs
 internal IEnumerable<FunctionType> Functions(FunctionSyntax body)
     => Compound
         .Root
         .FunctionInstances(this, body);
コード例 #7
0
ファイル: CompoundView.cs プロジェクト: hahoyer/reni.cs
 internal FunctionType Function(FunctionSyntax body, TypeBase argsType)
     => Compound
         .Root
         .FunctionInstance(this, body, argsType);
コード例 #8
0
ファイル: CompoundView.cs プロジェクト: hahoyer/reni.cs
 IConversion ConversionFunction(FunctionSyntax body)
 {
     IConversion result = new ConverterAccess(Function(body, Root.VoidType), Type);
     var source = result.Source;
     Tracer.Assert(source == Type.Pointer, source.Dump);
     Tracer.Assert(source == result.Result(Category.Code).Code.ArgType);
     return result;
 }
コード例 #9
0
ファイル: CompoundView.cs プロジェクト: hahoyer/reni.cs
 internal TypeBase FunctionalType(FunctionSyntax syntax) => _functionBodyTypeCache[syntax];