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.3 KB
|
Line | |
---|
1 | 'use strict'
|
---|
2 |
|
---|
3 | module.exports = jsstacktrace
|
---|
4 | jsstacktrace.displayName = 'jsstacktrace'
|
---|
5 | jsstacktrace.aliases = []
|
---|
6 | function jsstacktrace(Prism) {
|
---|
7 | Prism.languages.jsstacktrace = {
|
---|
8 | 'error-message': {
|
---|
9 | pattern: /^\S.*/m,
|
---|
10 | alias: 'string'
|
---|
11 | },
|
---|
12 | 'stack-frame': {
|
---|
13 | pattern: /(^[ \t]+)at[ \t].*/m,
|
---|
14 | lookbehind: true,
|
---|
15 | inside: {
|
---|
16 | 'not-my-code': {
|
---|
17 | pattern:
|
---|
18 | /^at[ \t]+(?!\s)(?:node\.js|<unknown>|.*(?:node_modules|\(<anonymous>\)|\(<unknown>|<anonymous>$|\(internal\/|\(node\.js)).*/m,
|
---|
19 | alias: 'comment'
|
---|
20 | },
|
---|
21 | filename: {
|
---|
22 | pattern: /(\bat\s+(?!\s)|\()(?:[a-zA-Z]:)?[^():]+(?=:)/,
|
---|
23 | lookbehind: true,
|
---|
24 | alias: 'url'
|
---|
25 | },
|
---|
26 | function: {
|
---|
27 | pattern:
|
---|
28 | /(\bat\s+(?:new\s+)?)(?!\s)[_$a-zA-Z\xA0-\uFFFF<][.$\w\xA0-\uFFFF<>]*/,
|
---|
29 | lookbehind: true,
|
---|
30 | inside: {
|
---|
31 | punctuation: /\./
|
---|
32 | }
|
---|
33 | },
|
---|
34 | punctuation: /[()]/,
|
---|
35 | keyword: /\b(?:at|new)\b/,
|
---|
36 | alias: {
|
---|
37 | pattern: /\[(?:as\s+)?(?!\s)[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\]/,
|
---|
38 | alias: 'variable'
|
---|
39 | },
|
---|
40 | 'line-number': {
|
---|
41 | pattern: /:\d+(?::\d+)?\b/,
|
---|
42 | alias: 'number',
|
---|
43 | inside: {
|
---|
44 | punctuation: /:/
|
---|
45 | }
|
---|
46 | }
|
---|
47 | }
|
---|
48 | }
|
---|
49 | }
|
---|
50 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.