source: node_modules/refractor/lang/rip.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.1 KB
Line 
1'use strict'
2
3module.exports = rip
4rip.displayName = 'rip'
5rip.aliases = []
6function rip(Prism) {
7 Prism.languages.rip = {
8 comment: {
9 pattern: /#.*/,
10 greedy: true
11 },
12 char: {
13 pattern: /\B`[^\s`'",.:;#\/\\()<>\[\]{}]\b/,
14 greedy: true
15 },
16 string: {
17 pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
18 greedy: true
19 },
20 regex: {
21 pattern:
22 /(^|[^/])\/(?!\/)(?:\[[^\n\r\]]*\]|\\.|[^/\\\r\n\[])+\/(?=\s*(?:$|[\r\n,.;})]))/,
23 lookbehind: true,
24 greedy: true
25 },
26 keyword:
27 /(?:=>|->)|\b(?:case|catch|class|else|exit|finally|if|raise|return|switch|try)\b/,
28 builtin: /@|\bSystem\b/,
29 boolean: /\b(?:false|true)\b/,
30 date: /\b\d{4}-\d{2}-\d{2}\b/,
31 time: /\b\d{2}:\d{2}:\d{2}\b/,
32 datetime: /\b\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\b/,
33 symbol: /:[^\d\s`'",.:;#\/\\()<>\[\]{}][^\s`'",.:;#\/\\()<>\[\]{}]*/,
34 number: /[+-]?\b(?:\d+\.\d+|\d+)\b/,
35 punctuation: /(?:\.{2,3})|[`,.:;=\/\\()<>\[\]{}]/,
36 reference: /[^\d\s`'",.:;#\/\\()<>\[\]{}][^\s`'",.:;#\/\\()<>\[\]{}]*/
37 }
38}
Note: See TracBrowser for help on using the repository browser.