Пример #1
0
        public static string GetMangledName(string fnName, FnTyRef fnTy)
        {
            var builder = new StringBuilder().Append("_S");

            builder.Append(fnName.Length);
            builder.Append(fnName);

            builder.Append(fnTy.parameterTys.Count);
            for (int i = 0, len = fnTy.parameterTys.Count; i < len; i++)
                builder.Append(GetTyName(fnTy.parameterTys[i].Raw));

            builder.Append("_R");
            builder.Append(GetTyName(fnTy.returnTy.Raw));

            return builder.ToString();
        }
Пример #2
0
 public void InsertFn(string fnName, Modifiers mods, FnTyRef ty) =>
     current.InsertFn(fnName, mods, ty);
Пример #3
0
 public void InsertFn(string fnName, Modifiers mods, FnTyRef ty) =>
     symbols[fnName] = new FnSymbol(fnName, mods, ty);
Пример #4
0
 public FnSymbol(string name, Modifiers mods, FnTyRef ty)
     : base(name, SymbolKind.FN)
 {
     this.mods = mods;
     this.ty = ty;
 }