1
0
mirror of https://github.com/golang/go synced 2024-10-04 20:21:22 -06:00
Commit Graph

16 Commits

Author SHA1 Message Date
Rob Pike
a6bc344351 rewrite template library:
- separate parsing from execution
	- rearrange code for organizational clarity
	- provide execution errors and parse-time errors
	- implement .or for repeated

TBR=rsc
OCL=27650
CL=27650
2009-04-20 18:51:13 -07:00
Rob Pike
ae08a48719 the Big Error Shift applied to lib/time/zoneinfo.go.
R=gri
DELTA=22  (5 added, 0 deleted, 17 changed)
OCL=27608
CL=27614
2009-04-18 16:44:13 -07:00
Rob Pike
aaf63f8d06 Step 1 of the Big Error Shift: make os.Error an interface and replace *os.Errors with os.Errors.
lib/template updated to use new setup; its clients also updated.

Step 2 will make os's error support internally much cleaner.

R=rsc
OCL=27586
CL=27586
2009-04-17 00:08:24 -07:00
Rob Pike
3761da2d01 document template
R=rsc
DELTA=92  (73 added, 0 deleted, 19 changed)
OCL=27566
CL=27572
2009-04-16 17:44:23 -07:00
Russ Cox
19692beee8 treat "" as empty
R=r
DELTA=10  (10 added, 0 deleted, 0 changed)
OCL=27479
CL=27481
2009-04-15 00:26:49 -07:00
Russ Cox
816f5b3124 better html support.
turn on error reporting; not enough info otherwise.

R=r
DELTA=49  (43 added, 6 deleted, 0 changed)
OCL=27476
CL=27478
2009-04-15 00:05:47 -07:00
Rob Pike
1cb1251436 configurable delimiters.
R=rsc
DELTA=139  (90 added, 7 deleted, 42 changed)
OCL=27475
CL=27477
2009-04-14 22:35:18 -07:00
Russ Cox
cf8b9ce580 test & fix template used twice
R=r
DELTA=30  (30 added, 0 deleted, 0 changed)
OCL=27470
CL=27474
2009-04-14 21:25:33 -07:00
Russ Cox
e21d981a2f add type in not-found error messages.
delay indirection so that values passed to
formatters preserve pointer-ness.

R=r
OCL=27410
CL=27414
2009-04-14 01:12:20 -07:00
Rob Pike
ff12f2effd add (stub) parser to template code, enabling rewrite.
update pretty to use it.
change stdout to stderr in pretty.

R=rsc
DELTA=173  (52 added, 24 deleted, 97 changed)
OCL=27405
CL=27409
2009-04-14 00:06:49 -07:00
Rob Pike
c1ed7d7d25 enable test and fix bug in white space before {
R=rsc
DELTA=6  (0 added, 0 deleted, 6 changed)
OCL=27404
CL=27404
2009-04-13 20:37:24 -07:00
Russ Cox
6d617a881a change template function interface to
func(w io.Write, value interface{}, format string)

R=r
DELTA=16  (3 added, 3 deleted, 10 changed)
OCL=27399
CL=27401
2009-04-13 19:29:23 -07:00
Rob Pike
a20a50b0b2 \r is white space
R=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=27397
CL=27400
2009-04-13 19:27:35 -07:00
Russ Cox
4011733d3c allow nil user map
R=r
DELTA=5  (3 added, 0 deleted, 2 changed)
OCL=27371
CL=27389
2009-04-13 15:23:57 -07:00
Rob Pike
9192dd8e86 Start list of default formatters for template variables.
The HTML one here is just a stub - should use an HTML library to do the right thing.

R=rsc
DELTA=54  (47 added, 2 deleted, 5 changed)
OCL=27250
CL=27250
2009-04-09 00:10:46 -07:00
Rob Pike
4482801477 move template into its own directory so it can have more files
R=rsc
DELTA=1421  (736 added, 685 deleted, 0 changed)
OCL=27249
CL=27249
2009-04-08 23:43:02 -07:00