--- notation3.py.orig 2012-02-25 16:57:41.000000000 +0200 +++ notation3.py 2012-02-25 17:04:54.000000000 +0200 @@ -633,6 +633,9 @@ i = self.skipSpace(str, j) if i<0: raise BadSyntax(self._thisDoc, self.lines, str, i, "needed ')', found end.") + if str[i:i+2] == '$)': + j = i+2 + break if str[i:i+1] == ')': j = i+1 break