File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ def linecache_checkcache(orig_checkcache=linecache.checkcache):
3636linecache .checkcache = linecache_checkcache
3737
3838
39+ IDENTCHARS = string .ascii_letters + string .digits + "_"
40+
41+
3942# Note: <<newline-and-indent>> event is defined in AutoIndent.py
4043
4144#$ event <<plain-newline-and-indent>>
@@ -217,7 +220,7 @@ def showsyntaxerror(self, filename=None):
217220 text .tag_add ("ERROR" , pos )
218221 text .see (pos )
219222 char = text .get (pos )
220- if char and char in string . letters + string . digits + "_" :
223+ if char and char in IDENTCHARS :
221224 text .tag_add ("ERROR" , pos + " wordstart" , pos )
222225 self .tkconsole .resetoutput ()
223226 self .write ("SyntaxError: %s\n " % str (msg ))
Original file line number Diff line number Diff line change 3030
3131oops = 'oops'
3232
33+ IDENTSTARTCHARS = string .ascii_letters + '_'
34+ IDENTCHARS = string .ascii_letters + string .digits + '_'
35+
3336# Check that string is a legal C identifier
3437def checkid (str ):
3538 if not str : return 0
36- if not str [0 ] in string . letters + '_' :
39+ if not str [0 ] in IDENTSTARTCHARS :
3740 return 0
3841 for c in str [1 :]:
39- if not c in string . letters + string . digits + '_' :
42+ if not c in IDENTCHARS :
4043 return 0
4144 return 1
4245
You can’t perform that action at this time.
0 commit comments