diff --git a/src/diana/sgfParser/property.py b/src/diana/sgfParser/property.py --- a/src/diana/sgfParser/property.py +++ b/src/diana/sgfParser/property.py @@ -1,4 +1,5 @@ import re +import logging as log from .propValues import choose, singleton, listOf, compose, number, real, double, color, text, empty, anything, point, move, stone from . import skipWhitespace, ParserError @@ -24,7 +25,12 @@ class Property: res=Property() i,res.name=Property.ident(s,start) i=skipWhitespace(s,i) - i,x=Property.createValue(s,i,res.name) + try: + i,x=Property.createValue(s,i,res.name) + except ParserError as e: # malformed value + log.warning(e) + i,x=choose(listOf(anything), singleton(anything))(s,i) + res.name="_"+res.name res.value=x i=skipWhitespace(s,i) return (i,res)