discourse/vendor/assets/javascripts/highlightjs/languages/r.min.js

1 line
2.5 KiB
JavaScript

hljs.registerLanguage("r",function(){"use strict";return function(e){const n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/;return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.characteras.complex as.double as.environment as.integer as.logicalas.null.default as.numeric as.raw asin asinh atan atanh attrattributes baseenv browser c call ceiling class Conj cos coshcospi cummax cummin cumprod cumsum digamma dim dimnamesemptyenv exp expression floor forceAndCall gamma gc.timeglobalenv Im interactive invisible is.array is.atomic is.callis.character is.complex is.double is.environment is.expressionis.finite is.function is.infinite is.integer is.languageis.list is.logical is.matrix is.na is.name is.nan is.nullis.numeric is.object is.pairlist is.raw is.recursive is.singleis.symbol lazyLoadDBfetch length lgamma list log max minmissing Mod names nargs nzchar oldClass on.exit pos.to.envproc.time prod quote range Re rep retracemem return roundseq_along seq_len seq.int sign signif sin sinh sinpi sqrtstandardGeneric substitute sum switch tan tanh tanpi tracememtrigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{className:"doctag",begin:"@examples",starts:{contains:[{begin:/\n/},{begin:/#'\s*(?=@[a-zA-Z]+)/,endsParent:!0},{begin:/#'/,end:/$/,excludeBegin:!0}]}},{className:"doctag",begin:"@param",end:/$/,contains:[{className:"variable",variants:[{begin:n},{begin:/`(?:\\.|[^`])+`/}],endsParent:!0}]},{className:"doctag",begin:/@[a-zA-Z]+/},{className:"meta-keyword",begin:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{className:"number",variants:[{begin:/(?<![a-zA-Z0-9._])0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/},{begin:/(?<![a-zA-Z0-9._])0[xX][0-9a-fA-F]+([pP][+-]?\d+)?[Li]?/},{begin:/(?<![a-zA-Z0-9._])(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?[Li]?/}],relevance:0},{begin:"%",end:"%"},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}}());