source: node_modules/refractor/lang/j.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.2 KB
Line 
1'use strict'
2
3module.exports = j
4j.displayName = 'j'
5j.aliases = []
6function j(Prism) {
7 Prism.languages.j = {
8 comment: {
9 pattern: /\bNB\..*/,
10 greedy: true
11 },
12 string: {
13 pattern: /'(?:''|[^'\r\n])*'/,
14 greedy: true
15 },
16 keyword:
17 /\b(?:(?:CR|LF|adverb|conjunction|def|define|dyad|monad|noun|verb)\b|(?:assert|break|case|catch[dt]?|continue|do|else|elseif|end|fcase|for|for_\w+|goto_\w+|if|label_\w+|return|select|throw|try|while|whilst)\.)/,
18 verb: {
19 // Negative look-ahead prevents bad highlighting
20 // of ^: ;. =. =: !. !:
21 pattern:
22 /(?!\^:|;\.|[=!][.:])(?:\{(?:\.|::?)?|p(?:\.\.?|:)|[=!\]]|[<>+*\-%$|,#][.:]?|[?^]\.?|[;\[]:?|[~}"i][.:]|[ACeEIjLor]\.|(?:[_\/\\qsux]|_?\d):)/,
23 alias: 'keyword'
24 },
25 number:
26 /\b_?(?:(?!\d:)\d+(?:\.\d+)?(?:(?:ad|ar|[ejpx])_?\d+(?:\.\d+)?)*(?:b_?[\da-z]+(?:\.[\da-z]+)?)?|_\b(?!\.))/,
27 adverb: {
28 pattern: /[~}]|[\/\\]\.?|[bfM]\.|t[.:]/,
29 alias: 'builtin'
30 },
31 operator: /[=a][.:]|_\./,
32 conjunction: {
33 pattern: /&(?:\.:?|:)?|[.:@][.:]?|[!D][.:]|[;dHT]\.|`:?|[\^LS]:|"/,
34 alias: 'variable'
35 },
36 punctuation: /[()]/
37 }
38}
Note: See TracBrowser for help on using the repository browser.