linecache.checkcache = linecache_checkcache
+IDENTCHARS = string.ascii_letters + string.digits + "_"
+
+
# Note: <<newline-and-indent>> event is defined in AutoIndent.py
#$ event <<plain-newline-and-indent>>
text.tag_add("ERROR", pos)
text.see(pos)
char = text.get(pos)
- if char and char in string.letters + string.digits + "_":
+ if char and char in IDENTCHARS:
text.tag_add("ERROR", pos + " wordstart", pos)
self.tkconsole.resetoutput()
self.write("SyntaxError: %s\n" % str(msg))
oops = 'oops'
+IDENTSTARTCHARS = string.ascii_letters + '_'
+IDENTCHARS = string.ascii_letters + string.digits + '_'
+
# Check that string is a legal C identifier
def checkid(str):
if not str: return 0
- if not str[0] in string.letters+'_':
+ if not str[0] in IDENTSTARTCHARS:
return 0
for c in str[1:]:
- if not c in string.letters+string.digits+'_':
+ if not c in IDENTCHARS:
return 0
return 1