Skip to content

Commit af0e94e

Browse files
committed
add majority of syntax for language
1 parent b6af367 commit af0e94e

File tree

2 files changed

+62
-6
lines changed

2 files changed

+62
-6
lines changed

index.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@
4949
// $D191: Start Menu Map Group 2
5050
function StartMenuMapGroup2() => bitcount( 0xd191 )
5151

52+
class Test {
53+
t_var = 0
54+
t_newvar = "213"
55+
56+
function DoSomething(v5, v56) {
57+
this.t_var = v5
58+
}
59+
}
60+
5261
// $D192: Start Menu Map Group 3
5362
function StartMenuMapGroup3() => bitcount( 0xd192 )
5463

src/rascript.js

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,59 @@
55
*/
66
function RAScript(hljs) {
77
return {
8-
case_insensitive: true,
9-
keywords: [
10-
'else',
11-
'for',
12-
'if',
13-
'while'
8+
case_insensitive: false,
9+
contains: [
10+
hljs.C_LINE_COMMENT_MODE,
11+
hljs.QUOTE_STRING_MODE,
12+
hljs.C_NUMBER_MODE,
13+
hljs.COMMENT(
14+
'/\\*',
15+
'\\*/',
16+
),
17+
{
18+
className: 'variable.language',
19+
begin: /\b(this)\b/
20+
},
21+
{
22+
className: 'keyword',
23+
begin: /\b(function|class|else|for|if|in|return)\b/
24+
},
25+
{
26+
className: 'literal',
27+
begin: /\b(true|false)\b/
28+
},
29+
{
30+
begin: [
31+
/function[\t ]+/,
32+
/[a-zA-Z_][\w]*/,
33+
/\(/
34+
],
35+
beginScope: {
36+
2: "title.function"
37+
},
38+
},
39+
{
40+
begin: [
41+
/class[\t ]+/,
42+
/[a-zA-Z_][\w]*/
43+
],
44+
beginScope: {
45+
2: "title.class"
46+
},
47+
},
48+
{
49+
begin: [
50+
/[a-zA-Z_][\w]*/,
51+
/\(/
52+
],
53+
beginScope: {
54+
1: "title.function.invoke"
55+
},
56+
},
57+
{
58+
className: 'variable',
59+
begin: /[a-zA-Z_][\w]*/,
60+
}
1461
]
1562
}
1663
}

0 commit comments

Comments
 (0)