changeset 26203:3c445cd7f1a4

Don't accept '$' as a valid character in variable names. * utils.cc (valid_identifier): Remove '$' from the list of characters accepted in a valid identifier.
author Rik <rik@octave.org>
date Tue, 11 Dec 2018 15:04:06 -0800
parents 368dc1142072
children 82b9b970ff19
files libinterp/corefcn/utils.cc
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/utils.cc	Tue Dec 11 13:14:09 2018 -0800
+++ b/libinterp/corefcn/utils.cc	Tue Dec 11 15:04:06 2018 -0800
@@ -74,11 +74,11 @@
 
   bool valid_identifier (const char *s)
   {
-    if (! s || ! (isalpha (*s) || *s == '_' || *s == '$'))
+    if (! s || ! (isalpha (*s) || *s == '_'))
       return false;
 
     while (*++s != '\0')
-      if (! (isalnum (*s) || *s == '_' || *s == '$'))
+      if (! (isalnum (*s) || *s == '_'))
         return false;
 
     return true;