File tree Expand file tree Collapse file tree 4 files changed +164
-158
lines changed Expand file tree Collapse file tree 4 files changed +164
-158
lines changed Original file line number Diff line number Diff line change
1
+ const EasyCoder_IWSY = {
2
+
3
+ name : `EasyCoder_IWSY` ,
4
+
5
+ iwsy : {
6
+ } ,
7
+
8
+ IWSY : {
9
+
10
+ compile : ( compiler ) => {
11
+
12
+ const lino = compiler . getLino ( ) ;
13
+ const action = compiler . nextToken ( ) ;
14
+ if ( [ `init` , `show` ] . includes ( action ) ) {
15
+ compiler . next ( ) ;
16
+ compiler . addCommand ( {
17
+ domain : `iwsy` ,
18
+ keyword : `iwsy` ,
19
+ lino,
20
+ action
21
+ } ) ;
22
+ return true ;
23
+ }
24
+ return false ;
25
+ } ,
26
+
27
+ run : ( program ) => {
28
+ const command = program [ program . pc ] ;
29
+ const action = command . action ;
30
+ switch ( action ) {
31
+ case `init` :
32
+ program . require ( `js` , `iwsy.js` ,
33
+ function ( ) {
34
+ program . run ( command . pc + 1 ) ;
35
+ } ) ;
36
+ break ;
37
+ case `show` :
38
+ break ;
39
+ }
40
+ return command . pc + 1 ;
41
+ }
42
+ } ,
43
+
44
+ getHandler : ( name ) => {
45
+ switch ( name ) {
46
+ case `iwsy` :
47
+ return EasyCoder_IWSY . IWSY ;
48
+ default :
49
+ return null ;
50
+ }
51
+ } ,
52
+
53
+ run : program => {
54
+ const command = program [ program . pc ] ;
55
+ const handler = EasyCoder_IWSY . getHandler ( command . keyword ) ;
56
+ if ( ! handler ) {
57
+ program . runtimeError ( command . lino , `Unknown keyword '${ command . keyword } ' in 'iwsy' package` ) ;
58
+ }
59
+ return handler . run ( program ) ;
60
+ } ,
61
+
62
+ value : {
63
+
64
+ compile : ( ) => {
65
+ return null ;
66
+ } ,
67
+
68
+ get : ( ) => {
69
+ return null ;
70
+ }
71
+ } ,
72
+
73
+ condition : {
74
+
75
+ compile : ( ) => { } ,
76
+
77
+ test : ( ) => { }
78
+ }
79
+ } ;
80
+
81
+ // eslint-disable-next-line no-unused-vars
82
+ EasyCoder . domain . iwsy = EasyCoder_IWSY ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ const EasyCoder_IWSY = {
2
+
3
+ name : `EasyCoder_IWSY` ,
4
+
5
+ iwsy : {
6
+ } ,
7
+
8
+ IWSY : {
9
+
10
+ compile : ( compiler ) => {
11
+
12
+ const lino = compiler . getLino ( ) ;
13
+ const action = compiler . nextToken ( ) ;
14
+ if ( [ `init` , `show` ] . includes ( action ) ) {
15
+ compiler . next ( ) ;
16
+ compiler . addCommand ( {
17
+ domain : `iwsy` ,
18
+ keyword : `iwsy` ,
19
+ lino,
20
+ action
21
+ } ) ;
22
+ return true ;
23
+ }
24
+ return false ;
25
+ } ,
26
+
27
+ run : ( program ) => {
28
+ const command = program [ program . pc ] ;
29
+ const action = command . action ;
30
+ switch ( action ) {
31
+ case `init` :
32
+ program . require ( `js` , `iwsy.js` ,
33
+ function ( ) {
34
+ program . run ( command . pc + 1 ) ;
35
+ } ) ;
36
+ break ;
37
+ case `show` :
38
+ break ;
39
+ }
40
+ return command . pc + 1 ;
41
+ }
42
+ } ,
43
+
44
+ getHandler : ( name ) => {
45
+ switch ( name ) {
46
+ case `iwsy` :
47
+ return EasyCoder_IWSY . IWSY ;
48
+ default :
49
+ return null ;
50
+ }
51
+ } ,
52
+
53
+ run : program => {
54
+ const command = program [ program . pc ] ;
55
+ const handler = EasyCoder_IWSY . getHandler ( command . keyword ) ;
56
+ if ( ! handler ) {
57
+ program . runtimeError ( command . lino , `Unknown keyword '${ command . keyword } ' in 'iwsy' package` ) ;
58
+ }
59
+ return handler . run ( program ) ;
60
+ } ,
61
+
62
+ value : {
63
+
64
+ compile : ( ) => {
65
+ return null ;
66
+ } ,
67
+
68
+ get : ( ) => {
69
+ return null ;
70
+ }
71
+ } ,
72
+
73
+ condition : {
74
+
75
+ compile : ( ) => { } ,
76
+
77
+ test : ( ) => { }
78
+ }
79
+ } ;
80
+
81
+ // eslint-disable-next-line no-unused-vars
82
+ EasyCoder . domain . iwsy = EasyCoder_IWSY ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments