On Sun, Jul 01, 2001 at 10:29:22PM -0700, Craig Barratt wrote: > I have browsed through the code and I am proposing some new features > plus a few bug fixes.
Craig, you're a star! > The significant changes I am proposing are: > > - moving "( expression )" from parse_expression to parse_term. > - moving dot-operator processing from parse_node to parse_term. > - adding "+" and "-" as unary operators. > - figuring out exact line numbers in multi-line directive error > messages (experimental). Yep, all look good. > (There will be some changes necessary elsewhere (eg: stash) to handle > these new operands to the dot operator... I was expecting that to happen anyway, so that's not a problem. > One subtle bug, fixed below, relates to floating point numbers. Currently, > x.1.23 will incorrectly parse as x.(1.23), rather than x.(1).(23) (ie: it > should be two array indices, 1 followed by 23, not a single number, 1.23). Ah yes. Well caught. [...] > - Template/Parser.pm: variable pushback is problematic since not every > rule checks for presence of a pushback variable. For example, > "(foo !(bar))" does not produce a syntax error and incorrectly > parses as "(! (variable<literal<'bar'>, 0>))" (ie: the foo is pushed > back, but never recovered). I took the liberty of removing pushback, > relying on rewind. (I assume pushback was only an optimization to > avoid reparsing the variable... if not then removing pushback is > a big mistake. Sorry.) I think that's probably a good idea. It was just an optimisation but given how fast the underlying regexen should parse the input, I don't think a little bit of backtracking will cause any big problem. And it removes a potential bug just waiting to happen... I'll roll the changes in and release a new snapshot in the next few days. Excellent work! Many thanks! A
