diff -r 7941677dc77d pygments/lexers/lisp.py --- a/pygments/lexers/lisp.py Mon Mar 13 19:16:03 2017 +0000 +++ b/pygments/lexers/lisp.py Wed Jul 04 18:03:07 2018 +0200 @@ -2327,13 +2327,13 @@ token = Name.Function if token == Literal else token yield index, token, value - raise StopIteration + return def _process_signature(self, tokens): for index, token, value in tokens: if token == Literal and value == '}': yield index, Punctuation, value - raise StopIteration + return elif token in (Literal, Name.Function): token = Name.Variable if value.istitle() else Keyword.Type yield index, token, value diff -r 7941677dc77d pygments/lexers/sql.py --- a/pygments/lexers/sql.py Mon Mar 13 19:16:03 2017 +0000 +++ b/pygments/lexers/sql.py Wed Jul 04 18:03:07 2018 +0200 @@ -347,7 +347,10 @@ # Emit the output lines out_token = Generic.Output while 1: - line = next(lines) + try: + line = next(lines) + except StopIteration: + return mprompt = re_prompt.match(line) if mprompt is not None: # push the line back to have it processed by the prompt