-
-
Notifications
You must be signed in to change notification settings - Fork 34
/
tap.js
31 lines (29 loc) · 779 Bytes
/
tap.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// @ts-nocheck
import refractorYaml from './yaml.js'
tap.displayName = 'tap'
tap.aliases = []
/** @type {import('../core.js').Syntax} */
export default function tap(Prism) {
Prism.register(refractorYaml)
// https://en.wikipedia.org/wiki/Test_Anything_Protocol
Prism.languages.tap = {
fail: /not ok[^#{\n\r]*/,
pass: /ok[^#{\n\r]*/,
pragma: /pragma [+-][a-z]+/,
bailout: /bail out!.*/i,
version: /TAP version \d+/i,
plan: /\b\d+\.\.\d+(?: +#.*)?/,
subtest: {
pattern: /# Subtest(?:: .*)?/,
greedy: true
},
punctuation: /[{}]/,
directive: /#.*/,
yamlish: {
pattern: /(^[ \t]*)---[\s\S]*?[\r\n][ \t]*\.\.\.$/m,
lookbehind: true,
inside: Prism.languages.yaml,
alias: 'language-yaml'
}
}
}