Skip to content

Commit b57dfe1

Browse files
committed
improve docs
1 parent 72d6a56 commit b57dfe1

62 files changed

Lines changed: 1499 additions & 69 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 343 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,343 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
3+
"name": "antlr",
4+
"scopeName": "source.antlr",
5+
"uuid": "ACABDECD-4F22-47D9-A5F4-DBA957A2A1CC",
6+
"fileTypes": [
7+
"g",
8+
"g4"
9+
],
10+
"patterns": [
11+
{
12+
"include": "#strings"
13+
},
14+
{
15+
"include": "#comments"
16+
},
17+
{
18+
"include": "#options-list"
19+
},
20+
{
21+
"name": "keyword.other.antlr",
22+
"match": "\\b(import|lexer|parser|grammar|throws|catch|finally|mode)\\b"
23+
},
24+
{
25+
"name": "meta.tokens.antlr",
26+
"begin": "\\btokens\\b",
27+
"beginCaptures": {
28+
"0": {
29+
"name": "keyword.other.tokens.antlr"
30+
}
31+
},
32+
"end": "(?<=\\})",
33+
"patterns": [
34+
{
35+
"include": "#lexer-rule-reference"
36+
},
37+
{
38+
"include": "#comments"
39+
}
40+
]
41+
},
42+
{
43+
"name": "meta.channels.antlr",
44+
"begin": "\\bchannels\\b",
45+
"beginCaptures": {
46+
"0": {
47+
"name": "keyword.other.channels.antlr"
48+
}
49+
},
50+
"end": "(?<=\\})",
51+
"endCaptures": {
52+
"0": {
53+
"name": "punctuation.section.options.end.antlr"
54+
}
55+
},
56+
"patterns": [
57+
{
58+
"include": "#comments"
59+
},
60+
{
61+
"name": "constant.language.channel.antlr",
62+
"match": "\\w+"
63+
}
64+
]
65+
},
66+
{
67+
"name": "meta.action.named.antlr",
68+
"begin": "(\\@[[:alpha:]]+)(::([\\p{L}]+))?",
69+
"beginCaptures": {
70+
"1": {
71+
"name": "entity.name.block.action.named.antlr"
72+
},
73+
"2": {
74+
"name": "support.constant.action.named.antlr"
75+
}
76+
},
77+
"end": "(?<=\\})",
78+
"patterns": [
79+
{
80+
"name": "meta.action.block.antlr",
81+
"begin": "{",
82+
"end": "}",
83+
"patterns": [
84+
{
85+
"include": "#comments"
86+
},
87+
{
88+
"include": "#action"
89+
}
90+
]
91+
}
92+
]
93+
},
94+
{
95+
"name": "meta.rule.lexer.antlr",
96+
"begin": "^(\\s*)(fragment)?(\\s*)([[:upper:]][[:alnum:]_]*)",
97+
"beginCaptures": {
98+
"2": {
99+
"name": "keyword.other.antlr"
100+
},
101+
"4": {
102+
"name": "entity.name.function.lexer.antlr"
103+
}
104+
},
105+
"end": "(?<=\\;)",
106+
"patterns": [
107+
{
108+
"name": "meta.action.lexer.antlr",
109+
"begin": "(->)\\s*([\\p{L}]+)",
110+
"beginCaptures": {
111+
"1": {
112+
"name": "entity.other.pointer.antlr"
113+
},
114+
"2": {
115+
"name": "entity.name.function.antlr"
116+
}
117+
},
118+
"end": "(?<=\\;)",
119+
"patterns": [
120+
{
121+
"match": "[\\w]+",
122+
"name": "entity.name.function.antlr"
123+
},
124+
{
125+
"match": "\\(([\\w]+)\\)",
126+
"name": "variable.parameter.action.lexer.antlr"
127+
}
128+
]
129+
},
130+
{
131+
"include": "#comments"
132+
},
133+
{
134+
"include": "#character-range"
135+
},
136+
{
137+
"include": "#strings"
138+
},
139+
{
140+
"include": "#numeric"
141+
},
142+
{
143+
"include": "#lexer-rule-reference"
144+
},
145+
{
146+
"include": "#predicate"
147+
},
148+
{
149+
"include": "#action"
150+
},
151+
{
152+
"include": "#wildcard-regexp"
153+
},
154+
{
155+
"include": "#regexp-parts"
156+
}
157+
]
158+
},
159+
{
160+
"name": "meta.rule.parser.antlr",
161+
"begin": "^(\\s*)([[:lower:]][[:alnum:]_]*)",
162+
"beginCaptures": {
163+
"0": {
164+
"name": "entity.name.function.parser.antlr"
165+
}
166+
},
167+
"end": "(?<=;)",
168+
"patterns": [
169+
{
170+
"name": "variable.other",
171+
"match": "\\[.*?\\]"
172+
},
173+
{
174+
"name": "keyword.other.antlr",
175+
"match": "\\b(returns|locals)\\b"
176+
},
177+
{
178+
"name": "keyword.other.antlr",
179+
"match": "@\\w+"
180+
},
181+
{
182+
"name": "entity.other.rule.option",
183+
"match": " <.*?>"
184+
},
185+
{
186+
"name": "variable.other.antlr",
187+
"match": "\\w+\\s*="
188+
},
189+
{
190+
"name": "entity.name.tag.antlr",
191+
"match": "#\\s*[[:alnum:]_]+"
192+
},
193+
{
194+
"include": "#comments"
195+
},
196+
{
197+
"include": "#strings"
198+
},
199+
{
200+
"include": "#lexer-rule-reference"
201+
},
202+
{
203+
"include": "#parser-rule-reference"
204+
},
205+
{
206+
"include": "#predicate"
207+
},
208+
{
209+
"include": "#action"
210+
},
211+
{
212+
"include": "#wildcard-regexp"
213+
},
214+
{
215+
"include": "#regexp-parts"
216+
},
217+
{
218+
"include": "#options-list"
219+
}
220+
]
221+
}
222+
],
223+
"repository": {
224+
"identifier": {
225+
"name": "constant.other.antlr",
226+
"match": "\\b\\D\\w*\\b"
227+
},
228+
"comments": {
229+
"patterns": [
230+
{
231+
"name": "comment.block.antlr",
232+
"begin": "\/\\*",
233+
"end": "\\*\/"
234+
},
235+
{
236+
"name": "comment.line.double-slash.antlr",
237+
"match": "\/\/.*"
238+
}
239+
]
240+
},
241+
"strings": {
242+
"name": "string.quoted.single.antlr",
243+
"begin": "'",
244+
"end": "'",
245+
"patterns": [
246+
{
247+
"match": "\\\\(u\\h{4}|.)",
248+
"name": "constant.character.escape.antlr"
249+
}
250+
]
251+
},
252+
"numeric": {
253+
"name": "constant.numeric.antlr",
254+
"match": "\\d+"
255+
},
256+
"action": {
257+
"name": "entity.other.block.antlr",
258+
"begin": "\\{",
259+
"end": "\\}",
260+
"patterns": [
261+
{
262+
"include": "#action"
263+
}
264+
]
265+
},
266+
"character-range": {
267+
"name": "constant.other.antlr",
268+
"begin": "~?\\[",
269+
"end": "\\](\\*|\\+|\\?)?",
270+
"patterns": [
271+
{
272+
"match": "\\\\(u\\h{4}|.)",
273+
"name": "constant.character.escape.antlr"
274+
}
275+
]
276+
},
277+
"wildcard-regexp": {
278+
"name": "string.regexp.antlr",
279+
"match": "\\.((\\*|\\+)\\??)?"
280+
},
281+
"regexp-parts": {
282+
"name": "string.regexp.antlr",
283+
"match": "(\\~|\\?|\\+(?!=)|\\*)(\\?)?"
284+
},
285+
"options-list": {
286+
"name": "meta.options.antlr",
287+
"end": "(?<=\\})",
288+
"begin": "\\boptions\\b",
289+
"beginCaptures": {
290+
"0": {
291+
"name": "keyword.other.options.antlr"
292+
}
293+
},
294+
"patterns": [
295+
{
296+
"name": "meta.options.block.antlr",
297+
"begin": "\\{",
298+
"beginCaptures": {
299+
"0": {
300+
"name": "punctuation.block.begin.antlr"
301+
}
302+
},
303+
"end": "\\}",
304+
"endCaptures": {
305+
"0": {
306+
"name": "punctuation.block.end.antlr"
307+
}
308+
},
309+
"patterns": [
310+
{
311+
"name": "variable.other.option.antlr",
312+
"match": "\\b(superClass|language|tokenVocab|TokenLabelType|contextSuperClass|exportMacro)\\b"
313+
},
314+
{
315+
"include": "#strings"
316+
},
317+
{
318+
"include": "#comments"
319+
},
320+
{
321+
"include": "#identifier"
322+
},
323+
{
324+
"include": "#numeric"
325+
}
326+
]
327+
}
328+
]
329+
},
330+
"lexer-rule-reference": {
331+
"name": "support.other.token.lexer.antlr",
332+
"match": "\\b[[:upper:]][[:alnum:]_]*(?!\\s*:)"
333+
},
334+
"parser-rule-reference": {
335+
"name": "support.function.parser.antlr",
336+
"match": "\\b[[:lower:]][[:alnum:]_]*(?!\\s*:)"
337+
},
338+
"predicate": {
339+
"name": "entity.other.predicate.antlr",
340+
"match": "\\{.*?\\}\\?"
341+
}
342+
}
343+
}

