2
0
mirror of https://github.com/esiur/esiur-dart.git synced 2026-04-04 02:08:21 +00:00
This commit is contained in:
2022-03-12 16:21:29 +03:00
parent 92a26b8ce5
commit 88eba227ae
64 changed files with 38165 additions and 2952 deletions

View File

@@ -4,46 +4,40 @@ import '../../Data/BinaryList.dart';
import 'TypeTemplate.dart';
import 'MemberType.dart';
import 'ArgumentTemplate.dart';
import 'TemplateDataType.dart';
import '../../Data/RepresentationType.dart';
class FunctionTemplate extends MemberTemplate {
String? expansion;
// bool isVoid;
// bool isVoid;
TemplateDataType returnType;
List<ArgumentTemplate> arguments;
RepresentationType returnType;
DC compose() {
var name = super.compose();
var name = super.compose();
var bl = new BinaryList()
..addUint8(name.length)
..addDC(name)
..addDC(returnType.compose())
..addUint8(arguments.length);
var bl = new BinaryList()
..addUint8(name.length)
..addDC(name)
..addDC(returnType.compose())
..addUint8(arguments.length);
for (var i = 0; i < arguments.length; i++)
bl.addDC(arguments[i].compose());
for (var i = 0; i < arguments.length; i++) bl.addDC(arguments[i].compose());
if (expansion != null) {
var exp = DC.stringToBytes(expansion as String);
bl
..addInt32(exp.length)
..addDC(exp);
bl.insertUint8(0, inherited ? 0x90 : 0x10);
} else
bl.insertUint8(0, inherited ? 0x80 : 0x0);
if (expansion != null)
{
var exp = DC.stringToBytes(expansion as String);
bl..addInt32(exp.length)
..addDC(exp);
bl.insertUint8(0, 0x10);
}
else
bl.insertUint8(0, 0x0);
return bl.toDC();
return bl.toDC();
}
FunctionTemplate(TypeTemplate template, int index, String name,
this.arguments, this.returnType, this.expansion)
: super(template, MemberType.Property, index, name) {
}
bool inherited, this.arguments, this.returnType,
[this.expansion = null])
: super(template, index, name, inherited) {}
}