PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/samples/scalate-presentation/src/highlight/languages/parser3.js

http://github.com/scalate/scalate
JavaScript | 54 lines | 47 code | 2 blank | 5 comment | 0 complexity | 756344c54991e0e1d4803ea97e4c8d9d MD5 | raw file
 1/*
 2Language: Parser3
 3Requires: html-xml.js
 4Author: Oleg Volchkov <oleg@volchkov.net>
 5*/
 6
 7hljs.LANGUAGES.parser3 = {
 8  defaultMode: {
 9    contains: ['comment', 'preprocessor', 'title', 'variable', 'keyword', 'number'],
10    subLanguage: 'html'
11  },
12  case_insensitive: false,
13
14  modes: [
15    {
16      className: 'comment',
17      begin: '^#', end: '$'
18    },
19    {
20      className: 'comment',
21      contains: ['commented_block'],
22      begin: '\\^rem{', end: '}',
23      relevance: 10
24    },
25    {
26      className: 'commented_block',
27      contains: ['commented_block'],
28      begin: '{', end: '}',
29      noMarkup: true
30    },
31    {
32      className: 'preprocessor',
33      begin: '^@(?:BASE|USE|CLASS|OPTIONS)$', end: '^',
34      relevance: 10
35    },
36    {
37      className: 'title',
38      begin: '@[\\w\\-]+\\[[\\w^;\\-]*\\](?:\\[[\\w^;\\-]*\\])?(?:.*)$', end: '^'
39    },
40    {
41      className: 'variable',
42      begin: '\\$\\{?[\\w\\-\\.\\:]+\\}?', end: '^'
43    },
44    {
45      className: 'keyword',
46      begin: '\\^[\\w\\-\\.\\:]+', end: '^'
47    },
48    {
49      className: 'number',
50      begin: '\\^#[0-9a-fA-F]+', end: '^'
51    },
52    hljs.C_NUMBER_MODE
53  ]
54};