1. 13 Jan, 2012 11 commits
    • Brad Fitzpatrick's avatar
      bytes: make Write and WriteString code look the same · 87ceb0ce
      Brad Fitzpatrick authored
      R=golang-dev, r
      CC=golang-dev
      https://golang.org/cl/5540056
      87ceb0ce
    • Rob Pike's avatar
      time: delete unused buffer.WriteByte method · eaecf357
      Rob Pike authored
      R=golang-dev, bradfitz, r, rsc
      CC=golang-dev
      https://golang.org/cl/5539056
      eaecf357
    • Dmitriy Vyukov's avatar
      cmd/go: fix data race during build · a4f7024e
      Dmitriy Vyukov authored
      Fixes #2695.
      
      R=golang-dev, mpimenov, minux.ma, rsc
      CC=golang-dev
      https://golang.org/cl/5545052
      a4f7024e
    • Robert Griesemer's avatar
      godoc: make ?m=src mode deterministic · c7cdce13
      Robert Griesemer authored
      Merge package files in the go/ast MergePackageFiles
      function always	    in the same order (sorted by filename)
      instead	 of map iteration order to obtain the same
      package	 file each time.  This functionality is used
      by godoc when displaying packages in ?m=src mode.
      
      Also: minor cleanup in godoc.go.
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/5540054
      c7cdce13
    • Gustavo Niemeyer's avatar
      xml: major Go 1 fixup · 1627b46e
      Gustavo Niemeyer authored
      This CL improves the xml package in the following ways:
      
      - makes its interface match established conventions
      - brings Marshal and Unmarshal closer together
      - fixes a large number of bugs and adds tests
      - improves speed significantly
      - organizes and simplifies the code
      
      Fixes #2426.
      Fixes #2406.
      Fixes #1989.
      
      What follows is a detailed list of those changes.
      
      - All matching is case sensitive without special processing
        to the field name or xml tag in an attempt to match them.
        Customize the field tag as desired to match the correct XML
        elements.
      
      - Flags are ",flag" rather than "flag". The names "attr",
        "chardata", etc, may be used to name actual XML elements.
      
      - Overriding of attribute names is possible with "name,attr".
      
      - Attribute fields are marshalled properly if they have
        non-string types. Previously they were unmarshalled, but were
        ignored at marshalling time.
      
      - Comment fields tagged with ",comment" are marshalled properly,
        rather than being marshalled as normal fields.
      
      - The handling of the Any field has been replaced by the ",any"
        flag to avoid unexpected results when using the field name for
        other purposes, and has also been fixed to interact properly
        with name paths. Previously the feature would not function
        if any field in the type had a name path in its tag.
      
      - Embedded struct support fixed and cleaned so it works when
        marshalling and also when using field paths deeper than one level.
      
      - Conflict reporting on field names have been expanded to cover
        all fields. Previously it'd catch only conflicts of paths
        deeper than one level. Also interacts correctly with embedded
        structs now.
      
      - A trailing '>' is disallowed in xml tags. It used to be
        supported for removing the ambiguity between "attr" and "attr>",
        but the marshalling support for that was broken, and it's now
        unnecessary. Use "name" instead of "name>".
      
      - Fixed docs to point out that a XMLName doesn't have to be
        an xml.Name (e.g. a struct{} is a good fit too). The code was
        already working like that.
      
      - Fixed asymmetry in the precedence of XML element names between
        marshalling and unmarshalling. Marshal would consider the XMLName
        of the field type before the field tag, while unmarshalling would
        do the opposite. Now both respect the tag of the XMLName field
        first, and a nice error message is provided in case an attempt
        is made to name a field with its tag in a way that would
        conflict with the underlying type's XMLName field.
      
      - Do not marshal broken "<???>" tags when in doubt. Use the type
        name, and error out if that's not possible.
      
      - Do not break down unmarshalling if there's an interface{} field
        in a struct.
      
      - Significant speed boost due to caching of type metadata and
        overall allocation clean ups. The following timings reflect
        processing of the the atom test data:
      
        Old:
      
        BenchmarkMarshal           50000             48798 ns/op
        BenchmarkUnmarshal          5000            357174 ns/op
      
        New:
      
        BenchmarkMarshal          100000             19799 ns/op
        BenchmarkUnmarshal         10000            128525 ns/op
      
      R=cw, gustavo, kevlar, adg, rogpeppe, fullung, christoph, rsc
      CC=golang-dev
      https://golang.org/cl/5503078
      1627b46e
    • Robert Griesemer's avatar
      godoc: fix missing name change · 45ca908f
      Robert Griesemer authored
      Fixes godoc text mode (i.e., URL?m=text).
      
      R=golang-dev, adg
      CC=golang-dev
      https://golang.org/cl/5545043
      45ca908f
    • Robert Griesemer's avatar
      go/doc: streamlined go/doc API · eac31c67
      Robert Griesemer authored
      - the main changes are removing the Doc suffix
        from the exported types, so instead of
        doc.TypeDoc one will have doc.Type, etc.
      
      - All exported types now have a Name (or Names) field.
        For Values, the Names field lists all declared variables
        or constants.
      
      - Methods have additional information about where they are
        coming from.
      
      - There's a mode field instead of a bool to
        control the package's operation, which makes
        it easier to extend w/o API changes.
      
      Except for the partially implemented new Method type,
      this is based on existing code. A clean rewrite is in
      progress based on this new API.
      
      R=rsc, kevlar
      CC=golang-dev
      https://golang.org/cl/5528060
      eac31c67
    • Robert Griesemer's avatar
      go/doc: initial testing support · 4f63cdc8
      Robert Griesemer authored
      R=rsc, adg
      CC=golang-dev
      https://golang.org/cl/5533082
      4f63cdc8
    • Robert Griesemer's avatar
      go/doc: don't ignore anonymous non-exported fields · 9535b86a
      Robert Griesemer authored
      - remove wrapper.go from testing package (not needed anymore)
      
      Fixes #1000.
      
      R=rsc, golang-dev, n13m3y3r
      CC=golang-dev
      https://golang.org/cl/5502074
      9535b86a
    • Robert Griesemer's avatar
      go/parser: Remove unused Parse* functions. Simplified ParseExpr signature. · 74cb9632
      Robert Griesemer authored
      Only ParseFile, ParseDir, and ParseExpr are used in the tree.
      If partial parsing of code is required, it is fairly simple
      to wrap the relevant piece of code into a dummy package for
      parsing (see parser.ParseExpr).
      
      Also: minor cleanups.
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/5535055
      74cb9632
    • Robert Griesemer's avatar
      go/ast: remove unnecessary result value from ast.Fprint/Print · 06479f76
      Robert Griesemer authored
      These functions are mostly of interest for debugging; the
      number of bytes written is uninteresting.
      
      R=r, bradfitz
      CC=golang-dev
      https://golang.org/cl/5540046
      06479f76
  2. 12 Jan, 2012 26 commits
  3. 11 Jan, 2012 3 commits
    • Mike Samuel's avatar
      html/template: reenable testcases and fix mis-escaped sequences. · b1d6fa51
      Mike Samuel authored
      Tighter octal parsing broke some tests and were disabled in
      https://golang.org/cl/5530051
      
      Those tests were broken.  The CSS decoder was supposed to see CSS
      hex escape sequences of the form '\' <hex>+, but those escape
      sequences were instead being consumed by the template parser.
      
      This change properly escapes those escape sequences, and uses
      proper escaping for NULs.
      
      R=golang-dev, rsc, nigeltao
      CC=golang-dev
      https://golang.org/cl/5529073
      b1d6fa51
    • Russ Cox's avatar
      gc: fix inlining bug · 81728cf0
      Russ Cox authored
      R=lvd
      CC=golang-dev
      https://golang.org/cl/5532077
      81728cf0
    • Robert Griesemer's avatar
      go/scanner: 17% faster scanning · 3fc327b3
      Robert Griesemer authored
      - Changed the Scan API semantics slightly:
      The token literal string is only returned
      if the token is a literal, comment, semicolon,
      or illegal character. In all other cases, the
      token literal value is determined by the token
      value.
      
      Clients that care about the token literal value
      when not present can always use the following
      piece of code:
      
      pos, tok, lit := scanner.Scan()
      if lit == "" {
         lit = tok.String()
      }
      
      - Changed token.Lookup API to use a string instead
      of a []byte argument.
      
      - Both these changes were long-standing TODOs.
      
      - Added BenchmarkScan.
      
      This change permits a faster implementation of Scan
      with much fewer string creations:
      
      benchmark                old ns/op    new ns/op    delta
      scanner.BenchmarkScan        74404        61457  -17.40%
      
      R=golang-dev, rsc
      CC=golang-dev
      https://golang.org/cl/5532076
      3fc327b3