summaryrefslogtreecommitdiff
path: root/src/pkg/template/template.go
AgeCommit message (Collapse)AuthorFilesLines
2011-04-26Imported Upstream version 2011.04.13upstream/2011.04.13Ondřej Surý1-45/+45
2011-04-20Imported Upstream version 2011.03.07.1upstream/2011.03.07.1Ondřej Surý1-1/+7
2011-02-18Imported Upstream version 2011.02.15upstream/2011.02.15Ondřej Surý1-43/+86
2011-02-14Imported Upstream version 2011-02-01.1upstream/2011-02-01.1Ondřej Surý1-1/+4
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý1-71/+107
2010-07-01strings and bytes.Split: make count of 0 mean 0, not infinite.Rob Pike1-1/+1
Use a count of -1 for infinity. Ditto for Replace. R=rsc CC=golang-dev http://codereview.appspot.com/1704044 Committer: Rob Pike <r@golang.org>
2010-06-30template: fix typo in doc commentDaniel Fleischman1-1/+1
R=golang-dev, rsc CC=golang-dev http://codereview.appspot.com/1665047 Committer: Russ Cox <rsc@golang.org>
2010-05-09template: regularize the handling of interfaces, pointers, andRob Pike1-79/+56
methods when looking up names. Fixes issue 764. R=rsc CC=golang-dev http://codereview.appspot.com/1170041
2010-04-28template: remove reference to json-templateAndrew Gerrand1-3/+1
Rather than confuse people by linking to a spec we don't fully support, let them just use the package docs. R=r, rsc CC=golang-dev http://codereview.appspot.com/1016041
2010-04-26template: fix handling of pointer inside interfaceRuss Cox1-1/+1
R=r CC=golang-dev http://codereview.appspot.com/982043
2010-04-13template: use panic/recover to simplify internal error handling.Rob Pike1-50/+32
R=rsc CC=golang-dev http://codereview.appspot.com/824049
2010-03-30single argument panicRuss Cox1-2/+2
note that sortmain.go has been run through hg gofmt; only the formatting of the day initializers changed. i'm happy to revert that formatting if you'd prefer. stop on error in doc/progs/run R=r CC=golang-dev http://codereview.appspot.com/850041
2010-03-10template: add ParseFile, MustParseFile, and associated testsAndrew Gerrand1-0/+24
R=r CC=golang-dev http://codereview.appspot.com/391041
2010-03-02gofmt: experiment: align values in map composites where possibleRobert Griesemer1-2/+2
- gofmt -w src misc - looking for feedback R=rsc, r CC=golang-dev http://codereview.appspot.com/223076
2010-02-26Fix a couple of bugs referencing data values in template.Micah Stetson1-0/+5
Adds tests and fixes for two cases that fail with the current release. R=golang-dev, r CC=golang-dev http://codereview.appspot.com/217115 Committer: Rob Pike <r@golang.org>
2010-02-25strings: delete Runes, BytesRuss Cox1-3/+3
gofmt -w -r 'strings.Bytes(a) -> []byte(a)' src/cmd src/pkg test/bench gofmt -w -r 'strings.Runes(a) -> []int(a)' src/cmd src/pkg test/bench delete unused imports R=r CC=golang-dev http://codereview.appspot.com/224062
2010-02-02Change type of Printf's args to ... interface{}Rob Pike1-2/+2
R=rsc CC=golang-dev http://codereview.appspot.com/197043
2010-01-15template: look inside interface valuesRuss Cox1-0/+3
R=r CC=golang-dev http://codereview.appspot.com/186169
2010-01-08Rewrite tokenizer to clean up and fix a bug with spaces before delimited block.Rob Pike1-44/+50
Fixes issue 501. R=rsc CC=golang-dev http://codereview.appspot.com/181183
2009-12-24implement .repeats for maps.Rob Pike1-26/+20
Fixes issue 309. R=rsc CC=golang-dev http://codereview.appspot.com/181044
2009-12-16add the ability to invoke niladic single-valued methods in templates.Rob Pike1-10/+69
Fixes issue 389. R=rsc CC=golang-dev http://codereview.appspot.com/180061
2009-12-151) Change default gofmt default settings forRobert Griesemer1-260/+260
parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 5th and last set of files. R=rsc CC=golang-dev http://codereview.appspot.com/180050
2009-11-30template: two bug fixes / nitsRuss Cox1-0/+3
* diagnose template not created with New (current code just crashes) * write []byte uninterpreted (current code writes fmt format: "[65 65 65 65]") R=r CC=golang-dev http://codereview.appspot.com/161075
2009-11-24Change to container/vector interface:Robert Griesemer1-1/+1
- removed New(len int) in favor of new(Vector).Resize(len, cap) - removed Init(len int) in favor of Resize(len, cap) - runs all.bash Fixes issue 294. R=rsc, r, r1 http://codereview.appspot.com/157143
2009-11-20gofmt -r 'α[β:len(α)] -> α[β:]' -w src/cmd src/pkgRuss Cox1-2/+2
R=r, gri CC=golang-dev http://codereview.appspot.com/156115
2009-11-19Map support for template.Execute().James Meneghello1-12/+17
Allows the developer to pass a map either by itself for evaluation, or inside a struct. Access to data inside maps is identical to the current system for structs, ie. -Psuedocode- mp map[string]string = { "header" : "A fantastic header!", "footer" : "A not-so-fantastic footer!", } template.Execute(mp) ...can be accessed using {header} and {footer} in the template. Similarly, for maps inside structs: type s struct { mp map[string]string, } s1 = new s s1.mp["header"] = "A fantastic header!"; template.Execute(s1) ...is accessed using {mp.header}. Multi-maps, ie. map[string](map[string]string) and maps of structs containing more maps are unsupported, but then, I'm not even sure if that's supported by the language. Map elements can be of any type that can be written by the formatters. Keys should really only be strings. Fixes issue 259. R=r, rsc http://codereview.appspot.com/157088 Committer: Rob Pike <r@golang.org>
2009-11-09- replaced gofmt expression formatting algorithm withRobert Griesemer1-7/+7
rsc's algorithm - applied gofmt -w misc src - partial CL (last chunk) R=rsc, r http://go/go-review/1024041
2009-11-09remove semis after statements in one-statement statement listsRobert Griesemer1-75/+75
R=rsc, r http://go/go-review/1025029
2009-11-08a nagging inconsistency: capitalization ofRuss Cox1-1/+1
HTML vs Html, URL vs Url, HTTP vs Http, current source is 6:1 in favor of the former, so change instances of the latter. R=r CC=go-dev http://go/go-review/1024026
2009-11-06- fine-tuning of one-line func heuristic (nodes.go)Robert Griesemer1-6/+2
- enabled for function declarations (not just function literals) - applied gofmt -w $GOROOT/src (look for instance at src/pkg/debug/elf/elf.go) R=r, rsc CC=go-dev http://go/go-review/1026006
2009-11-05- gofmt'ing of some stragglers, now with correct comment indentationRobert Griesemer1-97/+97
in special cases - re-gofmt'ing of some files that are now improved R=r, rsc http://go/go-review/1023003
2009-11-04panic can't print interfaces well so use err.String()Rob Pike1-1/+1
R=rsc http://go/go-review/1016041
2009-11-02forgot to count newlines when scanning white space.Rob Pike1-1/+2
also fix a error-printing bug in godoc. R=gri http://go/go-review/1016030
2009-11-02remove goroutines from template parsing.Rob Pike1-31/+75
fix up one usage to take advantage. R=rsc CC=go-dev http://go/go-review/1018023
2009-09-14fix "declared and not used" in tests;Russ Cox1-8/+8
also template/template.go, missed last time. R=r DELTA=116 (61 added, 10 deleted, 45 changed) OCL=34620 CL=34622
2009-09-14do not crash on nil data valueRuss Cox1-0/+3
R=r DELTA=3 (3 added, 0 deleted, 0 changed) OCL=34606 CL=34609
2009-09-01template:Russ Cox1-7/+9
* do full lookup for {.section}, so that it is always allowed to replace {Foo} with {.section Foo}{@}{.end} * treat False as empty so that .section can be used to test bools R=r DELTA=29 (21 added, 0 deleted, 8 changed) OCL=34215 CL=34219
2009-08-29Fix .alternates execution: it was skipping every second token.David Symonds1-2/+2
R=r APPROVED=r DELTA=13 (11 added, 0 deleted, 2 changed) OCL=34081 CL=34081
2009-08-26template: Support iterables for repeated fields.David Symonds1-21/+62
R=r,rsc APPROVED=rsc DELTA=194 (97 added, 32 deleted, 65 changed) OCL=33861 CL=33933
2009-08-12convert non-low-level non-google pkg codeRuss Cox1-7/+1
to whole-package compilation. R=r OCL=33070 CL=33101
2009-08-05- FieldByName lookup through anonymous fieldsRobert Griesemer1-1/+1
- FieldByIndex - changed StructField.Index type from int -> []int - adjustments to reflect clients R=rsc,r DELTA=336 (263 added, 47 deleted, 26 changed) OCL=32731 CL=32802
2009-07-31delete unused arg to empty.Rob Pike1-3/+6
add commentary about findVar's invariant. R=rsc DELTA=6 (3 added, 0 deleted, 3 changed) OCL=32583 CL=32594
2009-07-30bug fixRobert Griesemer1-2/+3
R=rsc OCL=32563 CL=32563
2009-07-30dotted namesRob Pike1-5/+13
R=rsc DELTA=28 (19 added, 0 deleted, 9 changed) OCL=32550 CL=32554
2009-07-16use FieldByName where possible.Rob Pike1-5/+2
R=rsc DELTA=20 (0 added, 12 deleted, 8 changed) OCL=31758 CL=31758
2009-07-07template: use new reflect interface (CL 31107)Russ Cox1-13/+15
R=r DELTA=16 (3 added, 1 deleted, 12 changed) OCL=31121 CL=31288
2009-06-29io.StringBytes -> strings.BytesRuss Cox1-3/+3
io.ByteBuffer -> bytes.Buffer left io.ByteBuffer stub around for now, for protocol compiler. R=r OCL=30861 CL=30872
2009-06-09mv src/lib to src/pkgRob Pike1-0/+808
tests: all.bash passes, gobuild still works, godoc still works. R=rsc OCL=30096 CL=30102