OLD | NEW |
1 Prism.languages.r = { | 1 Prism.languages.r = { |
2 » 'comment': /#.+/, | 2 » 'comment': /#.*/, |
3 'string': /(['"])(?:\\?.)*?\1/, | 3 'string': /(['"])(?:\\?.)*?\1/, |
4 'percent-operator': { | 4 'percent-operator': { |
5 // Includes user-defined operators | 5 // Includes user-defined operators |
6 // and %%, %*%, %/%, %in%, %o%, %x% | 6 // and %%, %*%, %/%, %in%, %o%, %x% |
7 » » pattern: /%[^%]*?%/, | 7 » » pattern: /%[^%\s]*%/, |
8 alias: 'operator' | 8 alias: 'operator' |
9 }, | 9 }, |
10 'boolean': /\b(?:TRUE|FALSE)\b/, | 10 'boolean': /\b(?:TRUE|FALSE)\b/, |
11 'ellipsis': /\.\.(?:\.|\d+)/, | 11 'ellipsis': /\.\.(?:\.|\d+)/, |
12 'number': [ | 12 'number': [ |
13 /\b(?:NaN|Inf)\b/, | 13 /\b(?:NaN|Inf)\b/, |
14 » » /\b(?:0x[\dA-Fa-f]+(?:\.\d*)?|\d*\.?\d+)(?:[EePp][+-]??\d+)?[iL]
?\b/ | 14 » » /\b(?:0x[\dA-Fa-f]+(?:\.\d*)?|\d*\.?\d+)(?:[EePp][+-]?\d+)?[iL]?
\b/ |
15 ], | 15 ], |
16 'keyword': /\b(?:if|else|repeat|while|function|for|in|next|break|NULL|NA
|NA_integer_|NA_real_|NA_complex_|NA_character_)\b/, | 16 'keyword': /\b(?:if|else|repeat|while|function|for|in|next|break|NULL|NA
|NA_integer_|NA_real_|NA_complex_|NA_character_)\b/, |
17 » 'operator': /->>?|<?<-|[<>!=]=?|::?|&&?|\|\|?|[+\-*\/^$@~]/, | 17 » 'operator': /->?>?|<(?:=|<?-)?|[>=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/, |
18 'punctuation': /[(){}\[\],;]/ | 18 'punctuation': /[(){}\[\],;]/ |
19 }; | 19 }; |
OLD | NEW |