Browse Source

Localize were the error parsing should be made

pull/172/head
Oliverpool 9 years ago
parent
commit
4cbbe29d28
  1. 8
      patacrep/songs/chordpro/syntax.py

8
patacrep/songs/chordpro/syntax.py

@ -313,7 +313,13 @@ class ChordproParser(Parser):
def parse_song(content, filename=None):
"""Parse song and return its metadata."""
return ChordproParser(filename).parse(
parser = ChordproParser(filename)
parsed_content = parser.parse(
content,
lexer=ChordProLexer(filename=filename).lexer,
)
if parsed_content is None:
# There was a fatal error parsing the content
# TODO: implement error handling by looking into parser
raise Exception('The song could not be parsed')
return parsed_content

Loading…
Cancel
Save