Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Per Cederqvist
lyskom-server-ceder-1616-generations-topgit
Commits
c752fa27
Commit
c752fa27
authored
Aug 16, 2002
by
Per Cederqvist
Browse files
(islower): New function. Use it instead of "".islower.
(isspace): New function. Use it instead of "".isspace.
parent
32f68d0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
doc/checkargs.py
View file @
c752fa27
...
...
@@ -67,12 +67,24 @@ def isupper(s):
return
0
return
1
def
islower
(
s
):
for
c
in
s
:
if
c
not
in
"abcdefghijklmnopqrstuvwxyz"
:
return
0
return
1
def
isdigit
(
s
):
for
c
in
s
:
if
c
not
in
"0123456789"
:
return
0
return
1
def
isspace
(
s
):
for
c
in
s
:
if
c
not
in
"
\n
"
:
# There should be no \t or \r in this file...
return
0
return
1
class
reader_eof
(
Exception
):
pass
...
...
@@ -1127,7 +1139,7 @@ class lexer:
else
:
if
c
==
'-'
:
upper
=
1
elif
not
c
.
islower
():
elif
not
islower
(
c
):
ok
=
0
if
ok
and
tp
[
-
1
]
==
'-'
:
ok
=
0
...
...
@@ -1143,10 +1155,10 @@ class lexer:
ok
=
1
if
len
(
arg
)
<
0
:
ok
=
0
if
ok
and
not
arg
[
0
].
islower
():
if
ok
and
not
islower
(
arg
[
0
]
):
ok
=
0
for
c
in
arg
[
1
:]:
if
not
c
.
islower
()
and
c
!=
'-'
:
if
not
islower
(
c
)
and
c
!=
'-'
:
ok
=
0
if
ok
and
arg
[
-
1
]
==
'-'
:
ok
=
0
...
...
@@ -1191,7 +1203,7 @@ class lexer:
del
self
.
__tokens
[
0
]
return
res
c
=
self
.
__reader
.
getc
()
while
c
.
isspace
():
while
isspace
(
c
):
c
=
self
.
__reader
.
getc
()
if
isalpha
(
c
):
res
=
c
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment