| Age | Commit message (Collapse) | Author |
|
Moves the error detection back into execution, where it used to be,
and improves the error message.
Rolls back most of 6009048, which broke lower-case keys in maps.
If it weren't for maps we could detect this at compile time rather than
execution time.
Fixes #3542.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6098051
|
|
Fixes #3529.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6037046
|
|
It's a common error to reference unexported field names in templates,
especially for newcomers. This catches the error at parse time rather than
execute time so the rare few who check errors will notice right away.
These were always an error, so the net behavior is unchanged.
Should break no existing code, just identify the error earlier.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6009048
|
|
below do not support '.
This makes package html consistent with package text/template's
HTMLEscape function.
Fixes #3489.
R=rsc, mikesamuel, dsymonds
CC=golang-dev
https://golang.org/cl/5992071
|
|
Without this fix, an erroneous template causes a panic; should be caught safely.
The bug did not affect correct templates.
Fixes #3267.
R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5900065
|
|
Fixes #3383.
R=iant, bradfitz
CC=golang-dev
https://golang.org/cl/5891045
|
|
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5821044
|
|
1) Poor error checking in variable declarations admitted
$x=2 or even $x%2.
2) Need white space or suitable termination character
after identifiers, so $x+2 doesn't parse, in case we want it
to mean something one day.
Number 2 in particular prevents mistakes that we will have
to honor later and so is necessary for Go 1.
Fixes #3270.
Fixes #3271.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5795073
|
|
Missed a case for variadic functions with too few arguments.
The code passes, and with the right error, but might as well record the test case.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5732050
|
|
The recent addition of automatic function invocation generated
some troublesome ambiguities. Restore the previous behavior
and compensate by providing a "call" builtin to make it easy to
do what the automatic invocation did, but in a clear and explicit
manner.
Fixes #3140.
At least for now.
R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/5720065
|
|
Fixes #2742.
R=golang-dev, peterthrun, adg
CC=golang-dev
https://golang.org/cl/5699083
|
|
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5694100
|
|
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5696087
|
|
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5677084
|
|
go/doc: move Examples to go/ast
cmd/go: use go/doc to read examples
src/pkg: update examples to use new convention
This is to make whole file examples more readable. When presented as a
complete function, preceding an Example with its output is confusing.
The new convention is to put the expected output in the final comment
of the example, preceded by the string "output:" (case insensitive).
An idiomatic example looks like this:
// This example demonstrates Foo by doing bar and quux.
func ExampleFoo() {
// example body that does bar and quux
// Output:
// example output
}
R=rsc, gri
CC=golang-dev
https://golang.org/cl/5673053
|
|
return (*Template, error), not just *Template.
Fixes #2757.
R=r
CC=golang-dev
https://golang.org/cl/5665044
|
|
Just an oversight they didn't work and easy to address.
Fixes #3025.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5656059
|
|
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5654077
|
|
This will help html/template copy templates.
R=golang-dev, gri, nigeltao, r
CC=golang-dev
https://golang.org/cl/5653062
|
|
Fixes #2963.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5650051
|
|
R=r, rsc
CC=golang-dev
https://golang.org/cl/5644055
|
|
Consequently, remove many package Makefiles,
and shorten the few that remain.
gomake becomes 'go tool make'.
Turn off test phases of run.bash that do not work,
flagged with $BROKEN. Future CLs will restore these,
but this seemed like a big enough CL already.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5601057
|
|
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5564050
|
|
The previous version of all the node.String methods printed the parse
tree and was useful for developing the parse tree code. Now that that's done,
we might as well print the nodes using the standard template syntax.
It's much easier to read and makes error reporting look more natural.
Helps issue 2644.
R=rsc, n13m3y3r
CC=golang-dev
https://golang.org/cl/5553066
|
|
Fixes #2720.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5545072
|
|
Fixes #2696.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5543055
|
|
The recover code assumes that the panic() argument was
an error, but it is usually a simple string.
Fixes #2663.
R=golang-dev, r, r, gri
CC=golang-dev, remy
https://golang.org/cl/5527046
|
|
New("x").ParseFiles("y") can result in an empty "x" template.
Make the message clearer that this is the problem. The error
returns from both template packages in this case were
confusing.
I considered making the method use "x" instead of "y" in
this case, but that just made other situations confusing
and harder to explain.
Fixes #2594.
R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/5498048
|
|
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5494070
|
|
All but 3 cases (in gcimporter.go and hixie.go)
are automatic conversions using gofix.
No attempt is made to use the new Append functions
even though there are definitely opportunities.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5447069
|
|
tree sets.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5449062
|
|
Makes it clear we're adding exactly one tree and creating a
new template for it.
R=rsc
CC=golang-dev
https://golang.org/cl/5448077
|
|
- allow Lookup to work on uninitialized templates
- fix bug in add: can't error after parser is stopped
- add Add method for html/template
R=adg, rogpeppe, r, rsc
CC=golang-dev
https://golang.org/cl/5436080
|
|
Calling it Template makes it clumsy to embed the type, which html/template
depends on.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5432079
|
|
Cloned template copied the root template incorrectly.
Add test of self-consistency.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5436063
|
|
The Set type is gone. Instead, templates are automatically associated by
being parsed together; nested definitions implicitly create associations.
Only associated templates can invoke one another.
This approach dramatically reduces the breadth of the construction API.
For now, html/template is deleted from src/pkg/Makefile, so this can
be checked in. Nothing in the tree depends on it. It will be updated next.
R=dsymonds, adg, rsc, r, gri, mikesamuel, nigeltao
CC=golang-dev
https://golang.org/cl/5415060
|
|
Preamble to the simplification of the template API.
Although the signature of Parse (nee Set) changes,
it's really an internal function, used only by
text/template.
R=golang-dev, rsc, gri, r
CC=golang-dev
https://golang.org/cl/5415052
|
|
Parse {{define}} blocks during template parsing rather than separately as a set-specific thing.
This cleans up set parse significantly, and enables the next step, if we want, to unify the
API for templates and sets.
Other than an argument change to parse.Parse, which is in effect an internal function and
unused by client code, there is no API change and no spec change yet.
R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/5393049
|
|
R=rsc
CC=golang-dev
https://golang.org/cl/5345045
|
|
This contains the files that required handiwork, mostly
Makefiles with updated TARGs, plus the two packages
with modified package names.
html/template/doc.go needs a separate edit pass.
test/fixedbugs/bug358.go is not legal go so gofix fails on it.
R=rsc
CC=golang-dev
https://golang.org/cl/5340050
|
|
Also make it agree with the documentation. You get an error, unless you're
calling Add explicitly, in which case it panics since that's almost certainly
a bug. The discrepancy was caused by a panic that wasn't turned into
an error along one path; deleted the offending function for clarity.
R=r, rsc
CC=golang-dev
https://golang.org/cl/5354045
|
|
This is a continuation of 982d70c6d5d6.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5348042
|
|
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5340043
|
|
This is Go 1 package renaming CL #4.
This one merely moves the source; the import strings will be
changed after the next weekly release.
This one moves pieces into os, text, and unicode.
exec -> os/exec
scanner -> text/scanner
tabwriter -> text/tabwriter
template -> text/template
template/parse -> text/template/parse
utf16 -> unicode/utf16
utf8 -> unicode/utf8
This should be the last of the source-rearranging CLs.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5331066
|