diff --git a/patacrep/songs/chordpro/syntax.py b/patacrep/songs/chordpro/syntax.py index d765b79a..37af7192 100644 --- a/patacrep/songs/chordpro/syntax.py +++ b/patacrep/songs/chordpro/syntax.py @@ -303,15 +303,12 @@ class ChordproParser(Parser): def p_error(self, token): super().p_error(token) - if not token: - # End of file - # Maybe it should raise an error ? - return token while True: token = self.parser.token() if not token or token.type == "ENDOFLINE": break - self.parser.errok() + if token: + self.parser.errok() return token def parse_song(content, filename=None):