You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the unless keyword is the opposite of the if keyword in Ruby syntax1.
On the other hand, there is a slight difference in the naming of the two in prism's AST. While if_node has the field if_keyword_loc, the unlless_node has keyword_loc instead of unless_keyword_loc.
If the property names were identical, I could successfully treat them as opposite pairs in my application using prism, but I had to write a conditional branch because of this difference.
Is there an intentional reason for this difference?
Footnotes
Although strictly speaking, there is a difference in whether or not eislf can be used. ↩
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I think the
unless
keyword is the opposite of theif
keyword in Ruby syntax1.On the other hand, there is a slight difference in the naming of the two in prism's AST. While
if_node
has the fieldif_keyword_loc
, theunlless_node
haskeyword_loc
instead ofunless_keyword_loc
.If the property names were identical, I could successfully treat them as opposite pairs in my application using prism, but I had to write a conditional branch because of this difference.
Is there an intentional reason for this difference?
Footnotes
Although strictly speaking, there is a difference in whether or not
eislf
can be used. ↩Beta Was this translation helpful? Give feedback.
All reactions