Artifacts Associated With Ticket 1201589
Ticket change [dc8f9cd4db] (rid 114501) by dgp on 2005-05-13 18:31:45:
- assignee initialized to: "dgp"
- cmimetype initialized to: "text/plain"
- comment initialized to:
dgp% if {yes} {puts foo} foo % if {!no} {puts foo} foo % if {y} {puts foo} foo % if {!n} {puts foo} syntax error in expression "!n": the word "n" requires a preceding $ if it's a variable or function arguments if it's a function kbkdgp - You have the appropriate logic in the 'n' case in tclParseExpr.c(GetLexeme)? kbkHmmm, ok, I see that you did it farther down, in the 'default' branch, but look for those literals exactly, not with unique-prefix matching. [14:22]kbkHmm. I don't really like unique-prefix matching in this context. [14:23]kbkbut if we do it, we should do it only if all else fails. [14:23]dgpwell, the parser doesn't (can't?) check the validity of function names. [14:23]kbkwhich is to say, *don't* do it if the bareword is followed by optional whitespace and a left paren. [14:24]kbkbecause false() isn't a valid expr. [14:24]dgphmmm.... parens... [14:24]kbkunless there's a function so named. [14:25]kbkeq, ne, in, ni, would need further handling somehow, though, becase $a eq("stuff") is valid, and is not a function call. [14:27]kbkand *that* interpretation depends on left context; the eq, ne, in, ni operators are operators only if they follow a constant, a variable, or a right paren. [14:27]kbkUgh. [14:27]kbkI'm starting to think that expr has outgrown a recursive-descent parser. - foundin initialized to: "obsolete: 8.5a3"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "45. Parsing and Eval"
- title initialized to: "bareword madness in expr parser"
- type initialized to: "Bug"
Ticket change [e876adb924] (rid 104648) by dgp on 2005-05-20 21:29:55:
- icomment:
Logged In: YES user_id=80530 Attached patch makes expr parser accept *all* barewords as literals, which then includes the reported problem of accepting boolean value prefix barewords as literals.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Add attachment "1201589.patch" [ed4a558f96] (rid 103853) by dgp on 2005-05-20 21:29:57.
Ticket change [7404426b03] (rid 105129) by dgp on 2005-05-20 21:29:58:
- icomment:
File Added - 135271: 1201589.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [e9daec38ef] (rid 104878) by dgp on 2005-05-20 22:04:57:
- icomment:
Logged In: YES user_id=80530 second version of the patch is limited to just fixing the boolean literal prefix problem, as well as accepting as function names "eq" "ne" "in" and "ni" when they appear in the context for a function name rather than an operator. Treatment of other barewords is left unchanged.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Add attachment "1201589-2.patch" [39f117445f] (rid 112476) by dgp on 2005-05-20 22:04:57.
Ticket change [c262f75c61] (rid 111478) by dgp on 2005-05-20 22:04:58:
- icomment:
File Added - 135277: 1201589-2.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Add attachment "1201589-84.patch" [7cb1c4b279] (rid 97124) by dgp on 2005-05-20 22:19:41.
Ticket change [0c23a9d8d8] (rid 114124) by dgp on 2005-05-20 22:19:41:
- icomment:
Logged In: YES user_id=80530 and here's a version suitable for application to the 8.4 branch.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [9882d13e92] (rid 110612) by dgp on 2005-05-20 22:19:42:
- icomment:
File Added - 135280: 1201589-84.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [e2b717e839] (rid 87677) by dgp on 2005-05-20 22:30:02:
- icomment:
Logged In: YES user_id=80530 Committed for 8.4.10 and 8.5a3. Leaving report open because some tests really ought to be added to the test suite for this. (Volunteers invited!)
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- username: "dgp"
- icomment:
Ticket change [402de23bdf] (rid 121589) by dgp on 2005-05-25 23:09:04:
- icomment:
Logged In: YES user_id=80530 TIP 182 implementation includes tests for the improved bareword parser.
- login: "dgp"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "dgp"
- icomment:
Ticket change [2a94e72b8d] (rid 118602) by dgp on 2005-05-25 23:09:05:
- closedate changed to: "2005-05-25T16:09:05"
- closer changed to: "dgp"
Ticket change [24a374c1b8] (rid 131143) by hobbs on 2006-11-08 00:40:27:
- foundin changed to: "obsolete: 8.4.14"
- icomment:
Logged In: YES user_id=72656 FWIW, users find the single char bareword handling of booleans surprising: http://bugs.activestate.com/show_bug.cgi?id=59177 While I could see the pattern straight off, not even other expert Tcl'ers could, and it is eyebrow raising. This needs at least clear exception docs in expr.n, if not other consideration for correction.
- login: "hobbs"
- mimetype: "text/plain"
- priority changed to: "7 High"
- status changed to: "Open"
- username: "hobbs"
Ticket change [366731daae] (rid 107097) by dgp on 2007-11-28 01:58:16:
- priority changed to: "9 Immediate"
Ticket change [49703a35f3] (rid 100051) by dgp on 2008-03-12 22:43:46:
- priority changed to: "5 Medium"