PageRenderTime 23ms CodeModel.GetById 17ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/samples/scalate-sample-sitegen/src/highlight/languages/ini.js

http://github.com/scalate/scalate
JavaScript | 40 lines | 36 code | 1 blank | 3 comment | 0 complexity | 25f74ed126f7eab2285381a016b7414e MD5 | raw file
 1/*
 2Language: Ini
 3*/
 4
 5hljs.LANGUAGES.ini =
 6{
 7  case_insensitive: true,
 8  defaultMode: {
 9    contains: ['comment', 'title', 'setting'],
10    illegal: '[^\\s]'
11  },
12  modes: [
13    {
14      className: 'comment',
15      begin: ';', end: '$'
16    },
17    {
18      className: 'title',
19      begin: '\\[', end: '\\]'
20    },
21    {
22      className: 'setting',
23      begin: '^[a-z0-9_\\[\\]]+[ \\t]*=[ \\t]*', end: '$',
24      contains: ['value']
25    },
26    {
27      className: 'value',
28      begin: '^', endsWithParent: true,
29      contains: ['string', 'number'],
30      lexems: [hljs.IDENT_RE],
31      keywords: {'on': 1, 'off': 1, 'true': 1, 'false': 1, 'yes': 1, 'no': 1}
32    },
33    hljs.QUOTE_STRING_MODE,
34    hljs.BACKSLASH_ESCAPE,
35    {
36      className: 'number',
37      begin: '\\d+', end: '^'
38    }
39  ]
40};