instaparse

If you're not trampolining your parser, why bother getting up in the morning?
ska 2015-08-27T07:30:58.000006Z

@nodename: One Char is a character from the range given in the regexp. You allow many Chars with the +. Maybe you want Term = Char

ska 2015-08-27T07:31:14.000007Z

Char = #'[a-z]+'

ska 2015-08-27T07:32:03.000008Z

So that the regexp eats the characters. Of course then "Char" is not a really good name anymore and might become sth like Symbol or Name

2015-08-27T07:32:57.000009Z

Yes, that works, but I expected what I had to work too. Don’t see why not.

ska 2015-08-27T07:49:57.000010Z

It actually does that, it's just not the first result. Your grammar is ambiguous. See the result of insta/parses

ska 2015-08-27T07:50:25.000011Z

The reason is, that + in instaparse is not greedy but allows all possible paths whereas + in the regexp would be greedy

2015-08-27T07:51:32.000012Z

Ah, thanks. Do you know how I could modify Term to make it greedy?

ska 2015-08-27T07:53:07.000013Z

My approach would be to use the regexp mentioned above. To me that is kinda the tokenization step in instaparse. I don't know if other solutions exists from the top off my head

ska 2015-08-27T07:54:23.000014Z

Looks like I tried that already and came to the conclusion that there is no other way: https://github.com/ska2342/sourcetalk14/blob/master/de.skamphausen.stt14/src/de/skamphausen/stt14.clj#L460

2015-08-27T07:55:21.000016Z

Ha, OK, will read! Thanks!