Skip to content

Commit c20c3ec

Browse files
committed
R: Fixed and simplified patterns
1 parent 530f5f0 commit c20c3ec

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

components/prism-r.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
Prism.languages.r = {
2-
'comment': /#.+/,
2+
'comment': /#.*/,
33
'string': /(['"])(?:\\?.)*?\1/,
44
'percent-operator': {
55
// Includes user-defined operators
66
// and %%, %*%, %/%, %in%, %o%, %x%
7-
pattern: /%[^%]*?%/,
7+
pattern: /%[^%\s]*%/,
88
alias: 'operator'
99
},
1010
'boolean': /\b(?:TRUE|FALSE)\b/,
1111
'ellipsis': /\.\.(?:\.|\d+)/,
1212
'number': [
1313
/\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/
1515
],
1616
'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': /->?>?|<(?:=|<?-)?|[>=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,
1818
'punctuation': /[(){}\[\],;]/
1919
};

components/prism-r.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)