source: node_modules/refractor/lang/turtle.js@ d24f17c

main
Last change on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.4 KB
Line 
1'use strict'
2
3module.exports = turtle
4turtle.displayName = 'turtle'
5turtle.aliases = []
6function turtle(Prism) {
7 Prism.languages.turtle = {
8 comment: {
9 pattern: /#.*/,
10 greedy: true
11 },
12 'multiline-string': {
13 pattern:
14 /"""(?:(?:""?)?(?:[^"\\]|\\.))*"""|'''(?:(?:''?)?(?:[^'\\]|\\.))*'''/,
15 greedy: true,
16 alias: 'string',
17 inside: {
18 comment: /#.*/
19 }
20 },
21 string: {
22 pattern: /"(?:[^\\"\r\n]|\\.)*"|'(?:[^\\'\r\n]|\\.)*'/,
23 greedy: true
24 },
25 url: {
26 pattern:
27 /<(?:[^\x00-\x20<>"{}|^`\\]|\\(?:u[\da-fA-F]{4}|U[\da-fA-F]{8}))*>/,
28 greedy: true,
29 inside: {
30 punctuation: /[<>]/
31 }
32 },
33 function: {
34 pattern:
35 /(?:(?![-.\d\xB7])[-.\w\xB7\xC0-\uFFFD]+)?:(?:(?![-.])(?:[-.:\w\xC0-\uFFFD]|%[\da-f]{2}|\\.)+)?/i,
36 inside: {
37 'local-name': {
38 pattern: /([^:]*:)[\s\S]+/,
39 lookbehind: true
40 },
41 prefix: {
42 pattern: /[\s\S]+/,
43 inside: {
44 punctuation: /:/
45 }
46 }
47 }
48 },
49 number: /[+-]?\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i,
50 punctuation: /[{}.,;()[\]]|\^\^/,
51 boolean: /\b(?:false|true)\b/,
52 keyword: [/(?:\ba|@prefix|@base)\b|=/, /\b(?:base|graph|prefix)\b/i],
53 tag: {
54 pattern: /@[a-z]+(?:-[a-z\d]+)*/i,
55 inside: {
56 punctuation: /@/
57 }
58 }
59 }
60 Prism.languages.trig = Prism.languages['turtle']
61}
Note: See TracBrowser for help on using the repository browser.