11import { run } from './interpreter' ;
22
3- import { generateFromSnapshot , generateSnapshot , getNode } from '../syntax/tree/syntaxTree' ;
3+ import { generateFromSnapshot , generateSnapshot } from '../syntax/tree/syntaxTree' ;
44
55import { registerElementSpecificationEntries } from '../syntax/specification/specification' ;
66import elementSpecification from '../library/specification' ;
7- import { getInstance } from '../syntax/warehouse/warehouse' ;
87
98// -------------------------------------------------------------------------------------------------
109
@@ -37,9 +36,11 @@ describe('Interpreter', () => {
3736 argMap : {
3837 name : {
3938 elementName : 'value-string' ,
39+ value : 'a' ,
4040 } ,
4141 value : {
4242 elementName : 'value-number' ,
43+ value : '0' ,
4344 } ,
4445 } ,
4546 } ,
@@ -48,9 +49,11 @@ describe('Interpreter', () => {
4849 argMap : {
4950 name : {
5051 elementName : 'value-string' ,
52+ value : 'b' ,
5153 } ,
5254 value : {
5355 elementName : 'value-number' ,
56+ value : '1' ,
5457 } ,
5558 } ,
5659 } ,
@@ -59,9 +62,11 @@ describe('Interpreter', () => {
5962 argMap : {
6063 name : {
6164 elementName : 'value-string' ,
65+ value : 'c' ,
6266 } ,
6367 value : {
6468 elementName : 'value-number' ,
69+ value : '1' ,
6570 } ,
6671 } ,
6772 } ,
@@ -70,6 +75,7 @@ describe('Interpreter', () => {
7075 argMap : {
7176 times : {
7277 elementName : 'value-number' ,
78+ value : '10' ,
7379 } ,
7480 } ,
7581 scope : [
@@ -78,6 +84,7 @@ describe('Interpreter', () => {
7884 argMap : {
7985 value : {
8086 elementName : 'boxidentifier-number' ,
87+ value : 'c' ,
8188 } ,
8289 } ,
8390 } ,
@@ -86,15 +93,18 @@ describe('Interpreter', () => {
8693 argMap : {
8794 name : {
8895 elementName : 'value-string' ,
96+ value : 'c' ,
8997 } ,
9098 value : {
9199 elementName : 'operator-math-plus' ,
92100 argMap : {
93101 operand1 : {
94102 elementName : 'boxidentifier-number' ,
103+ value : 'a' ,
95104 } ,
96105 operand2 : {
97106 elementName : 'boxidentifier-number' ,
107+ value : 'b' ,
98108 } ,
99109 } ,
100110 } ,
@@ -105,9 +115,11 @@ describe('Interpreter', () => {
105115 argMap : {
106116 name : {
107117 elementName : 'value-string' ,
118+ value : 'a' ,
108119 } ,
109120 value : {
110121 elementName : 'boxidentifier-number' ,
122+ value : 'b' ,
111123 } ,
112124 } ,
113125 } ,
@@ -116,9 +128,11 @@ describe('Interpreter', () => {
116128 argMap : {
117129 name : {
118130 elementName : 'value-string' ,
131+ value : 'b' ,
119132 } ,
120133 value : {
121134 elementName : 'boxidentifier-number' ,
135+ value : 'c' ,
122136 } ,
123137 } ,
124138 } ,
@@ -132,75 +146,6 @@ describe('Interpreter', () => {
132146 } ) ;
133147 const snapshot = generateSnapshot ( ) ;
134148
135- getInstance (
136- // @ts -ignore
137- getNode ( snapshot . process [ 0 ] . scope [ 0 ] . argMap [ 'name' ] [ 'nodeID' ] ) ! . instanceID
138- ) ! . instance . updateLabel ( 'a' ) ;
139- getInstance (
140- // @ts -ignore
141- getNode ( snapshot . process [ 0 ] . scope [ 0 ] . argMap [ 'value' ] [ 'nodeID' ] ) ! . instanceID
142- ) ! . instance . updateLabel ( '0' ) ;
143- getInstance (
144- // @ts -ignore
145- getNode ( snapshot . process [ 0 ] . scope [ 1 ] . argMap [ 'name' ] [ 'nodeID' ] ) ! . instanceID
146- ) ! . instance . updateLabel ( 'b' ) ;
147- getInstance (
148- // @ts -ignore
149- getNode ( snapshot . process [ 0 ] . scope [ 1 ] . argMap [ 'value' ] [ 'nodeID' ] ) ! . instanceID
150- ) ! . instance . updateLabel ( '1' ) ;
151- getInstance (
152- // @ts -ignore
153- getNode ( snapshot . process [ 0 ] . scope [ 2 ] . argMap [ 'name' ] [ 'nodeID' ] ) ! . instanceID
154- ) ! . instance . updateLabel ( 'c' ) ;
155- getInstance (
156- // @ts -ignore
157- getNode ( snapshot . process [ 0 ] . scope [ 2 ] . argMap [ 'value' ] [ 'nodeID' ] ) ! . instanceID
158- ) ! . instance . updateLabel ( '1' ) ;
159- getInstance (
160- // @ts -ignore
161- getNode ( snapshot . process [ 0 ] . scope [ 3 ] . argMap [ 'times' ] [ 'nodeID' ] ) ! . instanceID
162- ) ! . instance . updateLabel ( '10' ) ;
163- getInstance (
164- // @ts -ignore
165- getNode ( snapshot . process [ 0 ] . scope [ 3 ] . scope [ 0 ] . argMap [ 'value' ] [ 'nodeID' ] ) ! . instanceID
166- ) ! . instance . updateLabel ( 'c' ) ;
167- getInstance (
168- // @ts -ignore
169- getNode ( snapshot . process [ 0 ] . scope [ 3 ] . scope [ 1 ] . argMap [ 'name' ] [ 'nodeID' ] ) ! . instanceID
170- ) ! . instance . updateLabel ( 'c' ) ;
171- getInstance (
172- getNode (
173- // @ts -ignore
174- snapshot . process [ 0 ] . scope [ 3 ] . scope [ 1 ] . argMap [ 'value' ] [ 'argMap' ] [ 'operand1' ] [
175- 'nodeID'
176- ]
177- ) ! . instanceID
178- ) ! . instance . updateLabel ( 'a' ) ;
179- getInstance (
180- getNode (
181- // @ts -ignore
182- snapshot . process [ 0 ] . scope [ 3 ] . scope [ 1 ] . argMap [ 'value' ] [ 'argMap' ] [ 'operand2' ] [
183- 'nodeID'
184- ]
185- ) ! . instanceID
186- ) ! . instance . updateLabel ( 'b' ) ;
187- getInstance (
188- // @ts -ignore
189- getNode ( snapshot . process [ 0 ] . scope [ 3 ] . scope [ 2 ] . argMap [ 'name' ] [ 'nodeID' ] ) ! . instanceID
190- ) ! . instance . updateLabel ( 'a' ) ;
191- getInstance (
192- // @ts -ignore
193- getNode ( snapshot . process [ 0 ] . scope [ 3 ] . scope [ 2 ] . argMap [ 'value' ] [ 'nodeID' ] ) ! . instanceID
194- ) ! . instance . updateLabel ( 'b' ) ;
195- getInstance (
196- // @ts -ignore
197- getNode ( snapshot . process [ 0 ] . scope [ 3 ] . scope [ 3 ] . argMap [ 'name' ] [ 'nodeID' ] ) ! . instanceID
198- ) ! . instance . updateLabel ( 'b' ) ;
199- getInstance (
200- // @ts -ignore
201- getNode ( snapshot . process [ 0 ] . scope [ 3 ] . scope [ 3 ] . argMap [ 'value' ] [ 'nodeID' ] ) ! . instanceID
202- ) ! . instance . updateLabel ( 'c' ) ;
203-
204149 const node = snapshot . process [ 0 ] ;
205150 run ( node . nodeID ) ;
206151 } ) ;
0 commit comments