mirror of
https://github.com/Funkoala14/knowledgebase_law.git
synced 2025-06-09 02:04:10 +08:00
30 lines
741 B
JavaScript
30 lines
741 B
JavaScript
|
'use strict'
|
||
|
var refractorYaml = require('./yaml.js')
|
||
|
module.exports = tap
|
||
|
tap.displayName = 'tap'
|
||
|
tap.aliases = []
|
||
|
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'
|
||
|
}
|
||
|
}
|
||
|
}
|