[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: parser hacking: stringification
- From: Sven Olsen <sven2718@...>
- Date: Mon, 19 Nov 2012 17:02:46 -0800
If you can use another syntax, like say !star, then this can be easily done
with a token filter, without the need to dive into the parser or produce a
patch.
If we were going to do a version of this shorthand as a token filter, we'd also probably want to follow Robert's suggestion, and use different operators for the table and function cases. But yes, I'd think a { *star } or draw_point(x,y,!color) style shorthand would be a simple (and arguable useful?) use case for a token filter. The the token filtering approach would also have some error handling advantages over a parser patch, as it would make it easy to limit the valid arguments to single name tokens, whereas my patch currently does weird things when it hits a complex _expression_.
On the other hand, a parser patch is a bit faster -- and, for myself, at least, has the advantage of already being implemented :)
-Sven