[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] emacs-25 504696d: Etags: yet another improvement in Ru
From: |
Eli Zaretskii |
Subject: |
Re: [Emacs-diffs] emacs-25 504696d: Etags: yet another improvement in Ruby tags |
Date: |
Thu, 04 Feb 2016 19:28:46 +0200 |
> Cc: address@hidden
> From: Dmitry Gutov <address@hidden>
> Date: Thu, 4 Feb 2016 12:36:25 +0300
>
> >>> + alias_method :qux, :tee, attr_accessor :bogus
> >>
> >> This one is a bit weird as well:
> >>
> >> - An alias_method call with three arguments will raise an ArgumentError.
> >
> > It's there to test the algorithm, which should not tag the bogus
> > accessor.
>
> Why is it bogus, though?
Because its syntax is invalid.
> For instance, these examples are syntactically valid and would result in
> the generation of the method 'foo':
>
> class C
> puts(attr_accessor :foo)
> end
>
> class C
> 1 + 2; attr_reader :bar
> end
>
> We don't really need to support them, but actively fighting against them
> seems odd.
We don't fight them. The above 2 examples work as expected, please
try them (if you didn't already).
The example which is in the test file specifically tests the handling
of stuff that follows a comma after alias_method, since that requires
some logic I wanted to be sure I got right.
> Point is, the example code is syntactically invalid. etags doesn't need
> to handle that kind of code at all, right?
No, but I wanted to be sure the invalid code doesn't adversely affect
valid code further in the file.
> It would be better to get a syntactically-valid example, if we an
> find one.
If you can, by all means. As I don't speak Ruby, I just went with the
simplest one I could throw together.
- Re: [Emacs-diffs] emacs-25 504696d: Etags: yet another improvement in Ruby tags, Dmitry Gutov, 2016/02/03
- Re: [Emacs-diffs] emacs-25 504696d: Etags: yet another improvement in Ruby tags, Eli Zaretskii, 2016/02/03
- Re: [Emacs-diffs] emacs-25 504696d: Etags: yet another improvement in Ruby tags, Dmitry Gutov, 2016/02/04
- Re: [Emacs-diffs] emacs-25 504696d: Etags: yet another improvement in Ruby tags,
Eli Zaretskii <=
- Re: [Emacs-diffs] emacs-25 504696d: Etags: yet another improvement in Ruby tags, Dmitry Gutov, 2016/02/05
- Re: [Emacs-diffs] emacs-25 504696d: Etags: yet another improvement in Ruby tags, Dmitry Gutov, 2016/02/05
- Re: [Emacs-diffs] emacs-25 504696d: Etags: yet another improvement in Ruby tags, Eli Zaretskii, 2016/02/05
- Re: [Emacs-diffs] emacs-25 504696d: Etags: yet another improvement in Ruby tags, Dmitry Gutov, 2016/02/05
- Re: [Emacs-diffs] emacs-25 504696d: Etags: yet another improvement in Ruby tags, Eli Zaretskii, 2016/02/05
- Re: [Emacs-diffs] emacs-25 504696d: Etags: yet another improvement in Ruby tags, Eli Zaretskii, 2016/02/05
- Re: [Emacs-diffs] emacs-25 504696d: Etags: yet another improvement in Ruby tags, Dmitry Gutov, 2016/02/05
- Re: [Emacs-diffs] emacs-25 504696d: Etags: yet another improvement in Ruby tags, Eli Zaretskii, 2016/02/05
- Re: [Emacs-diffs] emacs-25 504696d: Etags: yet another improvement in Ruby tags, Eli Zaretskii, 2016/02/06