-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathControls.java
More file actions
87 lines (71 loc) · 2.04 KB
/
Copy pathControls.java
File metadata and controls
87 lines (71 loc) · 2.04 KB
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
package cwp.parser;
import java.util.ArrayList;
public class Controls {
public static ArrayList<String> FLAT = new ArrayList<>();
public static ArrayList<String> VEC = new ArrayList<>();
public static ArrayList<String> MAP = new ArrayList<>();
public static ArrayList<String> CUSTOM_FLAT = new ArrayList<>();
public static ArrayList<String> CUSTOM_VEC = new ArrayList<>();
public static ArrayList<String> CUSTOM_MAP = new ArrayList<>();
public enum Type {
FLAT,
VEC,
MAP
}
static {
FLAT.add("while");
FLAT.add("case");
FLAT.add("cond");
FLAT.add("condp");
FLAT.add("cond->");
FLAT.add("cond->>");
FLAT.add("locking");
FLAT.add("time");
FLAT.add("when");
VEC.add("let");
VEC.add("letfn");
VEC.add("for");
VEC.add("loop");
VEC.add("doseq");
VEC.add("dotimes");
VEC.add("binding");
VEC.add("with-open");
VEC.add("with-redefs");
VEC.add("with-local-vars");
VEC.add("when-let");
VEC.add("when-first");
MAP.add("with-bindings");
MAP.add("with-redefs-fn");
}
public static boolean isFlat(String s) {
return FLAT.contains(s) || CUSTOM_FLAT.contains(s);
}
public static boolean isVec(String s) {
return VEC.contains(s) || CUSTOM_VEC.contains(s);
}
public static boolean isMap(String s) {
return MAP.contains(s) || CUSTOM_MAP.contains(s);
}
public static void addFlat(String s) {
remove(s);
CUSTOM_FLAT.add(s);
}
public static void addVec(String s) {
remove(s);
CUSTOM_VEC.add(s);
}
public static void addMap(String s) {
remove(s);
CUSTOM_MAP.add(s);
}
public static void remove(String s) {
CUSTOM_FLAT.remove(s);
CUSTOM_VEC.remove(s);
CUSTOM_MAP.remove(s);
}
public static void reset() {
CUSTOM_FLAT.clear();
CUSTOM_VEC.clear();
CUSTOM_MAP.clear();
}
}