octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #46459] Interpreter allows number assignment t


From: Lachlan Andrew
Subject: [Octave-bug-tracker] [bug #46459] Interpreter allows number assignment to "end" key word within array brackets
Date: Thu, 18 Feb 2016 22:09:30 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Follow-up Comment #8, bug #46459 (project octave):

Thanks for taking charge of this, jwe.

I think the code already checks that the LHS of an assignment is not a
keyword.  The hitch is that the code to check if something is a keyword has a
special case to ignore "end" in this context.


octave_base_lexer::is_keyword_token (const std::string& s)
...
case end_kw:
  if (inside_any_object_index ()
      || (defining_func
          && ! (looking_at_return_list
                || parsed_function_name.top ())))
    {
      at_beginning_of_statement = previous_at_bos;
      return 0;
    }


(When I made the comment about performance, I hadn't realised that the parser
replaces all variable names with references to the particular symbol object; I
assumed the identifier strings were processed at runtime.)

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?46459>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]