File tree Expand file tree Collapse file tree 2 files changed +21
-8
lines changed
src/main/java/org/byteskript/skript/compiler Expand file tree Collapse file tree 2 files changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,6 @@ Tasks are categorised by importance and marked by difficulty.
12
12
- Finish documentation for built-in syntax. \
13
13
Some syntax is missing proper [ documentation] ( https://moderocky.gitbook.io/byteskript/ ) . \
14
14
Difficulty: trivial
15
- - Make proper handlers for property expressions. \
16
- The current system is inadequate for complex properties.
17
- Difficulty: medium
18
15
- Write more comprehensive tests. \
19
16
It is important to test all expected behaviour - some syntax are missing full tests. \
20
17
It is also important to test forbidden behaviour does * not* work, and proper negative tests are not implemented yet. \
@@ -23,10 +20,6 @@ Tasks are categorised by importance and marked by difficulty.
23
20
24
21
### Medium Importance
25
22
26
- - Create a library for interacting with Java directly. \
27
- This will allow a lot more to be done within scripts, rather than relying on libraries to provide complex
28
- functionality. \
29
- Difficulty: hard
30
23
- Create a library for Java GUIs. \
31
24
This will probably need to interact with JavaFX. \
32
25
This should be handled by somebody with experience using Java front-end. \
Original file line number Diff line number Diff line change @@ -23,9 +23,29 @@ public class Pattern { // todo remove regex go indexOf impl
23
23
private static final char ESCAPE = '\\' ;
24
24
25
25
protected final String [] patterns ;
26
- protected final Map < java . util . regex . Pattern , String []> patternMap = new HashMap <> ();
26
+ protected final PatternMap patternMap = new PatternMap (); // maintains entry order
27
27
protected final Library provider ;
28
28
29
+ protected static class PatternMap extends ArrayList <Map .Entry <java .util .regex .Pattern , String []>> {
30
+ public void put (java .util .regex .Pattern pattern , String [] lines ) {
31
+ add (new AbstractMap .SimpleEntry <>(pattern , lines ));
32
+ }
33
+
34
+ public List <java .util .regex .Pattern > keySet () {
35
+ final List <java .util .regex .Pattern > list = new ArrayList <>();
36
+ for (Map .Entry <java .util .regex .Pattern , String []> entry : this ) {
37
+ list .add (entry .getKey ());
38
+ }
39
+ return list ;
40
+ }
41
+
42
+ public String [] get (java .util .regex .Pattern pattern ) {
43
+ for (Map .Entry <java .util .regex .Pattern , String []> entry : this ) {
44
+ if (entry .getKey ().equals (pattern )) return entry .getValue ();
45
+ }
46
+ return null ;
47
+ }
48
+ }
29
49
30
50
public Pattern (String [] patterns , Library provider ) {
31
51
assert patterns != null ;
You can’t perform that action at this time.
0 commit comments