Skip to content

Commit c401728

Browse files
committed
support for erlang 27
fix #1043 fix #1042
1 parent c8c978e commit c401728

24 files changed

+468
-102
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
/jps-plugin/build/
1313
.gradle
1414
/out/
15-
/bin/
16-
/jps-plugin/out/
15+
/bin
16+
/jps-plugin/out/
17+
/jps-plugin/bin/

gen/org/intellij/erlang/ErlangTypes.java

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/org/intellij/erlang/parser/ErlangParser.java

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/org/intellij/erlang/parser/_ErlangLexer.java

Lines changed: 94 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,17 @@ private static int zzUnpackcmap_blocks(String packed, int offset, int [] result)
112112
"\1\41\1\32\1\42\1\43\1\44\1\45\1\46\2\0"+
113113
"\1\20\1\0\1\47\1\50\1\51\1\52\1\53\2\0"+
114114
"\1\54\1\55\1\56\1\57\1\60\1\61\15\32\1\62"+
115-
"\2\32\1\63\1\64\4\32\1\65\2\0\1\5\1\0"+
116-
"\1\41\1\66\1\67\1\20\1\70\1\20\1\71\1\72"+
117-
"\1\32\1\73\3\32\1\74\1\75\1\76\3\32\1\77"+
118-
"\1\32\1\100\1\101\1\32\1\102\2\32\1\103\1\104"+
119-
"\1\32\1\105\1\5\1\0\2\32\1\106\1\32\1\107"+
120-
"\1\110\1\111\1\32\1\112\3\32\1\113\1\0\1\70"+
121-
"\1\114\1\32\1\115\1\116\1\117\3\32\1\120\1\32"+
122-
"\1\121\1\122";
115+
"\2\32\1\63\1\64\4\32\1\65\2\0\1\37\1\0"+
116+
"\1\5\1\0\1\41\1\66\1\67\1\20\1\70\1\20"+
117+
"\1\71\1\72\1\32\1\73\3\32\1\74\1\75\1\76"+
118+
"\3\32\1\77\1\32\1\100\1\101\1\32\1\102\2\32"+
119+
"\1\103\1\104\1\32\1\105\1\0\1\5\1\0\2\32"+
120+
"\1\106\1\32\1\107\1\110\1\111\1\32\1\112\3\32"+
121+
"\1\113\2\0\1\70\1\114\1\32\1\115\1\116\1\117"+
122+
"\3\32\1\120\1\32\1\121\1\122";
123123

