source: node_modules/refractor/lang/keyman.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.5 KB
RevLine 
[d24f17c]1'use strict'
2
3module.exports = keyman
4keyman.displayName = 'keyman'
5keyman.aliases = []
6function keyman(Prism) {
7 Prism.languages.keyman = {
8 comment: {
9 pattern: /\bc .*/i,
10 greedy: true
11 },
12 string: {
13 pattern: /"[^"\r\n]*"|'[^'\r\n]*'/,
14 greedy: true
15 },
16 'virtual-key': {
17 pattern:
18 /\[\s*(?:(?:ALT|CAPS|CTRL|LALT|LCTRL|NCAPS|RALT|RCTRL|SHIFT)\s+)*(?:[TKU]_[\w?]+|[A-E]\d\d?|"[^"\r\n]*"|'[^'\r\n]*')\s*\]/i,
19 greedy: true,
20 alias: 'function' // alias for styles
21 },
22 // https://help.keyman.com/developer/language/guide/headers
23 'header-keyword': {
24 pattern: /&\w+/,
25 alias: 'bold' // alias for styles
26 },
27 'header-statement': {
28 pattern:
29 /\b(?:bitmap|bitmaps|caps always off|caps on only|copyright|hotkey|language|layout|message|name|shift frees caps|version)\b/i,
30 alias: 'bold' // alias for styles
31 },
32 'rule-keyword': {
33 pattern:
34 /\b(?:any|baselayout|beep|call|context|deadkey|dk|if|index|layer|notany|nul|outs|platform|reset|return|save|set|store|use)\b/i,
35 alias: 'keyword'
36 },
37 'structural-keyword': {
38 pattern: /\b(?:ansi|begin|group|match|nomatch|unicode|using keys)\b/i,
39 alias: 'keyword'
40 },
41 'compile-target': {
42 pattern: /\$(?:keyman|keymanonly|keymanweb|kmfl|weaver):/i,
43 alias: 'property'
44 },
45 // U+####, x###, d### characters and numbers
46 number: /\b(?:U\+[\dA-F]+|d\d+|x[\da-f]+|\d+)\b/i,
47 operator: /[+>\\$]|\.\./,
48 punctuation: /[()=,]/
49 }
50}
Note: See TracBrowser for help on using the repository browser.