-
-
Notifications
You must be signed in to change notification settings - Fork 36
/
dart.js
30 lines (29 loc) · 1.04 KB
/
dart.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
import refractorClike from './clike.js'
dart.displayName = 'dart'
dart.aliases = []
export default function dart(Prism) {
Prism.register(refractorClike)
Prism.languages.dart = Prism.languages.extend('clike', {
string: [
{
pattern: /r?("""|''')[\s\S]*?\1/,
greedy: true
},
{
pattern: /r?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
greedy: true
}
],
keyword: [
/\b(?:async|sync|yield)\*/,
/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extension|external|extends|factory|final|finally|for|Function|get|hide|if|implements|interface|import|in|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/
],
operator: /\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/
})
Prism.languages.insertBefore('dart', 'function', {
metadata: {
pattern: /@\w+/,
alias: 'symbol'
}
})
}