124124
private static int [] zzUnpackAction() {
125-
int [] result = new int[167];
125+
int [] result = new int[171];
126126
int offset = 0;
127127
offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
128128
return result;
@@ -153,24 +153,25 @@ private static int zzUnpackAction(String packed, int offset, int [] result) {
153153
"\0\u0438\0\u0474\0\264\0\264\0\u04b0\0\u04ec\0\u0528\0\u0564"+
154154
"\0\u05a0\0\u05dc\0\u0618\0\u0654\0\u0690\0\u06cc\0\u0708\0\u0744"+
155155
"\0\u0780\0\u07bc\0\u07f8\0\264\0\u0834\0\264\0\u0870\0\264"+
156-
"\0\u08ac\0\360\0\264\0\u08e8\0\u0924\0\264\0\u0960\0\u099c"+
157-
"\0\u09d8\0\264\0\264\0\264\0\264\0\u0a14\0\264\0\u0a50"+
158-
"\0\u0a8c\0\u0ac8\0\u0b04\0\264\0\264\0\264\0\264\0\264"+
159-
"\0\u0b40\0\u0b7c\0\264\0\264\0\264\0\264\0\264\0\264"+
160-
"\0\u0bb8\0\u0bf4\0\u0c30\0\u0c6c\0\u0ca8\0\u0ce4\0\u0d20\0\u0d5c"+
161-
"\0\u0d98\0\u0dd4\0\u0e10\0\u0e4c\0\u0e88\0\u0618\0\u0ec4\0\u0f00"+
162-
"\0\u0618\0\u0f3c\0\u0f78\0\u0fb4\0\u0ff0\0\u102c\0\264\0\u08ac"+
163-
"\0\u1068\0\u10a4\0\u10e0\0\u111c\0\u1158\0\264\0\u0a50\0\u1194"+
164-
"\0\u11d0\0\264\0\264\0\u120c\0\u1248\0\u1284\0\u12c0\0\u12fc"+
165-
"\0\u0618\0\u0618\0\u0618\0\u1338\0\u1374\0\u13b0\0\u0618\0\u13ec"+
166-
"\0\u0618\0\u0618\0\u1428\0\u0618\0\u1464\0\u14a0\0\u0618\0\u0618"+
167-
"\0\u14dc\0\u0618\0\u1518\0\u1554\0\u1590\0\u15cc\0\u0618\0\u1608"+
168-
"\0\u0618\0\u0618\0\u0618\0\u1644\0\u0618\0\u1680\0\u16bc\0\u16f8"+
169-
"\0\u0618\0\u1734\0\u1770\0\u0618\0\u17ac\0\u0618\0\u0618\0\u0618"+
170-
"\0\u17e8\0\u1824\0\u1860\0\u0618\0\u189c\0\u0618\0\u0618";
156+
"\0\u08ac\0\u08e8\0\u0924\0\u0960\0\u099c\0\264\0\u09d8\0\u0a14"+
157+
"\0\u0a50\0\264\0\264\0\264\0\264\0\u0a8c\0\264\0\u0ac8"+
158+
"\0\u0b04\0\u0b40\0\u0b7c\0\264\0\264\0\264\0\264\0\264"+
159+
"\0\u0bb8\0\u0bf4\0\264\0\264\0\264\0\264\0\264\0\264"+
160+
"\0\u0c30\0\u0c6c\0\u0ca8\0\u0ce4\0\u0d20\0\u0d5c\0\u0d98\0\u0dd4"+
161+
"\0\u0e10\0\u0e4c\0\u0e88\0\u0ec4\0\u0f00\0\u0618\0\u0f3c\0\u0f78"+
162+
"\0\u0618\0\u0fb4\0\u0ff0\0\u102c\0\u1068\0\u10a4\0\264\0\u08ac"+
163+
"\0\u10e0\0\264\0\u111c\0\u1158\0\u1194\0\u11d0\0\u120c\0\264"+
164+
"\0\u0ac8\0\u1248\0\u1284\0\264\0\264\0\u12c0\0\u12fc\0\u1338"+
165+
"\0\u1374\0\u13b0\0\u0618\0\u0618\0\u0618\0\u13ec\0\u1428\0\u1464"+
166+
"\0\u0618\0\u14a0\0\u0618\0\u0618\0\u14dc\0\u0618\0\u1518\0\u1554"+
167+
"\0\u0618\0\u0618\0\u1590\0\u0618\0\u15cc\0\u1608\0\u1644\0\u1680"+
168+
"\0\u16bc\0\u0618\0\u16f8\0\u0618\0\u0618\0\u0618\0\u1734\0\u0618"+
169+
"\0\u1770\0\u17ac\0\u17e8\0\u0618\0\u1824\0\u1860\0\u189c\0\u0618"+
170+
"\0\u18d8\0\u0618\0\u0618\0\u0618\0\u1914\0\u1950\0\u198c\0\u0618"+
171+
"\0\u19c8\0\u0618\0\u0618";
171172

172173
private static int [] zzUnpackRowMap() {
173-
int [] result = new int[167];
174+
int [] result = new int[171];
174175
int offset = 0;
175176
offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
176177
return result;
@@ -234,80 +235,83 @@ private static int zzUnpackRowMap(String packed, int offset, int [] result) {
234235
"\4\0\1\57\1\0\1\57\1\0\1\57\4\0\1\57"+
235236
"\5\0\3\57\1\151\2\57\1\0\1\57\1\0\3\57"+
236237
"\6\0\1\57\1\0\3\57\1\0\1\57\3\0\1\57"+
237-
"\1\0\1\57\74\62\2\65\2\0\70\65\1\66\1\0"+
238+
"\1\0\1\57\5\62\1\152\30\62\1\64\35\62\5\0"+
239+
"\1\153\66\0\74\62\2\65\2\0\70\65\1\66\1\0"+
238240
"\1\66\2\0\1\66\1\0\3\66\4\0\1\66\1\0"+
239-
"\1\66\1\0\1\152\4\0\1\66\5\0\3\66\1\153"+
241+
"\1\66\1\0\1\154\4\0\1\66\5\0\3\66\1\155"+
240242
"\2\66\1\0\1\66\1\0\3\66\6\0\1\66\1\0"+
241243
"\3\66\1\0\1\66\3\0\1\66\1\0\1\66\2\70"+
242-
"\2\0\70\70\2\154\2\0\4\154\1\155\63\154\20\0"+
243-
"\1\156\75\0\2\157\7\0\2\157\6\0\26\157\25\0"+
244-
"\2\160\56\0\1\100\11\0\1\101\1\0\2\161\15\0"+
245-
"\1\103\54\0\2\161\77\0\1\162\73\0\1\163\66\0"+
246-
"\2\43\6\0\3\43\4\0\1\43\1\0\20\43\1\164"+
244+
"\2\0\70\70\2\156\2\0\4\156\1\157\63\156\20\0"+
245+
"\1\160\75\0\2\161\7\0\2\161\6\0\26\161\25\0"+
246+
"\2\162\56\0\1\100\11\0\1\101\1\0\2\163\15\0"+
247+
"\1\103\54\0\2\163\77\0\1\164\73\0\1\165\66\0"+
248+
"\2\43\6\0\3\43\4\0\1\43\1\0\20\43\1\166"+
247249
"\5\43\25\0\2\43\6\0\3\43\4\0\1\43\1\0"+
248-
"\3\43\1\165\22\43\25\0\2\43\6\0\3\43\4\0"+
249-
"\1\43\1\0\14\43\1\166\11\43\25\0\2\43\6\0"+
250-
"\3\43\4\0\1\43\1\0\6\43\1\167\17\43\25\0"+
251-
"\2\43\6\0\3\43\4\0\1\43\1\0\15\43\1\170"+
250+
"\3\43\1\167\22\43\25\0\2\43\6\0\3\43\4\0"+
251+
"\1\43\1\0\14\43\1\170\11\43\25\0\2\43\6\0"+
252+
"\3\43\4\0\1\43\1\0\6\43\1\171\17\43\25\0"+
253+
"\2\43\6\0\3\43\4\0\1\43\1\0\15\43\1\172"+
252254
"\10\43\25\0\2\43\6\0\3\43\4\0\1\43\1\0"+
253-
"\16\43\1\171\7\43\25\0\2\43\6\0\3\43\4\0"+
254-
"\1\43\1\0\12\43\1\172\3\43\1\173\7\43\25\0"+
255-
"\2\43\6\0\3\43\4\0\1\43\1\0\15\43\1\174"+
255+
"\16\43\1\173\7\43\25\0\2\43\6\0\3\43\4\0"+
256+
"\1\43\1\0\12\43\1\174\3\43\1\175\7\43\25\0"+
257+
"\2\43\6\0\3\43\4\0\1\43\1\0\15\43\1\176"+
256258
"\10\43\25\0\2\43\6\0\3\43\4\0\1\43\1\0"+
257-
"\17\43\1\175\1\176\5\43\25\0\2\43\6\0\3\43"+
258-
"\4\0\1\43\1\0\22\43\1\177\3\43\25\0\2\43"+
259-
"\6\0\3\43\4\0\1\43\1\0\17\43\1\200\6\43"+
259+
"\17\43\1\177\1\200\5\43\25\0\2\43\6\0\3\43"+
260+
"\4\0\1\43\1\0\22\43\1\201\3\43\25\0\2\43"+
261+
"\6\0\3\43\4\0\1\43\1\0\17\43\1\202\6\43"+
260262
"\25\0\2\43\6\0\3\43\4\0\1\43\1\0\3\43"+
261-
"\1\201\22\43\25\0\2\43\6\0\3\43\4\0\1\43"+
262-
"\1\0\14\43\1\202\11\43\25\0\2\43\6\0\3\43"+
263-
"\4\0\1\43\1\0\25\43\1\203\25\0\2\43\6\0"+
264-
"\3\43\4\0\1\43\1\0\20\43\1\204\5\43\25\0"+
265-
"\2\43\6\0\3\43\4\0\1\43\1\0\4\43\1\205"+
263+
"\1\203\22\43\25\0\2\43\6\0\3\43\4\0\1\43"+
264+
"\1\0\14\43\1\204\11\43\25\0\2\43\6\0\3\43"+
265+
"\4\0\1\43\1\0\25\43\1\205\25\0\2\43\6\0"+
266+
"\3\43\4\0\1\43\1\0\20\43\1\206\5\43\25\0"+
267+
"\2\43\6\0\3\43\4\0\1\43\1\0\4\43\1\207"+
266268
"\21\43\25\0\2\43\6\0\3\43\4\0\1\43\1\0"+
267-
"\2\43\1\206\10\43\1\207\12\43\25\0\2\43\6\0"+
268-
"\3\43\4\0\1\43\1\0\25\43\1\210\25\0\2\43"+
269-
"\6\0\3\43\4\0\1\43\1\0\4\43\1\211\21\43"+
269+
"\2\43\1\210\10\43\1\211\12\43\25\0\2\43\6\0"+
270+
"\3\43\4\0\1\43\1\0\25\43\1\212\25\0\2\43"+
271+
"\6\0\3\43\4\0\1\43\1\0\4\43\1\213\21\43"+
270272
"\25\0\2\43\6\0\3\43\4\0\1\43\1\0\16\43"+
271-
"\1\212\7\43\35\0\10\57\54\0\1\213\103\0\10\66"+
272-
"\32\0\2\154\2\0\70\154\2\155\2\0\70\155\22\0"+
273-
"\2\160\10\0\1\214\4\0\1\101\5\0\1\214\44\0"+
274-
"\1\101\1\0\2\161\15\0\1\103\54\0\2\43\6\0"+
275-
"\3\43\4\0\1\43\1\0\4\43\1\215\21\43\25\0"+
276-
"\2\43\6\0\3\43\4\0\1\43\1\0\1\216\25\43"+
277-
"\25\0\2\43\6\0\3\43\4\0\1\43\1\0\3\43"+
278-
"\1\217\22\43\25\0\2\43\6\0\3\43\4\0\1\43"+
279-
"\1\0\10\43\1\220\15\43\25\0\2\43\6\0\3\43"+
280-
"\4\0\1\43\1\0\20\43\1\221\5\43\25\0\2\43"+
281-
"\6\0\3\43\4\0\1\43\1\0\16\43\1\222\7\43"+
273+
"\1\214\7\43\35\0\10\57\32\0\5\153\1\215\66\153"+
274+
"\22\0\1\216\103\0\10\66\32\0\2\156\2\0\70\156"+
275+
"\2\157\2\0\70\157\22\0\2\162\10\0\1\217\4\0"+
276+
"\1\101\5\0\1\217\44\0\1\101\1\0\2\163\15\0"+
277+
"\1\103\54\0\2\43\6\0\3\43\4\0\1\43\1\0"+
278+
"\4\43\1\220\21\43\25\0\2\43\6\0\3\43\4\0"+
279+
"\1\43\1\0\1\221\25\43\25\0\2\43\6\0\3\43"+
280+
"\4\0\1\43\1\0\3\43\1\222\22\43\25\0\2\43"+
281+
"\6\0\3\43\4\0\1\43\1\0\10\43\1\223\15\43"+
282+
"\25\0\2\43\6\0\3\43\4\0\1\43\1\0\20\43"+
283+
"\1\224\5\43\25\0\2\43\6\0\3\43\4\0\1\43"+
284+
"\1\0\16\43\1\225\7\43\25\0\2\43\6\0\3\43"+
285+
"\4\0\1\43\1\0\4\43\1\226\21\43\25\0\2\43"+
286+
"\6\0\3\43\4\0\1\43\1\0\2\43\1\227\23\43"+
282287
"\25\0\2\43\6\0\3\43\4\0\1\43\1\0\4\43"+
283-
"\1\223\21\43\25\0\2\43\6\0\3\43\4\0\1\43"+
284-
"\1\0\2\43\1\224\23\43\25\0\2\43\6\0\3\43"+
285-
"\4\0\1\43\1\0\4\43\1\225\21\43\25\0\2\43"+
286-
"\6\0\3\43\4\0\1\43\1\0\1\43\1\226\24\43"+
287-
"\25\0\2\43\6\0\3\43\4\0\1\43\1\0\12\43"+
288-
"\1\227\13\43\25\0\2\43\6\0\3\43\4\0\1\43"+
289-
"\1\0\4\43\1\230\21\43\25\0\2\43\6\0\3\43"+
290-
"\4\0\1\43\1\0\14\43\1\231\11\43\25\0\1\66"+
291-
"\66\0\1\232\1\0\1\232\2\0\2\233\72\0\2\43"+
292-
"\6\0\3\43\4\0\1\43\1\0\16\43\1\234\7\43"+
288+
"\1\230\21\43\25\0\2\43\6\0\3\43\4\0\1\43"+
289+
"\1\0\1\43\1\231\24\43\25\0\2\43\6\0\3\43"+
290+
"\4\0\1\43\1\0\12\43\1\232\13\43\25\0\2\43"+
291+
"\6\0\3\43\4\0\1\43\1\0\4\43\1\233\21\43"+
292+
"\25\0\2\43\6\0\3\43\4\0\1\43\1\0\14\43"+
293+
"\1\234\11\43\3\0\5\153\1\235\66\153\22\0\1\66"+
294+
"\66\0\1\236\1\0\1\236\2\0\2\237\72\0\2\43"+
295+
"\6\0\3\43\4\0\1\43\1\0\16\43\1\240\7\43"+
293296
"\25\0\2\43\6\0\3\43\4\0\1\43\1\0\12\43"+
294-
"\1\235\13\43\25\0\2\43\6\0\3\43\4\0\1\43"+
295-
"\1\0\14\43\1\236\11\43\25\0\2\43\6\0\3\43"+
296-
"\4\0\1\43\1\0\7\43\1\237\16\43\25\0\2\43"+
297-
"\6\0\3\43\4\0\1\43\1\0\4\43\1\240\21\43"+
297+
"\1\241\13\43\25\0\2\43\6\0\3\43\4\0\1\43"+
298+
"\1\0\14\43\1\242\11\43\25\0\2\43\6\0\3\43"+
299+
"\4\0\1\43\1\0\7\43\1\243\16\43\25\0\2\43"+
300+
"\6\0\3\43\4\0\1\43\1\0\4\43\1\244\21\43"+
298301
"\25\0\2\43\6\0\3\43\4\0\1\43\1\0\17\43"+
299-
"\1\241\6\43\25\0\2\43\6\0\3\43\4\0\1\43"+
300-
"\1\0\10\43\1\242\15\43\25\0\2\233\72\0\2\233"+
301-
"\15\0\1\232\54\0\2\43\6\0\3\43\4\0\1\43"+
302-
"\1\0\17\43\1\243\6\43\25\0\2\43\6\0\3\43"+
303-
"\4\0\1\43\1\0\4\43\1\244\21\43\25\0\2\43"+
304-
"\6\0\3\43\4\0\1\43\1\0\22\43\1\245\3\43"+
305-
"\25\0\2\43\6\0\3\43\4\0\1\43\1\0\15\43"+
306-
"\1\246\10\43\25\0\2\43\6\0\3\43\4\0\1\43"+
307-
"\1\0\4\43\1\247\21\43\3\0";
302+
"\1\245\6\43\25\0\2\43\6\0\3\43\4\0\1\43"+
303+
"\1\0\10\43\1\246\15\43\3\0\5\153\1\152\66\153"+
304+
"\22\0\2\237\72\0\2\237\15\0\1\236\54\0\2\43"+
305+
"\6\0\3\43\4\0\1\43\1\0\17\43\1\247\6\43"+
306+
"\25\0\2\43\6\0\3\43\4\0\1\43\1\0\4\43"+
307+
"\1\250\21\43\25\0\2\43\6\0\3\43\4\0\1\43"+
308+
"\1\0\22\43\1\251\3\43\25\0\2\43\6\0\3\43"+
309+
"\4\0\1\43\1\0\15\43\1\252\10\43\25\0\2\43"+
310+
"\6\0\3\43\4\0\1\43\1\0\4\43\1\253\21\43"+
311+
"\3\0";
308312

309313
private static int [] zzUnpacktrans() {
310-
int [] result = new int[6360];
314+
int [] result = new int[6660];
311315
int offset = 0;
312316
offset = zzUnpacktrans(ZZ_TRANS_PACKED_0, offset, result);
313317
return result;
@@ -347,13 +351,14 @@ private static int zzUnpacktrans(String packed, int offset, int [] result) {
347351
private static final String ZZ_ATTRIBUTE_PACKED_0 =
348352
"\2\0\1\1\2\11\5\1\3\11\1\1\1\11\5\1"+
349353
"\1\11\5\1\2\11\17\1\1\11\1\1\1\11\1\1"+
350-
"\1\11\1\1\1\0\1\11\1\0\1\1\1\11\3\1"+
354+
"\1\11\1\1\1\0\1\1\1\0\1\1\1\11\3\1"+
351355
"\4\11\1\1\1\11\2\0\1\1\1\0\5\11\2\0"+
352-
"\6\11\26\1\1\11\2\0\1\1\1\0\2\1\1\11"+
353-
"\3\1\2\11\30\1\1\0\15\1\1\0\15\1";
356+
"\6\11\26\1\1\11\2\0\1\11\1\0\1\1\1\0"+
357+
"\2\1\1\11\3\1\2\11\27\1\1\0\1\1\1\0"+
358+
"\15\1\2\0\15\1";
354359

355360
private static int [] zzUnpackAttribute() {
356-
int [] result = new int[167];
361+
int [] result = new int[171];
357362
int offset = 0;
358363
offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
359364
return result;

gen/org/intellij/erlang/psi/ErlangStringLiteral.java

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/org/intellij/erlang/psi/impl/ErlangStringLiteralImpl.java

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

grammars/erlang.bnf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ private exprs_tail ::= ',' expression {pin=1 recoverWhile=exprs_recover}
591591
private exprs_recover ::= !(')' | ',' | '->' | '.' | ':-' | ';' | '}' | after | catch | else | end | of | atom '(')
592592
guard ::= exprs (';' exprs)* {pin(".*")=1}
593593
private atomic ::= q_atom !'(' | integer | (string_literal | macros)+ | float | char
594-
string_literal ::= string {
594+
string_literal ::= string | triple_quoted_string {
595595
implements = "com.intellij.psi.PsiLanguageInjectionHost"
596596
methods = [isValidHost updateText createLiteralTextEscaper]
597597
}

resources/META-INF/ErlangPlugin.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,12 @@
217217
<localInspection language="Erlang" shortName="Erlang25Syntax" displayName="Erlang 25.0 syntax"
218218
groupName="Erlang" enabledByDefault="true" level="ERROR"
219219
implementationClass="org.intellij.erlang.inspection.Erlang25SyntaxInspection"/>
220+
<localInspection language="Erlang" shortName="Erlang27Syntax" displayName="Erlang 27.0 syntax"
221+
groupName="Erlang" enabledByDefault="true" level="ERROR"
222+
implementationClass="org.intellij.erlang.inspection.Erlang27SyntaxInspection"/>
223+
<localInspection language="Erlang" shortName="ErlangTripleQuotas" displayName="Erlang triple quotas syntax"
224+
groupName="Erlang" enabledByDefault="true" level="ERROR"
225+
implementationClass="org.intellij.erlang.inspection.ErlangTripleQuotasSyntaxInspection"/>
220226

221227
<!--warnings-->
222228
<localInspection language="Erlang" shortName="Erlang18Syntax" displayName="Erlang 18.0 syntax"
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!--
2+
~ Copyright 2012-2024 Sergey Ignatov
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
-->
16+
17+
<html>
18+
<body>
19+
Reports usage of triple quotes in Erlang versions prior to OTP 27.
20+
<p>
21+
This inspection detects the use of triple quotes for string literals in Erlang code when the project's Erlang SDK version is older than OTP 27. Triple quotes were introduced in Erlang OTP 27 and are not supported in earlier versions.
22+
</p>
23+
<p>
24+
Using triple quotes in older Erlang versions will result in syntax errors. This inspection helps prevent such errors by highlighting incompatible usage.
25+
</p>
26+
<p>
27+
Example of unsupported usage in Erlang versions prior to OTP 27:
28+
</p>
29+
<pre><code>
30+
String = """
31+
This is a multi-line
32+
string using triple quotes.
33+
""".
34+
</code></pre>
35+
<p>
36+
To fix this issue, either upgrade your Erlang SDK to version 27 or later, or use traditional string syntax:
37+
</p>
38+
<pre><code>
39+
String = "This is a multi-line\n"
40+
"string using traditional syntax.\n".
41+
</code></pre>
42+
<!-- tooltip end -->
43+
<p>
44+
This inspection is particularly useful when working on projects that need to maintain compatibility with older Erlang versions or when transitioning to newer Erlang features.
45+
</p>
46+
</body>
47+
</html>

0 commit comments

Comments
 (0)