diff libinterp/parse-tree/lex.ll @ 21369:105224df2330

also disallow assignment to keywords in assignin (bug #46459) * lex.ll (is_keyword): Don't treat "enumeration", "events", "methods", or "properties" as keywords. * oct-parse.in.yy, parse.h: New tests. (Fassignin): Check for assignments to keywords. (octave_base_parser::valid_id_for_assignment): Delete. (octave_base_parser::make_assign_op): Use is_keyword instead of valid_id_for_assignment.
author John W. Eaton <jwe@octave.org>
date Fri, 26 Feb 2016 20:35:45 -0500
parents db574711df78
children 986dbd769bb1
line wrap: on
line diff
--- a/libinterp/parse-tree/lex.ll	Sat Feb 27 15:27:52 2016 +1100
+++ b/libinterp/parse-tree/lex.ll	Fri Feb 26 20:35:45 2016 -0500
@@ -1973,9 +1973,13 @@
   // "set" and "get" portions of the names using the same mechanism as
   // is used for keywords.  However, they are not really keywords in
   // the language, so omit them from the list of possible keywords.
+  // Likewise for "enumeration", "events", "methods", and
+  // "properties".
 
   return (octave_kw_hash::in_word_set (s.c_str (), s.length ()) != 0
-          && ! (s == "set" || s == "get"));
+          && ! (s == "set" || s == "get"
+                || s == "enumeration" || s == "events"
+                || s == "methods" || s == "properties"));
 }
 
 DEFUN (iskeyword, args, ,