main
Last change
on this file since e48199a was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
2.2 KB
|
Line | |
---|
1 | /*
|
---|
2 | Language: Monkey
|
---|
3 | Description: Monkey2 is an easy to use, cross platform, games oriented programming language from Blitz Research.
|
---|
4 | Author: Arthur Bikmullin <devolonter@gmail.com>
|
---|
5 | Website: https://blitzresearch.itch.io/monkey2
|
---|
6 | */
|
---|
7 |
|
---|
8 | function monkey(hljs) {
|
---|
9 | const NUMBER = {
|
---|
10 | className: 'number',
|
---|
11 | relevance: 0,
|
---|
12 | variants: [
|
---|
13 | {
|
---|
14 | begin: '[$][a-fA-F0-9]+'
|
---|
15 | },
|
---|
16 | hljs.NUMBER_MODE
|
---|
17 | ]
|
---|
18 | };
|
---|
19 |
|
---|
20 | return {
|
---|
21 | name: 'Monkey',
|
---|
22 | case_insensitive: true,
|
---|
23 | keywords: {
|
---|
24 | keyword: 'public private property continue exit extern new try catch ' +
|
---|
25 | 'eachin not abstract final select case default const local global field ' +
|
---|
26 | 'end if then else elseif endif while wend repeat until forever for ' +
|
---|
27 | 'to step next return module inline throw import',
|
---|
28 |
|
---|
29 | built_in: 'DebugLog DebugStop Error Print ACos ACosr ASin ASinr ATan ATan2 ATan2r ATanr Abs Abs Ceil ' +
|
---|
30 | 'Clamp Clamp Cos Cosr Exp Floor Log Max Max Min Min Pow Sgn Sgn Sin Sinr Sqrt Tan Tanr Seed PI HALFPI TWOPI',
|
---|
31 |
|
---|
32 | literal: 'true false null and or shl shr mod'
|
---|
33 | },
|
---|
34 | illegal: /\/\*/,
|
---|
35 | contains: [
|
---|
36 | hljs.COMMENT('#rem', '#end'),
|
---|
37 | hljs.COMMENT(
|
---|
38 | "'",
|
---|
39 | '$',
|
---|
40 | {
|
---|
41 | relevance: 0
|
---|
42 | }
|
---|
43 | ),
|
---|
44 | {
|
---|
45 | className: 'function',
|
---|
46 | beginKeywords: 'function method',
|
---|
47 | end: '[(=:]|$',
|
---|
48 | illegal: /\n/,
|
---|
49 | contains: [ hljs.UNDERSCORE_TITLE_MODE ]
|
---|
50 | },
|
---|
51 | {
|
---|
52 | className: 'class',
|
---|
53 | beginKeywords: 'class interface',
|
---|
54 | end: '$',
|
---|
55 | contains: [
|
---|
56 | {
|
---|
57 | beginKeywords: 'extends implements'
|
---|
58 | },
|
---|
59 | hljs.UNDERSCORE_TITLE_MODE
|
---|
60 | ]
|
---|
61 | },
|
---|
62 | {
|
---|
63 | className: 'built_in',
|
---|
64 | begin: '\\b(self|super)\\b'
|
---|
65 | },
|
---|
66 | {
|
---|
67 | className: 'meta',
|
---|
68 | begin: '\\s*#',
|
---|
69 | end: '$',
|
---|
70 | keywords: {
|
---|
71 | 'meta-keyword': 'if else elseif endif end then'
|
---|
72 | }
|
---|
73 | },
|
---|
74 | {
|
---|
75 | className: 'meta',
|
---|
76 | begin: '^\\s*strict\\b'
|
---|
77 | },
|
---|
78 | {
|
---|
79 | beginKeywords: 'alias',
|
---|
80 | end: '=',
|
---|
81 | contains: [ hljs.UNDERSCORE_TITLE_MODE ]
|
---|
82 | },
|
---|
83 | hljs.QUOTE_STRING_MODE,
|
---|
84 | NUMBER
|
---|
85 | ]
|
---|
86 | };
|
---|
87 | }
|
---|
88 |
|
---|
89 | module.exports = monkey;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.