|
@@ -256,24 +256,23 @@ begin
|
|
|
' return this;',
|
|
|
' };',
|
|
|
' }, true);',
|
|
|
+ ' $mod.$implcode = function () {',
|
|
|
+ ' rtl.recNewT($impl, "TBird", function () {',
|
|
|
+ ' this.b = 0;',
|
|
|
+ ' this.$eq = function (b) {',
|
|
|
+ ' return this.b === b.b;',
|
|
|
+ ' };',
|
|
|
+ ' this.$assign = function (s) {',
|
|
|
+ ' this.b = s.b;',
|
|
|
+ ' return this;',
|
|
|
+ ' };',
|
|
|
+ ' });',
|
|
|
+ ' $impl.f = $mod.TAnt$G1.$new();',
|
|
|
+ ' };',
|
|
|
' $mod.$init = function () {',
|
|
|
' $impl.f.x.b = $impl.f.x.b + 10;',
|
|
|
' };',
|
|
|
- '}, [], function () {',
|
|
|
- ' var $mod = this;',
|
|
|
- ' var $impl = $mod.$impl;',
|
|
|
- ' rtl.recNewT($impl, "TBird", function () {',
|
|
|
- ' this.b = 0;',
|
|
|
- ' this.$eq = function (b) {',
|
|
|
- ' return this.b === b.b;',
|
|
|
- ' };',
|
|
|
- ' this.$assign = function (s) {',
|
|
|
- ' this.b = s.b;',
|
|
|
- ' return this;',
|
|
|
- ' };',
|
|
|
- ' });',
|
|
|
- ' $impl.f = $mod.TAnt$G1.$new();',
|
|
|
- '});']));
|
|
|
+ '}, []);']));
|
|
|
CheckSource('TestGen_Record_ClassVarRecord_UnitImpl',
|
|
|
LinesToStr([ // statements
|
|
|
'pas.UnitA.TAnt$G1.$initSpec();',
|
|
@@ -1151,24 +1150,23 @@ begin
|
|
|
' this.a = rtl.arraySetLength(null, $impl.TBird, 2);',
|
|
|
' };',
|
|
|
' });',
|
|
|
+ ' $mod.$implcode = function () {',
|
|
|
+ ' rtl.recNewT($impl, "TBird", function () {',
|
|
|
+ ' this.b = 0;',
|
|
|
+ ' this.$eq = function (b) {',
|
|
|
+ ' return this.b === b.b;',
|
|
|
+ ' };',
|
|
|
+ ' this.$assign = function (s) {',
|
|
|
+ ' this.b = s.b;',
|
|
|
+ ' return this;',
|
|
|
+ ' };',
|
|
|
+ ' });',
|
|
|
+ ' $impl.f = null;',
|
|
|
+ ' };',
|
|
|
' $mod.$init = function () {',
|
|
|
' $impl.f.x.b = $impl.f.x.b + 10;',
|
|
|
' };',
|
|
|
- '}, [], function () {',
|
|
|
- ' var $mod = this;',
|
|
|
- ' var $impl = $mod.$impl;',
|
|
|
- ' rtl.recNewT($impl, "TBird", function () {',
|
|
|
- ' this.b = 0;',
|
|
|
- ' this.$eq = function (b) {',
|
|
|
- ' return this.b === b.b;',
|
|
|
- ' };',
|
|
|
- ' this.$assign = function (s) {',
|
|
|
- ' this.b = s.b;',
|
|
|
- ' return this;',
|
|
|
- ' };',
|
|
|
- ' });',
|
|
|
- ' $impl.f = null;',
|
|
|
- '});']));
|
|
|
+ '}, []);']));
|
|
|
CheckSource('TestGen_Class_ClassVarRecord_UnitImpl',
|
|
|
LinesToStr([ // statements
|
|
|
'pas.UnitA.TAnt$G1.$initSpec();',
|
|
@@ -1363,26 +1361,25 @@ begin
|
|
|
' $mod.$rtti.$ExtClass("TAnt<UnitA.TBird>", {',
|
|
|
' jsclass: "SET"',
|
|
|
' });',
|
|
|
+ ' $mod.$implcode = function () {',
|
|
|
+ ' rtl.recNewT($impl, "TBird", function () {',
|
|
|
+ ' this.b = 0;',
|
|
|
+ ' this.$eq = function (b) {',
|
|
|
+ ' return this.b === b.b;',
|
|
|
+ ' };',
|
|
|
+ ' this.$assign = function (s) {',
|
|
|
+ ' this.b = s.b;',
|
|
|
+ ' return this;',
|
|
|
+ ' };',
|
|
|
+ ' var $r = $mod.$rtti.$Record("TBird", {});',
|
|
|
+ ' $r.addField("b", rtl.word);',
|
|
|
+ ' });',
|
|
|
+ ' $impl.f = null;',
|
|
|
+ ' };',
|
|
|
' $mod.$init = function () {',
|
|
|
' $impl.f.x.b = $impl.f.x.b + 10;',
|
|
|
' };',
|
|
|
- '}, [], function () {',
|
|
|
- ' var $mod = this;',
|
|
|
- ' var $impl = $mod.$impl;',
|
|
|
- ' rtl.recNewT($impl, "TBird", function () {',
|
|
|
- ' this.b = 0;',
|
|
|
- ' this.$eq = function (b) {',
|
|
|
- ' return this.b === b.b;',
|
|
|
- ' };',
|
|
|
- ' this.$assign = function (s) {',
|
|
|
- ' this.b = s.b;',
|
|
|
- ' return this;',
|
|
|
- ' };',
|
|
|
- ' var $r = $mod.$rtti.$Record("TBird", {});',
|
|
|
- ' $r.addField("b", rtl.word);',
|
|
|
- ' });',
|
|
|
- ' $impl.f = null;',
|
|
|
- '});']));
|
|
|
+ '}, []);']));
|
|
|
CheckSource('TestGen_Class_ClassVarRecord_UnitImpl',
|
|
|
LinesToStr([ // statements
|
|
|
//'pas.UnitA.TAnt$G1.$initSpec();',
|
|
@@ -1560,15 +1557,14 @@ begin
|
|
|
' $impl.DoIt();',
|
|
|
' };',
|
|
|
' });',
|
|
|
- '}, [], function () {',
|
|
|
- ' var $mod = this;',
|
|
|
- ' var $impl = $mod.$impl;',
|
|
|
- ' $impl.DoIt = function () {',
|
|
|
- ' var b = null;',
|
|
|
- ' b = $mod.TBird$G2.$create("Create");',
|
|
|
- ' b.Fly();',
|
|
|
+ ' $mod.$implcode = function () {',
|
|
|
+ ' $impl.DoIt = function () {',
|
|
|
+ ' var b = null;',
|
|
|
+ ' b = $mod.TBird$G2.$create("Create");',
|
|
|
+ ' b.Fly();',
|
|
|
+ ' };',
|
|
|
' };',
|
|
|
- '});',
|
|
|
+ '}, []);',
|
|
|
'']));
|
|
|
end;
|
|
|
|
|
@@ -2082,28 +2078,27 @@ begin
|
|
|
' $mod.$rtti.$StaticArray("TStatic<UnitA.TBird>", {',
|
|
|
' dims: [2]',
|
|
|
' });',
|
|
|
+ ' $mod.$implcode = function () {',
|
|
|
+ ' rtl.recNewT($impl, "TBird", function () {',
|
|
|
+ ' this.b = 0;',
|
|
|
+ ' this.$eq = function (b) {',
|
|
|
+ ' return this.b === b.b;',
|
|
|
+ ' };',
|
|
|
+ ' this.$assign = function (s) {',
|
|
|
+ ' this.b = s.b;',
|
|
|
+ ' return this;',
|
|
|
+ ' };',
|
|
|
+ ' var $r = $mod.$rtti.$Record("TBird", {});',
|
|
|
+ ' $r.addField("b", rtl.word);',
|
|
|
+ ' });',
|
|
|
+ ' $impl.d = [];',
|
|
|
+ ' $impl.s = rtl.arraySetLength(null, $impl.TBird, 2);',
|
|
|
+ ' };',
|
|
|
' $mod.$init = function () {',
|
|
|
' $impl.d[0].b = $impl.s[0].b;',
|
|
|
' $impl.s = $mod.TStatic$G1$clone($impl.s);',
|
|
|
' };',
|
|
|
- '}, [], function () {',
|
|
|
- ' var $mod = this;',
|
|
|
- ' var $impl = $mod.$impl;',
|
|
|
- ' rtl.recNewT($impl, "TBird", function () {',
|
|
|
- ' this.b = 0;',
|
|
|
- ' this.$eq = function (b) {',
|
|
|
- ' return this.b === b.b;',
|
|
|
- ' };',
|
|
|
- ' this.$assign = function (s) {',
|
|
|
- ' this.b = s.b;',
|
|
|
- ' return this;',
|
|
|
- ' };',
|
|
|
- ' var $r = $mod.$rtti.$Record("TBird", {});',
|
|
|
- ' $r.addField("b", rtl.word);',
|
|
|
- ' });',
|
|
|
- ' $impl.d = [];',
|
|
|
- ' $impl.s = rtl.arraySetLength(null, $impl.TBird, 2);',
|
|
|
- '});']));
|
|
|
+ '}, []);']));
|
|
|
CheckSource('TestGen_Class_ClassVarRecord_UnitImpl',
|
|
|
LinesToStr([ // statements
|
|
|
'pas.UnitA.$rtti["TDyn<UnitA.TBird>"].eltype = pas.UnitA.$rtti["TBird"];',
|
|
@@ -2205,29 +2200,28 @@ begin
|
|
|
' this.procsig = rtl.newTIProcSig([["a", $mod.$rtti["TBird"], 2]], $mod.$rtti["TBird"]);',
|
|
|
' }',
|
|
|
' });',
|
|
|
+ ' $mod.$implcode = function () {',
|
|
|
+ ' rtl.recNewT($impl, "TBird", function () {',
|
|
|
+ ' this.b = 0;',
|
|
|
+ ' this.$eq = function (b) {',
|
|
|
+ ' return this.b === b.b;',
|
|
|
+ ' };',
|
|
|
+ ' this.$assign = function (s) {',
|
|
|
+ ' this.b = s.b;',
|
|
|
+ ' return this;',
|
|
|
+ ' };',
|
|
|
+ ' var $r = $mod.$rtti.$Record("TBird", {});',
|
|
|
+ ' $r.addField("b", rtl.word);',
|
|
|
+ ' });',
|
|
|
+ ' $impl.f = null;',
|
|
|
+ ' $impl.b = $impl.TBird.$new();',
|
|
|
+ ' $impl.p = null;',
|
|
|
+ ' };',
|
|
|
' $mod.$init = function () {',
|
|
|
' $impl.b.$assign($impl.f($impl.b));',
|
|
|
' $impl.p = $mod.$rtti["TAnt<UnitA.TBird>"];',
|
|
|
' };',
|
|
|
- '}, [], function () {',
|
|
|
- ' var $mod = this;',
|
|
|
- ' var $impl = $mod.$impl;',
|
|
|
- ' rtl.recNewT($impl, "TBird", function () {',
|
|
|
- ' this.b = 0;',
|
|
|
- ' this.$eq = function (b) {',
|
|
|
- ' return this.b === b.b;',
|
|
|
- ' };',
|
|
|
- ' this.$assign = function (s) {',
|
|
|
- ' this.b = s.b;',
|
|
|
- ' return this;',
|
|
|
- ' };',
|
|
|
- ' var $r = $mod.$rtti.$Record("TBird", {});',
|
|
|
- ' $r.addField("b", rtl.word);',
|
|
|
- ' });',
|
|
|
- ' $impl.f = null;',
|
|
|
- ' $impl.b = $impl.TBird.$new();',
|
|
|
- ' $impl.p = null;',
|
|
|
- '});']));
|
|
|
+ '}, []);']));
|
|
|
CheckSource('TestGen_Class_ClassVarRecord_UnitImpl',
|
|
|
LinesToStr([ // statements
|
|
|
'pas.UnitA.$rtti["TAnt<UnitA.TBird>"].init();',
|