-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
96 changed files
with
6,460 additions
and
1,029 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// https://tools.ietf.org/html/rfc4180 | ||
|
||
Prism.languages.csv = { | ||
'value': /[^\r\n,"]+|"(?:[^"]|"")*"(?!")/, | ||
'punctuation': /,/ | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Prism.languages.csv={value:/[^\r\n,"]+|"(?:[^"]|"")*"(?!")/,punctuation:/,/}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,67 @@ | ||
Prism.languages.dart = Prism.languages.extend('clike', { | ||
'string': [ | ||
{ | ||
pattern: /r?("""|''')[\s\S]*?\1/, | ||
greedy: true | ||
}, | ||
{ | ||
pattern: /r?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/, | ||
greedy: true | ||
} | ||
], | ||
'keyword': [ | ||
(function (Prism) { | ||
var keywords = [ | ||
/\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|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/ | ||
}); | ||
/\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|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/ | ||
]; | ||
|
||
// Handles named imports, such as http.Client | ||
var packagePrefix = /(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source; | ||
|
||
// based on the dart naming conventions | ||
var className = { | ||
pattern: RegExp(packagePrefix + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source), | ||
lookbehind: true, | ||
inside: { | ||
'namespace': { | ||
pattern: /^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/, | ||
inside: { | ||
'punctuation': /\./ | ||
} | ||
}, | ||
} | ||
}; | ||
|
||
Prism.languages.insertBefore('dart','function',{ | ||
'metadata': { | ||
pattern: /@\w+/, | ||
alias: 'symbol' | ||
} | ||
}); | ||
Prism.languages.dart = Prism.languages.extend('clike', { | ||
'string': [ | ||
{ | ||
pattern: /r?("""|''')[\s\S]*?\1/, | ||
greedy: true | ||
}, | ||
{ | ||
pattern: /r?(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/, | ||
greedy: true | ||
} | ||
], | ||
'class-name': [ | ||
className, | ||
{ | ||
// variables and parameters | ||
// this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods) | ||
pattern: RegExp(packagePrefix + /[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source), | ||
lookbehind: true, | ||
inside: className.inside | ||
} | ||
], | ||
'keyword': keywords, | ||
'operator': /\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/ | ||
}); | ||
|
||
Prism.languages.insertBefore('dart','function',{ | ||
'metadata': { | ||
pattern: /@\w+/, | ||
alias: 'symbol' | ||
} | ||
}); | ||
|
||
Prism.languages.insertBefore('dart','class-name',{ | ||
'generics': { | ||
pattern: /<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/, | ||
inside: { | ||
'class-name': className, | ||
'keyword': keywords, | ||
'punctuation': /[<>(),.:]/, | ||
'operator': /[?&|]/ | ||
} | ||
}, | ||
}); | ||
}(Prism)); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
(function (Prism) { | ||
/** | ||
* Based on the manual by Wouter van Oortmerssen. | ||
* | ||
* @see {@link https://github.com/PrismJS/prism/issues/2801#issue-829717504} | ||
*/ | ||
Prism.languages['false'] = { | ||
'comment': { | ||
pattern: /\{[^}]*\}/ | ||
}, | ||
'string': { | ||
pattern: /"[^"]*"/, | ||
greedy: true | ||
}, | ||
'character-code': { | ||
pattern: /'[\S\s]/, | ||
alias: 'number' | ||
}, | ||
'assembler-code': { | ||
pattern: /\d+`/, | ||
alias: 'important' | ||
}, | ||
'number': /\d+/, | ||
'operator': /[-!#$%&'*+,./:;=>?@\\^_`|~ßø]/, | ||
'punctuation': /\[|\]/, | ||
'variable': /[a-z]/, | ||
'non-standard': { | ||
pattern: /[()<BDO®]/, | ||
alias: 'bold' | ||
} | ||
}; | ||
}(Prism)); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.