source: node_modules/highlight.js/lib/languages/capnproto.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*
2Language: Cap’n Proto
3Author: Oleg Efimov <efimovov@gmail.com>
4Description: Cap’n Proto message definition format
5Website: https://capnproto.org/capnp-tool.html
6Category: protocols
7*/
8
9/** @type LanguageFn */
10function capnproto(hljs) {
11 return {
12 name: 'Cap’n Proto',
13 aliases: ['capnp'],
14 keywords: {
15 keyword:
16 'struct enum interface union group import using const annotation extends in of on as with from fixed',
17 built_in:
18 'Void Bool Int8 Int16 Int32 Int64 UInt8 UInt16 UInt32 UInt64 Float32 Float64 ' +
19 'Text Data AnyPointer AnyStruct Capability List',
20 literal:
21 'true false'
22 },
23 contains: [
24 hljs.QUOTE_STRING_MODE,
25 hljs.NUMBER_MODE,
26 hljs.HASH_COMMENT_MODE,
27 {
28 className: 'meta',
29 begin: /@0x[\w\d]{16};/,
30 illegal: /\n/
31 },
32 {
33 className: 'symbol',
34 begin: /@\d+\b/
35 },
36 {
37 className: 'class',
38 beginKeywords: 'struct enum',
39 end: /\{/,
40 illegal: /\n/,
41 contains: [hljs.inherit(hljs.TITLE_MODE, {
42 starts: {
43 endsWithParent: true,
44 excludeEnd: true
45 } // hack: eating everything after the first title
46 })]
47 },
48 {
49 className: 'class',
50 beginKeywords: 'interface',
51 end: /\{/,
52 illegal: /\n/,
53 contains: [hljs.inherit(hljs.TITLE_MODE, {
54 starts: {
55 endsWithParent: true,
56 excludeEnd: true
57 } // hack: eating everything after the first title
58 })]
59 }
60 ]
61 };
62}
63
64module.exports = capnproto;
Note: See TracBrowser for help on using the repository browser.