1
- From 8dc0a7ea50bb88c18292c43003f6e5c00ecdf452 Mon Sep 17 00:00:00 2001
1
+ From 63822eb57c371d3e1a8ee3f3e7d7936d975ace33 Mon Sep 17 00:00:00 2001
2
2
From: EXL <exlmotodev@gmail.com>
3
- Date: Thu, 17 Dec 2020 22:02:36 +0700
4
- Subject: [PATCH 2/2 ] Disable GraalPython
3
+ Date: Tue, 19 Jan 2021 19:35:37 +0700
4
+ Subject: [PATCH] Disable GraalPython
5
5
6
6
---
7
- .../code/highlight/HighlightService.java | 30 +++++++++----------
8
- .../code/highlight/enumeration/Mode.java | 19 ++++++- -----
7
+ .../code/highlight/HighlightService.java | 36 +++++++++----------
8
+ .../code/highlight/enumeration/Mode.java | 19 +++++-----
9
9
.../code/highlight/HighlightServiceTest.java | 6 ++--
10
10
.../highlight/enumeration/ModeUnitTest.java | 6 ++--
11
- 4 files changed, 31 insertions(+), 30 deletions(-)
11
+ 4 files changed, 34 insertions(+), 33 deletions(-)
12
12
13
13
diff --git a/src/main/java/ru/exlmoto/code/highlight/HighlightService.java b/src/main/java/ru/exlmoto/code/highlight/HighlightService.java
14
- index 1044a3e..2ef4276 100644
14
+ index bd1b174..e759d82 100644
15
15
--- a/src/main/java/ru/exlmoto/code/highlight/HighlightService.java
16
16
+++ b/src/main/java/ru/exlmoto/code/highlight/HighlightService.java
17
- @@ -15 ,7 +15 ,7 @@ import ru.exlmoto.code.helper.UtilityHelper;
17
+ @@ -39 ,7 +39 ,7 @@ import ru.exlmoto.code.helper.UtilityHelper;
18
18
import ru.exlmoto.code.highlight.enumeration.Mode;
19
19
import ru.exlmoto.code.highlight.filter.HighlightFilter;
20
20
import ru.exlmoto.code.highlight.implementation.HighlightJs;
@@ -23,7 +23,7 @@ index 1044a3e..2ef4276 100644
23
23
import ru.exlmoto.code.highlight.implementation.HighlightRouge;
24
24
import ru.exlmoto.code.highlight.parser.Options;
25
25
import ru.exlmoto.code.highlight.parser.OptionsParser;
26
- @@ -28 ,7 +28 ,7 @@ import java.util.Map;
26
+ @@ -52 ,7 +52 ,7 @@ import java.util.Map;
27
27
28
28
import static ru.exlmoto.code.highlight.enumeration.Mode.HighlightJs;
29
29
import static ru.exlmoto.code.highlight.enumeration.Mode.HighlightRouge;
@@ -32,7 +32,7 @@ index 1044a3e..2ef4276 100644
32
32
//import static ru.exlmoto.code.highlight.enumeration.Mode.HighlightPygmentsJython;
33
33
34
34
@Service
35
- @@ -43 ,7 +43 ,7 @@ public class HighlightService {
35
+ @@ -67 ,7 +67 ,7 @@ public class HighlightService {
36
36
private final CodeConfiguration config;
37
37
38
38
private final HighlightJs highlightJs;
@@ -41,7 +41,7 @@ index 1044a3e..2ef4276 100644
41
41
private final HighlightRouge highlightRouge;
42
42
43
43
private final Map<Mode, Pair<String, String>> versions;
44
- @@ -54 ,7 +54 ,7 @@ public class HighlightService {
44
+ @@ -78 ,7 +78 ,7 @@ public class HighlightService {
45
45
UtilityHelper util,
46
46
CodeConfiguration config,
47
47
HighlightJs highlightJs,
@@ -50,7 +50,7 @@ index 1044a3e..2ef4276 100644
50
50
HighlightRouge highlightRouge) {
51
51
this.context = context;
52
52
this.optionsParser = optionsParser;
53
- @@ -62 ,7 +62 ,7 @@ public class HighlightService {
53
+ @@ -86 ,7 +86 ,7 @@ public class HighlightService {
54
54
this.util = util;
55
55
this.config = config;
56
56
this.highlightJs = highlightJs;
@@ -59,7 +59,7 @@ index 1044a3e..2ef4276 100644
59
59
this.highlightRouge = highlightRouge;
60
60
61
61
this.versions = new HashMap<>();
62
- @@ -81 ,10 +81 ,10 @@ public class HighlightService {
62
+ @@ -105 ,10 +105 ,10 @@ public class HighlightService {
63
63
versions.get(HighlightRouge).getFirst(), versions.get(HighlightRouge).getSecond()));
64
64
65
65
// highlightPygments.setUseJython(false);
@@ -74,7 +74,7 @@ index 1044a3e..2ef4276 100644
74
74
75
75
// highlightPygments.setUseJython(true);
76
76
// versions.put(HighlightPygmentsJython,
77
- @@ -104 ,8 +104 ,8 @@ public class HighlightService {
77
+ @@ -128 ,8 +128 ,8 @@ public class HighlightService {
78
78
highlightRouge.generateCssStyle("base16")
79
79
.ifPresent((css) -> log.info(HighlightRouge.name() + ":\n" + css + "\n---\n"));
80
80
// highlightPygments.setUseJython(false);
@@ -85,21 +85,27 @@ index 1044a3e..2ef4276 100644
85
85
// highlightPygments.setUseJython(true);
86
86
// highlightPygments.generateCssStyle("vim")
87
87
// .ifPresent((css) -> log.info(HighlightPygmentsJython.name() + ":\n" + css + "\n---\n"));
88
- @@ -169,10 +169,10 @@ public class HighlightService {
89
- case HighlightRouge: {
90
- return highlightRouge.renderHtmlFromCode(options.getLanguage(), code).orElseThrow(() -> error );
88
+ @@ -203,13 +203,13 @@ public class HighlightService {
89
+ highlightRouge.renderHtmlFromCode(options.getLanguage(), code).orElseThrow(() -> error)
90
+ );
91
91
}
92
92
- case HighlightPygments: {
93
93
+ // case HighlightPygments: {
94
94
// highlightPygments.setUseJython(false);
95
- - return highlightPygments.renderHtmlFromCode(options.getLanguage(), code).orElseThrow(() -> error);
95
+ - return Pair.of(
96
+ - true,
97
+ - highlightPygments.renderHtmlFromCode(options.getLanguage(), code).orElseThrow(() -> error)
98
+ - );
96
99
- }
97
- + // return highlightPygments.renderHtmlFromCode(options.getLanguage(), code).orElseThrow(() -> error);
100
+ + // return Pair.of(
101
+ + // true,
102
+ + // highlightPygments.renderHtmlFromCode(options.getLanguage(), code).orElseThrow(() -> error)
103
+ + // );
98
104
+ // }
99
105
// case HighlightPygmentsJython: {
100
106
// highlightPygments.setUseJython(true);
101
107
// return highlightPygments.renderHtmlFromCode(options.getLanguage(), code).orElseThrow(() -> error);
102
- @@ -194 ,7 +194 ,7 @@ public class HighlightService {
108
+ @@ -230 ,7 +230 ,7 @@ public class HighlightService {
103
109
this.versions = new HashMap<>();
104
110
versions.put(HighlightJs, Pair.of("20.3.0", "10.0.1"));
105
111
versions.put(HighlightRouge, Pair.of("2.6.6", "3.1.0"));
@@ -109,10 +115,10 @@ index 1044a3e..2ef4276 100644
109
115
}
110
116
111
117
diff --git a/src/main/java/ru/exlmoto/code/highlight/enumeration/Mode.java b/src/main/java/ru/exlmoto/code/highlight/enumeration/Mode.java
112
- index fe0edfd..6ffdb0a 100644
118
+ index 24e398d..e88a9e4 100644
113
119
--- a/src/main/java/ru/exlmoto/code/highlight/enumeration/Mode.java
114
120
+++ b/src/main/java/ru/exlmoto/code/highlight/enumeration/Mode.java
115
- @@ -8 ,7 +8 ,8 @@ public enum Mode {
121
+ @@ -32 ,7 +32 ,8 @@ public enum Mode {
116
122
HighlightJs,
117
123
HighlightRouge,
118
124
// HighlightPygmentsJython,
@@ -122,7 +128,7 @@ index fe0edfd..6ffdb0a 100644
122
128
123
129
public static String getName(Mode mode) {
124
130
switch (mode) {
125
- @@ -17 ,9 +18 ,9 @@ public enum Mode {
131
+ @@ -41 ,9 +42 ,9 @@ public enum Mode {
126
132
return "Highlight.js";
127
133
case HighlightRouge:
128
134
return "Rouge";
@@ -134,7 +140,7 @@ index fe0edfd..6ffdb0a 100644
134
140
}
135
141
}
136
142
137
- @@ -28 ,7 +29 ,7 @@ public enum Mode {
143
+ @@ -52 ,7 +53 ,7 @@ public enum Mode {
138
144
default:
139
145
case HighlightJs:
140
146
case HighlightRouge:
@@ -143,7 +149,7 @@ index fe0edfd..6ffdb0a 100644
143
149
return "GraalVM";
144
150
// case HighlightPygmentsJython:
145
151
// return "Jython";
146
- @@ -44 ,8 +45 ,8 @@ public enum Mode {
152
+ @@ -68 ,8 +69 ,8 @@ public enum Mode {
147
153
return "code.table.moderate";
148
154
// case HighlightPygmentsJython:
149
155
// return "code.table.slow";
@@ -154,7 +160,7 @@ index fe0edfd..6ffdb0a 100644
154
160
}
155
161
}
156
162
157
- @@ -56 ,9 +57 ,9 @@ public enum Mode {
163
+ @@ -80 ,9 +81 ,9 @@ public enum Mode {
158
164
return "JavaScript";
159
165
case HighlightRouge:
160
166
return "Ruby";
@@ -166,7 +172,7 @@ index fe0edfd..6ffdb0a 100644
166
172
}
167
173
}
168
174
169
- @@ -74 ,7 +75 ,7 @@ public enum Mode {
175
+ @@ -98 ,7 +99 ,7 @@ public enum Mode {
170
176
public static String getCss(Mode mode, Skin theme) {
171
177
switch (mode) {
172
178
case HighlightRouge:
@@ -176,10 +182,10 @@ index fe0edfd..6ffdb0a 100644
176
182
return "static/css/" + theme.name() + "/merged.css";
177
183
}
178
184
diff --git a/src/test/java/ru/exlmoto/code/highlight/HighlightServiceTest.java b/src/test/java/ru/exlmoto/code/highlight/HighlightServiceTest.java
179
- index 3f53477..d51de50 100644
185
+ index 2889c57..14bf848 100644
180
186
--- a/src/test/java/ru/exlmoto/code/highlight/HighlightServiceTest.java
181
187
+++ b/src/test/java/ru/exlmoto/code/highlight/HighlightServiceTest.java
182
- @@ -53 ,14 +53 ,14 @@ class HighlightServiceTest {
188
+ @@ -77 ,14 +77 ,14 @@ class HighlightServiceTest {
183
189
resource.readFileToString("classpath:/expected/HighlightJs/" + filename + ".html.txt");
184
190
String htmlRouge =
185
191
resource.readFileToString("classpath:/expected/Rouge/" + filename + ".html.txt");
@@ -198,10 +204,10 @@ index 3f53477..d51de50 100644
198
204
}
199
205
200
206
diff --git a/src/test/java/ru/exlmoto/code/highlight/enumeration/ModeUnitTest.java b/src/test/java/ru/exlmoto/code/highlight/enumeration/ModeUnitTest.java
201
- index 0a6f286..7562bd2 100644
207
+ index 61cd501..62f0744 100644
202
208
--- a/src/test/java/ru/exlmoto/code/highlight/enumeration/ModeUnitTest.java
203
209
+++ b/src/test/java/ru/exlmoto/code/highlight/enumeration/ModeUnitTest.java
204
- @@ -14 ,7 +14 ,7 @@ class ModeUnitTest {
210
+ @@ -38 ,7 +38 ,7 @@ class ModeUnitTest {
205
211
assertEquals(Mode.HighlightJs, Mode.getMode(" "));
206
212
assertEquals(Mode.HighlightJs, Mode.getMode("unknown"));
207
213
assertEquals(Mode.HighlightJs, Mode.getMode("HighlightJs"));
@@ -210,7 +216,7 @@ index 0a6f286..7562bd2 100644
210
216
// assertEquals(Mode.HighlightPygmentsJython, Mode.getMode("HighlightPygmentsJython"));
211
217
assertEquals(Mode.HighlightRouge, Mode.getMode("HighlightRouge"));
212
218
}
213
- @@ -22 ,11 +22 ,11 @@ class ModeUnitTest {
219
+ @@ -46 ,11 +46 ,11 @@ class ModeUnitTest {
214
220
@Test
215
221
public void testGetCss() {
216
222
assertEquals("static/css/techno/hjs.css", Mode.getCss(Mode.HighlightJs, Skin.techno));
0 commit comments