• Rob Pike's avatar
    text/template: allow .Field access to parenthesized expressions · 9050550c
    Rob Pike authored
    Change the grammar so that field access is a proper operator.
    This introduces a new node, ChainNode, into the public (but
    actually internal) API of text/template/parse. For
    compatibility, we only use the new node type for the specific
    construct, which was not parseable before. Therefore this
    should be backward-compatible.
    
    Before, .X.Y was a token in the lexer; this CL breaks it out
    into .Y applied to .X. But for compatibility we mush them
    back together before delivering. One day we might remove
    that hack; it's the simple TODO in parse.go/operand.
    
    This change also provides grammatical distinction between
            f
    and
            (f)
    which might permit function values later, but not now.
    
    Fixes #3999.
    
    R=golang-dev, dsymonds, gri, rsc, mikesamuel
    CC=golang-dev
    https://golang.org/cl/6494119
    9050550c
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
VERSION Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...