(Arne Babenhauserheide)
2013-08-08: FIX: inline ' : should be '( FIX: inline ' : should be '(
diff --git a/.bugs/bugs b/.bugs/bugs --- a/.bugs/bugs +++ b/.bugs/bugs @@ -1,5 +1,5 @@ fails when I add stuff at the end of end of example.w | owner:, open:False, id:08c68e1ce0c9798184c01806d2661a3220bff3cd, time:1363789693.79 implement wisp in wisp | owner:Arne Babenhauserheide <bab@draketo.de>, open:True, id:6299306916706410702029289bf32edab1e7f17c, time:1367113341.49 -inline ' : should be '( | owner:Arne Babenhauserheide <bab@draketo.de>, open:True, id:72d534a8b23b4cb168017f1bb7d8816f0ea170c4, time:1366497335.26 +inline ' : should be '( | owner:Arne Babenhauserheide <bab@draketo.de>, open:False, id:72d534a8b23b4cb168017f1bb7d8816f0ea170c4, time:1366497335.26 make this work: let : : origfile ( open-file : nth 1 : command-line ) r | owner:Arne Babenhauserheide <bab@draketo.de>, open:False, id:d6de2074a5017f1f29f34d142ce797981ed270a0, time:1366529287.67 comments containing a closing parenthesis can break the parser. | owner:, open:True, id:d9147504868960e5fbc2648474d48ce5c9bd1a02, time:1374838747.22 diff --git a/wisp.py b/wisp.py --- a/wisp.py +++ b/wisp.py @@ -169,10 +169,14 @@ class Line: ): if self.content[n-1:n+2] == " : " or self.content[n-1:] == " :": bracketstoclose += 1 - # we have to keep the space after the colon (" : " - # → " ( "), otherwise we cannot use two - # consecutive colons (" : : ") which would be surprising. - self.content = self.content[:n] + "(" + self.content[n+2:] + # treat ' : as '( + if self.content[n-3:n+1] == " ' :": + self.content = self.content[:n-2] + "'(" + self.content[n+2:] + else: + # we have to keep the space after the colon (" : " + # → " ( "), otherwise we cannot use two + # consecutive colons (" : : ") which would be surprising. + self.content = self.content[:n] + "(" + self.content[n+2:] # after the full line processing, replace " \\: " "\n\\: " and # " \\:\n" (inside line, start of a line, end of a line) by "