Closed mashedkeyboard closed 3 years ago
Same with three dots (tDOT3)
Model.where(updated_at: ...5.years.ago)
Yup. Want to take a whack at it?
Just to leave it documented, I also had issues with endless methods. I can try to come up with a PR for those cases Ryan. Just need a couple days. <3
Note that there's a new "forward everything" argument that is triple dots, that also breaks brakeman. For info on the syntax: https://blog.saeloun.com/2019/12/04/ruby-2-7-adds-new-operator-for-arguments-forwarding.html
"Beginless" ranges are working on master, I believe.
And argument forwarding (triple dots) is in progress: #316 😉
@presidentbeef I can confirm that beginless ranges (at least the triple dot version) are not supported on main/5.1.1
:/
@DylanReile should be if you use the brakeman 5.1.1 gem. Otherwise... yes, it's not released yet in ruby_parser.
@presidentbeef Hmm, I was using the brakeman 5.1.1 gem via bundle exec brakeman
Oops, I misread this issue. Is your code similar to https://github.com/presidentbeef/brakeman/issues/1483#issuecomment-846500246?
9225 % for S in ..1 2.. ...3 4... ; do rake debug R="$S"; done
s(:dot2, nil, s(:lit, 1))
s(:dot2, s(:lit, 2), nil)
s(:dot3, nil, s(:lit, 3))
s(:dot3, s(:lit, 4), nil)
release coming soonish
Hi folks,
In Rails, this is valid syntax:
The infinite range is used to mean anything prior to 5 years ago, inclusive of today. However, this throws an error in ruby_parse:
Interestingly, this seems to only be a problem when it's an infinite backwards range. Take the below examples:
but
It'd be great to get this fixed! :) I'm using
ruby_parser (3.15.0)
withruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
.Thanks!