main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
829 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | 'use strict'
|
---|
| 2 |
|
---|
| 3 | module.exports = r
|
---|
| 4 | r.displayName = 'r'
|
---|
| 5 | r.aliases = []
|
---|
| 6 | function r(Prism) {
|
---|
| 7 | Prism.languages.r = {
|
---|
| 8 | comment: /#.*/,
|
---|
| 9 | string: {
|
---|
| 10 | pattern: /(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,
|
---|
| 11 | greedy: true
|
---|
| 12 | },
|
---|
| 13 | 'percent-operator': {
|
---|
| 14 | // Includes user-defined operators
|
---|
| 15 | // and %%, %*%, %/%, %in%, %o%, %x%
|
---|
| 16 | pattern: /%[^%\s]*%/,
|
---|
| 17 | alias: 'operator'
|
---|
| 18 | },
|
---|
| 19 | boolean: /\b(?:FALSE|TRUE)\b/,
|
---|
| 20 | ellipsis: /\.\.(?:\.|\d+)/,
|
---|
| 21 | number: [
|
---|
| 22 | /\b(?:Inf|NaN)\b/,
|
---|
| 23 | /(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/
|
---|
| 24 | ],
|
---|
| 25 | keyword:
|
---|
| 26 | /\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,
|
---|
| 27 | operator: /->?>?|<(?:=|<?-)?|[>=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,
|
---|
| 28 | punctuation: /[(){}\[\],;]/
|
---|
| 29 | }
|
---|
| 30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.