Regexp starting with = doesn't get highlighted.
When doing the regexp:
/=\Z/
it doesn't get highlighted. It seems to only happen with =
It gets highlighted if you write:
/\=\Z/
But I think both are the same valid regular expression.
Ugh, this is annoying:
{
'comment': 'Needs higher precidence than regular expressions.'
'match': '(?<!\\()/='
'name': 'keyword.operator.assignment.augmented.ruby'
}
No more easy fix :(
@envygeeks @nokutu do you two have any ideas about how to differentiate between /= and a regular expression starting with /=?
/= is not valid Ruby, from what I gander it's trying to test for []=( as in:
def []=(key, val)
$stdout.puts key, val
end
Well... supposed to be trying to match it, I don't know why the / is there. Seems like a bug to me.
Since the scope is keyword.operator.assignment.augmented I believe it is actually trying to match /= (an "augmented" operator that assigns something).
~~If it's not valid though...hopefully should be a simple deletion!~~
EDIT: Just did some quick googling and it looks like /= is valid after all: something like 6 /= 3 should work.
@50Wliu you're right, I forgot about that since like literally nobody ever uses it, actually needs to be a var so you'll have to do something like x = 120; x /= 12 It's for assigning the result of the division. You can actually do it with all Maths operators: **=, *=, /=, +=, -=
Actually needs to be a var
I should probably rephrase, it needs to have a setter.