Skip to content

Commit 154b88e

Browse files
RyrdenMiodec
andauthored
feat(language): add Erlang programming language support (@Ryrden) (monkeytypegame#7013)
### Description This PR adds support for the Erlang programming language to Monkeytype, providing developers with a comprehensive set of essential Erlang keywords, OTP behaviors, and standard library functions for typing practice. **Changes made:** - Add `code_erlang` to language schema (`packages/schemas/src/languages.ts`) - Add `code_erlang` to frontend constants in the `code` language group (`frontend/src/ts/constants/languages.ts`) - Create `code_erlang.json` with 245 essential Erlang keywords and functions - Includes core language constructs (after, and, case, receive, spawn), OTP behaviors (gen_server, supervisor, application), built-in functions (spawn_link, monitor, register), and standard library modules (lists, string, ets, mnesia, file, io) ### Checks - [ ] Adding quotes? - [ ] Make sure to include translations for the quotes in the description (or another comment) so we can verify their content. - [x] Adding a language? - Make sure to follow the [languages documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/LANGUAGES.md) - [x] Add language to `packages/schemas/src/languages.ts` - [x] Add language to exactly one group in `frontend/src/ts/constants/languages.ts` - [x] Add language json file to `frontend/static/languages` - [ ] Adding a theme? - Make sure to follow the [themes documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/THEMES.md) - [ ] Add theme to `packages/schemas/src/themes.ts` - [ ] Add theme to `frontend/src/ts/constants/themes.ts` - [ ] Add theme css file to `frontend/static/themes` - [ ] Add some screenshot of the theme, especially with different test settings (colorful, flip colors) to your pull request - [ ] Adding a layout? - [ ] Make sure to follow the [layouts documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/LAYOUTS.md) - [ ] Add layout to `packages/schemas/src/layouts.ts` - [ ] Add layout json file to `frontend/static/layouts` - [ ] Adding a font? - Make sure to follow the [themes documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/FONTS.md) - [ ] Add font file to `frontend/static/webfonts` - [ ] Add font to `packages/schemas/src/fonts.ts` - [ ] Add font to `frontend/src/ts/constants/fonts.ts` - [x] Check if any open issues are related to this PR; if so, be sure to tag them below. - [x] Make sure the PR title follows the Conventional Commits standard. (https://www.conventionalcommits.org for more info) - [x] Make sure to include your GitHub username prefixed with @ inside parentheses at the end of the PR title. <!-- No related issues found --> Note: Please, is it possible to add the label `hacktoberfest-accepted` to this PR? Co-authored-by: Jack <[email protected]>
1 parent 260c3a9 commit 154b88e

File tree

3 files changed

+253
-0
lines changed

3 files changed

+253
-0
lines changed

frontend/src/ts/constants/languages.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ export const LanguageGroups: Record<string, Language[]> = {
353353
"code_cobol",
354354
"code_clojure",
355355
"code_common_lisp",
356+
"code_erlang",
356357
"code_ocaml",
357358
"code_odin",
358359
"code_fortran",
Lines changed: 251 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
{
2+
"name": "code_erlang",
3+
"noLazyMode": true,
4+
"words": [
5+
"after",
6+
"and",
7+
"andalso",
8+
"band",
9+
"begin",
10+
"bnot",
11+
"bor",
12+
"bsl",
13+
"bsr",
14+
"bxor",
15+
"case",
16+
"catch",
17+
"cond",
18+
"div",
19+
"end",
20+
"fun",
21+
"if",
22+
"let",
23+
"not",
24+
"of",
25+
"or",
26+
"orelse",
27+
"query",
28+
"receive",
29+
"rem",
30+
"try",
31+
"when",
32+
"xor",
33+
"module",
34+
"export",
35+
"import",
36+
"compile",
37+
"vsn",
38+
"author",
39+
"behaviour",
40+
"behavior",
41+
"record",
42+
"define",
43+
"ifdef",
44+
"ifndef",
45+
"else",
46+
"endif",
47+
"include",
48+
"include_lib",
49+
"undef",
50+
"spec",
51+
"type",
52+
"opaque",
53+
"callback",
54+
"optional_callbacks",
55+
"spawn",
56+
"spawn_link",
57+
"spawn_monitor",
58+
"spawn_opt",
59+
"link",
60+
"unlink",
61+
"monitor",
62+
"demonitor",
63+
"process_flag",
64+
"register",
65+
"unregister",
66+
"whereis",
67+
"registered",
68+
"send",
69+
"exit",
70+
"throw",
71+
"error",
72+
"apply",
73+
"make_ref",
74+
"node",
75+
"nodes",
76+
"self",
77+
"pid_to_list",
78+
"list_to_pid",
79+
"atom_to_list",
80+
"list_to_atom",
81+
"binary_to_list",
82+
"list_to_binary",
83+
"term_to_binary",
84+
"binary_to_term",
85+
"integer_to_list",
86+
"list_to_integer",
87+
"float_to_list",
88+
"list_to_float",
89+
"tuple_to_list",
90+
"list_to_tuple",
91+
"size",
92+
"byte_size",
93+
"bit_size",
94+
"length",
95+
"hd",
96+
"tl",
97+
"element",
98+
"setelement",
99+
"tuple_size",
100+
"is_atom",
101+
"is_binary",
102+
"is_bitstring",
103+
"is_boolean",
104+
"is_float",
105+
"is_function",
106+
"is_integer",
107+
"is_list",
108+
"is_number",
109+
"is_pid",
110+
"is_port",
111+
"is_record",
112+
"is_reference",
113+
"is_tuple",
114+
"abs",
115+
"round",
116+
"trunc",
117+
"max",
118+
"min",
119+
"gen_server",
120+
"gen_statem",
121+
"gen_fsm",
122+
"gen_event",
123+
"supervisor",
124+
"application",
125+
"start",
126+
"stop",
127+
"init",
128+
"handle_call",
129+
"handle_cast",
130+
"handle_info",
131+
"terminate",
132+
"code_change",
133+
"start_link",
134+
"call",
135+
"cast",
136+
"reply",
137+
"noreply",
138+
"normal",
139+
"shutdown",
140+
"brutal_kill",
141+
"permanent",
142+
"temporary",
143+
"transient",
144+
"worker",
145+
"one_for_one",
146+
"one_for_all",
147+
"rest_for_one",
148+
"simple_one_for_one",
149+
"infinity",
150+
"timer",
151+
"sleep",
152+
"send_after",
153+
"send_interval",
154+
"cancel",
155+
"now",
156+
"date",
157+
"time",
158+
"localtime",
159+
"universaltime",
160+
"calendar",
161+
"datetime_to_gregorian_seconds",
162+
"gregorian_seconds_to_datetime",
163+
"erlang",
164+
"system_info",
165+
"memory",
166+
"garbage_collect",
167+
"process_info",
168+
"statistics",
169+
"trace",
170+
"trace_pattern",
171+
"dbg",
172+
"ets",
173+
"new",
174+
"insert",
175+
"lookup",
176+
"delete",
177+
"match",
178+
"select",
179+
"foldl",
180+
"foldr",
181+
"tab2list",
182+
"info",
183+
"dets",
184+
"open_file",
185+
"close",
186+
"sync",
187+
"mnesia",
188+
"create_schema",
189+
"create_table",
190+
"delete_table",
191+
"write",
192+
"read",
193+
"transaction",
194+
"activity",
195+
"dirty_write",
196+
"dirty_read",
197+
"dirty_delete",
198+
"file",
199+
"open",
200+
"position",
201+
"consult",
202+
"eval",
203+
"script",
204+
"io",
205+
"format",
206+
"fwrite",
207+
"nl",
208+
"get_line",
209+
"get_chars",
210+
"put_chars",
211+
"lists",
212+
"append",
213+
"concat",
214+
"reverse",
215+
"sort",
216+
"keysort",
217+
"member",
218+
"filter",
219+
"map",
220+
"foreach",
221+
"all",
222+
"any",
223+
"partition",
224+
"splitwith",
225+
"takewhile",
226+
"dropwhile",
227+
"zip",
228+
"unzip",
229+
"flatten",
230+
"string",
231+
"len",
232+
"equal",
233+
"chr",
234+
"str",
235+
"rstr",
236+
"span",
237+
"cspan",
238+
"substr",
239+
"tokens",
240+
"chars",
241+
"copies",
242+
"words",
243+
"sub_word",
244+
"strip",
245+
"left",
246+
"right",
247+
"centre",
248+
"to_upper",
249+
"to_lower"
250+
]
251+
}

packages/schemas/src/languages.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ export const LanguageSchema = z.enum(
418418
"code_cobol",
419419
"code_clojure",
420420
"code_common_lisp",
421+
"code_erlang",
421422
"docker_file",
422423
"code_fortran",
423424
"viossa",

0 commit comments

Comments
 (0)