Commit f33cdba8 authored by Per Cederqvist's avatar Per Cederqvist

(lexer.run): It is not OK to reach EOF.

(lexer.ignore): Ignore @display.
(lexer.toplevel_bye): Exit when reaching "bye".
(lexer.__parse_userdefined_types): Ignore @need commands.
parent effeda85
......@@ -244,10 +244,7 @@ class lexer:
def run(self):
while 1:
c = self.__reader.getc_eofok()
if c == None:
self.__reader.check_paren_null()
return self.__reader.errfound()
c = self.__reader.getc()
if c == '@':
self.__toplevel_at()
......@@ -379,6 +376,7 @@ class lexer:
toplevel_reqexample = ignore
toplevel_anchor = ignore
toplevel_appendix = ignore
toplevel_display = ignore #
def toplevel_node(self, arg, line_no):
if self.__findex != None:
......@@ -562,6 +560,14 @@ class lexer:
self.error(self.__reader.line_no(),
"asynchronous message ``%s'' not documented" % req)
self.__reader.check_paren_null()
# This is the normal exit of the program. It isn't nice to hide
# it deep in the code like this, but neither is having an EOF
# command before the real EOF of the file.
sys.exit(self.__reader.errfound())
def toplevel_reqdlink(self, arg, line_no):
self.__assert_no_linkhere()
......@@ -629,6 +635,9 @@ class lexer:
self.error(self.__reader.line_no(),
"``@end example'' expected")
break
if newtype == '@need':
self.__get_token() # Skip the argument to @need.
newtype = self.__get_token()
if newtype == '@anchor':
if self.__get_token() != '{':
self.error(self.__reader.line_no(),
......
Markdown is supported
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