diff src/symtab.cc @ 1962:d329b8ea86e8

[project @ 1996-02-16 04:24:22 by jwe]
author jwe
date Fri, 16 Feb 1996 04:24:56 +0000
parents e62277bf5fe0
children 003570e69c7b
line wrap: on
line diff
--- a/src/symtab.cc	Fri Feb 16 04:04:52 1996 +0000
+++ b/src/symtab.cc	Fri Feb 16 04:24:56 1996 +0000
@@ -29,6 +29,8 @@
 #include <config.h>
 #endif
 
+#include <cctype>
+
 #include "oct-glob.h"
 #include "str-vec.h"
 
@@ -1156,6 +1158,21 @@
   return h;
 }
 
+// Return nonzero if S is a valid identifier.
+
+int
+valid_identifier (const char *s)
+{
+  if (! s || ! (isalnum (*s) || *s == '_'))
+     return 0;
+
+  while (*++s != '\0')
+    if (! (isalnum (*s) || *s == '_'))
+      return 0;
+
+  return 1;
+}
+
 /*
 ;;; Local Variables: ***
 ;;; mode: C++ ***