Skip to content

Commit bf1dc80

Browse files
committed
Make <- less of a signal boost for R
1 parent c4d7b81 commit bf1dc80

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/languages/r.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,21 @@ export default function(hljs) {
202202

203203
// Operators/punctuation when they're not directly followed by numbers
204204
{
205+
// Avoid false detections of other languages.
205206
scope: 'operator',
207+
relevance: 0,
206208
match: /<-/
207209
},
210+
{
211+
// Relevance boost for the most common assignment form.
212+
scope: { 3: 'operator' },
213+
match: [
214+
IDENT_RE,
215+
/\s+/,
216+
/<-/,
217+
/\s+/
218+
]
219+
},
208220
{
209221
scope: 'operator',
210222
variants: [

0 commit comments

Comments
 (0)