src/.vuepress/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { ShikiPluginOptions } from "@vuepress/plugin-shiki";
22
import huloGrammar from "./hulo.tmLanguage.json" with { type: "json" };
33
import amberGrammar from './amber.tmLanguage.json' with {type: "json"};
4+
import antlrGrammar from './antlr.tmLanguage.json' with {type: "json"};
45

56
const hulotmLanguage = {
67
id: "hulo",
@@ -12,11 +13,16 @@ const ambertmLanguage = {
1213
...amberGrammar,
1314
}
1415

16+
const antlrLanguage = {
17+
id: "antlr",
18+
...antlrGrammar,
19+
}
20+
1521
export default <ShikiPluginOptions>{
1622
themes: {
1723
light: "one-light",
1824
dark: "one-dark-pro",
1925
},
2026
lineNumbers: false,
21-
langs: [hulotmLanguage, ambertmLanguage],
27+
langs: [hulotmLanguage, ambertmLanguage, antlrLanguage],
2228
};

src/.vuepress/navbar/en.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ export const enNavbar = navbar([
6464
]
6565
},
6666
{
67-
text: "Blueprints",
68-
icon: "lightbulb",
69-
prefix: "/blueprints/",
70-
link: "/blueprints/"
67+
text: "Architecture",
68+
icon: "sitemap",
69+
prefix: "/architecture/",
70+
link: "/architecture/"
7171
},
7272
"/demos/",
7373
{

0 commit comments

Comments
 (0)