source: node_modules/refractor/lang/r.js

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
RevLine 
[d24f17c]1'use strict'
2
3module.exports = r
4r.displayName = 'r'
5r.aliases = []
6function 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.