On Sat, Sep 6, 2008 at 00:58, Anders Dahnielson
<anders@dahnielson.com> wrote:
On Sat, Jul 26, 2008 at 00:03, Anders Dahnielson
<anders@dahnielson.com> wrote:
On Wed, Jul 23, 2008 at 18:13, Anders Dahnielson
<anders@dahnielson.com> wrote:
Here's a simple tokenizer for SFZ I wrote once upon a time in Python. Not sure if I got it completely right.
Nope. E.g. it matches lokey= twice (once as lokey= with a value and as key= without a value). *Blushes*. LOL.
Ok, this is now an old thread. But to not appear as a complete fool I will post some code that actually works. ;-)
And as usual I botched that attempt partly as well... ;-)
The "comment" bit in the previously posted code should have read:
# COMMENT
slash_index = line.find('/')
if slash_index != -1:
line = line[:slash_index]
--