Skip to content

Commit

Permalink
R: Fixed and simplified patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Aug 30, 2015
1 parent 530f5f0 commit c20c3ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions components/prism-r.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
Prism.languages.r = {
'comment': /#.+/,
'comment': /#.*/,
'string': /(['"])(?:\\?.)*?\1/,
'percent-operator': {
// Includes user-defined operators
// and %%, %*%, %/%, %in%, %o%, %x%
pattern: /%[^%]*?%/,
pattern: /%[^%\s]*%/,
alias: 'operator'
},
'boolean': /\b(?:TRUE|FALSE)\b/,
'ellipsis': /\.\.(?:\.|\d+)/,
'number': [
/\b(?:NaN|Inf)\b/,
/\b(?:0x[\dA-Fa-f]+(?:\.\d*)?|\d*\.?\d+)(?:[EePp][+-]??\d+)?[iL]?\b/
/\b(?:0x[\dA-Fa-f]+(?:\.\d*)?|\d*\.?\d+)(?:[EePp][+-]?\d+)?[iL]?\b/
],
'keyword': /\b(?:if|else|repeat|while|function|for|in|next|break|NULL|NA|NA_integer_|NA_real_|NA_complex_|NA_character_)\b/,
'operator': /->>?|<?<-|[<>!=]=?|::?|&&?|\|\|?|[+\-*\/^$@~]/,
'operator': /->?>?|<(?:=|<?-)?|[>=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,
'punctuation': /[(){}\[\],;]/
};
2 changes: 1 addition & 1 deletion components/prism-r.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c20c3ec

Please sign in to comment.