Commit ffec8c33 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(isupper): New function. Use it instead of "".isupper.

parent d7a3f843
...@@ -61,6 +61,12 @@ def isalpha(s): ...@@ -61,6 +61,12 @@ def isalpha(s):
return 0 return 0
return 1 return 1
def isupper(s):
for c in s:
if c not in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
return 0
return 1
def isdigit(s): def isdigit(s):
for c in s: for c in s:
if c not in "0123456789": if c not in "0123456789":
...@@ -1110,12 +1116,12 @@ class lexer: ...@@ -1110,12 +1116,12 @@ class lexer:
ok = 1 ok = 1
if len(tp) < 0: if len(tp) < 0:
ok = 0 ok = 0
if ok and not tp[0].isupper(): if ok and not isupper(tp[0]):
ok = 0 ok = 0
upper = 0 upper = 0
for c in tp[1:]: for c in tp[1:]:
if upper: if upper:
if c == '-' or not c.isupper(): if c == '-' or not isupper(c):
ok = 0 ok = 0
upper = 0 upper = 0
else: else:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment