GithubHelp home page GithubHelp logo

Comments (7)

nokutu avatar nokutu commented on June 27, 2024

It gets highlighted if you write:

/\=\Z/

But I think both are the same valid regular expression.

from language-ruby.

50Wliu avatar 50Wliu commented on June 27, 2024

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 /=?

from language-ruby.

envygeeks avatar envygeeks commented on June 27, 2024

/= is not valid Ruby, from what I gander it's trying to test for []=( as in:

def []=(key, val)
  $stdout.puts key, val
end

from language-ruby.

envygeeks avatar envygeeks commented on June 27, 2024

Well... supposed to be trying to match it, I don't know why the / is there. Seems like a bug to me.

from language-ruby.

50Wliu avatar 50Wliu commented on June 27, 2024

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.

from language-ruby.

envygeeks avatar envygeeks commented on June 27, 2024

@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: **=, *=, /=, +=, -=

from language-ruby.

envygeeks avatar envygeeks commented on June 27, 2024

Actually needs to be a var

I should probably rephrase, it needs to have a setter.

from language-ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.