Rob Pike
6fa6f134f1
fix indentation
...
R=rsc
OCL=28752
CL=28752
2009-05-13 10:34:11 -07:00
Rob Pike
52f071ed43
Rename ParseError to Error
...
R=rsc
DELTA=13 (6 added, 1 deleted, 6 changed)
OCL=28743
CL=28746
2009-05-13 10:01:55 -07:00
Russ Cox
917aa35f8f
implications of stricter type equality:
...
if both types are named, they must be
the same type (arising from the same
declaration).
R=r,gri
DELTA=44 (21 added, 4 deleted, 19 changed)
OCL=28436
CL=28577
2009-05-08 15:40:14 -07:00
Russ Cox
918afd9491
move things out of sys into os and runtime
...
R=r
OCL=28569
CL=28573
2009-05-08 15:21:41 -07:00
Rob Pike
c8b47c6fce
Name change to improve embeddability:
...
io.Read->io.Reader
io.Write,Close,etc.->io.Writer,Closer etc.
R=rsc
DELTA=190 (0 added, 0 deleted, 190 changed)
OCL=28525
CL=28535
2009-05-08 11:22:57 -07:00
Rob Pike
0c3a43e7b2
error handling had a bug in execute: the error channel was being shared.
...
fix that and clean up state handling a little.
R=rsc
DELTA=44 (18 added, 8 deleted, 18 changed)
OCL=28359
CL=28359
2009-05-06 13:42:59 -07:00
Rob Pike
49eb63cfd5
drop unused result name - trivial change.
...
R=rsc
DELTA=1 (0 added, 0 deleted, 1 changed)
OCL=28056
CL=28058
2009-04-29 18:20:09 -07:00
Rob Pike
bd3b2f843f
implement .alternates
...
R=rsc
OCL=27928
CL=27928
2009-04-27 21:04:46 -07:00
Rob Pike
258a08ed8f
add {.tab}
...
fix a couple of comments
TBR=rsc
OCL=27716
CL=27716
2009-04-22 00:53:35 -07:00
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
Russ Cox
1f6463f823
Convert go tree to hierarchical pkg directory:
...
import (
"vector" -> "container/vector"
"ast" -> "go/ast"
"sha1" -> "hash/sha1"
etc.
)
and update Makefiles. Because I did the conversion
semi-automatically, I sorted all the import blocks
as a post-processing. Some files have therefore
changed that didn't strictly need to.
Rename local packages to lower case.
The upper/lower distinction doesn't work on OS X
and complicates the "single-package directories
with the same package name as directory name"
heuristic used by gobuild and godoc to create
the correlation between source and binary locations.
Now that we have a plan to avoid globally unique
names, the upper/lower is unnecessary.
The renamings will cause trouble for a few users,
but so will the change in import paths.
This way, the two maintenance fixes are rolled into
one inconvenience.
R=r
OCL=27573
CL=27575
2009-04-16 20:52:37 -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
c8f9378889
regenerate Makefiles.
...
fix bug in RPC.go (import "RPC" not "rpc.pb")
R=r
DELTA=483 (261 added, 64 deleted, 158 changed)
OCL=27547
CL=27549
2009-04-16 00:18:37 -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
fa7be65bc0
template bug
...
--- FAIL: template.TestAll
for "{.section data}{.end} {header}\n": expected " 77\n" got " {header}\n"
R=r
DELTA=20 (14 added, 0 deleted, 6 changed)
OCL=27395
CL=27402
2009-04-13 19:29:38 -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