diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-05-24 15:10:37 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-05-24 15:11:17 +0200 |
commit | 7a3df06eb573d36142bd1a8e03c5ce8752d300b3 (patch) | |
tree | 70bfaea8884c374876f607774850a3a51c0cb381 /node_modules/highlight.js/lib/languages/cal.js | |
parent | aca1143cb9eed16cf37f04e475e4257418dd18ac (diff) | |
download | wallet-core-7a3df06eb573d36142bd1a8e03c5ce8752d300b3.tar.xz |
fix build issues and add typedoc
Diffstat (limited to 'node_modules/highlight.js/lib/languages/cal.js')
-rw-r--r-- | node_modules/highlight.js/lib/languages/cal.js | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/node_modules/highlight.js/lib/languages/cal.js b/node_modules/highlight.js/lib/languages/cal.js new file mode 100644 index 000000000..141d36233 --- /dev/null +++ b/node_modules/highlight.js/lib/languages/cal.js @@ -0,0 +1,79 @@ +module.exports = function(hljs) { + var KEYWORDS = + 'div mod in and or not xor asserterror begin case do downto else end exit for if of repeat then to ' + + 'until while with var'; + var LITERALS = 'false true'; + var COMMENT_MODES = [ + hljs.C_LINE_COMMENT_MODE, + hljs.COMMENT( + /\{/, + /\}/, + { + relevance: 0 + } + ), + hljs.COMMENT( + /\(\*/, + /\*\)/, + { + relevance: 10 + } + ) + ]; + var STRING = { + className: 'string', + begin: /'/, end: /'/, + contains: [{begin: /''/}] + }; + var CHAR_STRING = { + className: 'string', begin: /(#\d+)+/ + }; + var DATE = { + className: 'number', + begin: '\\b\\d+(\\.\\d+)?(DT|D|T)', + relevance: 0 + }; + var DBL_QUOTED_VARIABLE = { + className: 'string', // not a string technically but makes sense to be highlighted in the same style + begin: '"', + end: '"' + }; + + var PROCEDURE = { + className: 'function', + beginKeywords: 'procedure', end: /[:;]/, + keywords: 'procedure|10', + contains: [ + hljs.TITLE_MODE, + { + className: 'params', + begin: /\(/, end: /\)/, + keywords: KEYWORDS, + contains: [STRING, CHAR_STRING] + } + ].concat(COMMENT_MODES) + }; + + var OBJECT = { + className: 'class', + begin: 'OBJECT (Table|Form|Report|Dataport|Codeunit|XMLport|MenuSuite|Page|Query) (\\d+) ([^\\r\\n]+)', + returnBegin: true, + contains: [ + hljs.TITLE_MODE, + PROCEDURE + ] + }; + + return { + case_insensitive: true, + keywords: { keyword: KEYWORDS, literal: LITERALS }, + illegal: /\/\*/, + contains: [ + STRING, CHAR_STRING, + DATE, DBL_QUOTED_VARIABLE, + hljs.NUMBER_MODE, + OBJECT, + PROCEDURE + ] + }; +};
\ No newline at end of file |