-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJITTest2.clcl
112 lines (92 loc) · 2.82 KB
/
JITTest2.clcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
inherit JITTest
{
def selector(): String {
result:String = "";
a := 0;
if(a == 0) {
/*
end_of_select := false;
canceled := false;
maxx := 123;
maxy := 123;
lines := { "AAA", "BBB", "CCC" }
scrolltop := 0;
cursor := 0;
space_string1 := "AAA";
space_string2 := "BBB";
while(!end_of_select) {
maxy2 := 3 -scrolltop;
### view ###
for(i:=0; i<maxy; i++) {
if(i == maxy -1) {
space_string2;
}
else {
space_string1;
}
}
for(y:=0; y<maxy && y < maxy2; y++) {
it := "AAA";
line := "BBBB";
if(cursor == y) {
123;
}
else {
234;
}
}
123;
### input ###
key := 123;
when(key) {
case (KEY_UP, 'k'.to_int, ('P'-'A').to_int+1) {
cursor--;
}
case (KEY_DOWN, 'j'.to_int, ('N'-'A').to_int+1) {
cursor++;
}
case (('D'-'A').to_int+1) {
cursor+=10;
}
case (('U'-'A').to_int+1) {
cursor-=10;
}
case (('C'-'A').to_int+1, 'q'.to_int, ('['-'A').to_int+1) {
canceled = true;
end_of_select = true;
}
case (KEY_ENTER, ('J'-'A').to_int+1) {
end_of_select = true;
}
}
### modification ###
if(cursor < 0) {
scroll_size := -cursor +1;
cursor = 0;
scrolltop-=scroll_size;
if(scrolltop < 0) {
scrolltop = 0;
cursor = 0;
}
}
if(maxy2 < maxy) {
if(cursor >= maxy2) {
cursor = maxy2 - 1;
}
}
else {
if(cursor >= maxy) {
scroll_size := cursor - maxy + 1;
scrolltop += scroll_size;
cursor -= scroll_size;
}
}
}
if(!canceled) {
result = "AAA";
}
*/
}
return "AAA";
}
}