Skip to content

Commit

Permalink
Rust: Simplified patterns and fixed operators
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Aug 30, 2015
1 parent 1093f7d commit 6c8494f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions components/prism-rust.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Prism.languages.rust = {
lookbehind: true
},
{
pattern: /(^|[^\\:])\/\/.*?(\r?\n|$)/,
pattern: /(^|[^\\:])\/\/.*/,
lookbehind: true
}
],
Expand All @@ -38,7 +38,7 @@ Prism.languages.rust = {
},

// Hex, oct, bin, dec numbers with visual separators and type suffix
'number': /\b-?(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(\d(_?\d)*)?\.?\d(_?\d)*([Ee][+-]?\d+)?)(?:_?(?:[iu](?:8|16|32)?|f32|f64))?\b/,
'number': /\b-?(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(\d(_?\d)*)?\.?\d(_?\d)*([Ee][+-]?\d+)?)(?:_?(?:[iu](?:8|16|32|64)?|f32|f64))?\b/,

// Closure params should not be confused with bitwise OR |
'closure-params': {
Expand All @@ -48,6 +48,6 @@ Prism.languages.rust = {
'operator': /[&*]/
}
},
'punctuation': /[{}[\];(),.:]|->/,
'operator': /[-+]{1,2}|!=?|<=?|>=?|={1,3}|&&?|\|\|?|\*|\/|\^|%|<<|>>@/
'punctuation': /[{}[\];(),:]|\.+|->/,
'operator': /[-+*\/%!^=]=?|@|&[&=]?|\|[|=]?|<<?=?|>>?=?/
};
2 changes: 1 addition & 1 deletion components/prism-rust.min.js

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

0 comments on commit 6c8494f

Please sign in to comment.