Subject: Re: bug#22241: 25.0.50; etags Ruby parser problems

From: Eli Zaretskii <[email-masked]>
Date: Sun, 31 Jan 2016 20:01:15 +0200

> Date: Sun, 31 Jan 2016 05:37:03 +0200
> From: Eli Zaretskii <[email-masked]>
> Cc: [email-masked]
> 
> > Second: a minor thing. If I remove the space after '=', 'ABC =4' doesn't 
> > get recorded.
> 
> Will fix.

But that was a trap, wasn't it?  What can legitimately follow the '+',
in addition to whitespace?  (It's amazing, but among all the gazillion
references to Ruby, I cannot easily find a formal description of its
syntax.)  According to this rare gem:

  https://en.wikibooks.org/wiki/Ruby_Programming/Syntax

(assuming I understand what it says), the RHS can be any literal, and
also any constant expression, is that right?  If so, either (a) we
recognize only '^[ \t]([A-Z][a-z0-9_])*[ \t]*=' and get potential
false positives on the likes of

   ABC == SOMETHING
   ABC =< WHATEVER

etc. (are these possible?); or (b) you tell me which characters can
potentially follow the '=' in an assignment of a constant.  My current
best guess for the latter is this:

    " # % \' ( + - < ? [ {
    0 1 2 3 4 5 6 7 8 9
    A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

And if we go the latter way, there are still multi-line expressions
that I think are way too much.

Ugh!