It looks like you're new here. If you want to get involved, click one of these buttons!
if (Wikifier.parse(var) != var) {
var = eval (Wikifier.parse(var));
}
which... works for most of my cases, but it has pretty substantial issues when it comes to strings containing "is", "and", that kind of thing, and that's not even bringing up situations like <<foo ($i + 10)>>
. I've seen some macro code that tests var[0] == "$"
, but that only really works for variable literals, not expressions.
Comments
(I actually ended up still using
parse
because it's a two-arg macro andparser.fullArgs
doesn't provide any way to break the resulting value up into arguments; I just switched my if condition tovar[0] == "$"
to keep it from mangling string literals.)