~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/pkg/regexp/regexp.go

  • Committer: Bazaar Package Importer
  • Author(s): Ondřej Surý
  • Date: 2011-08-03 17:04:59 UTC
  • mfrom: (14.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110803170459-wzd99m3567y80ila
Tags: 1:59-1
* Imported Upstream version 59
* Refresh patches to a new release
* Fix FTBFS on ARM (Closes: #634270)
* Update version.bash to work with Debian packaging and not hg
  repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
 
88
88
// Error codes returned by failures to parse an expression.
89
89
var (
90
 
        ErrInternal            = Error("internal error")
91
 
        ErrUnmatchedLpar       = Error("unmatched '('")
92
 
        ErrUnmatchedRpar       = Error("unmatched ')'")
93
 
        ErrUnmatchedLbkt       = Error("unmatched '['")
94
 
        ErrUnmatchedRbkt       = Error("unmatched ']'")
95
 
        ErrBadRange            = Error("bad range in character class")
96
 
        ErrExtraneousBackslash = Error("extraneous backslash")
97
 
        ErrBadClosure          = Error("repeated closure (**, ++, etc.)")
98
 
        ErrBareClosure         = Error("closure applies to nothing")
99
 
        ErrBadBackslash        = Error("illegal backslash escape")
 
90
        ErrInternal            = Error("regexp: internal error")
 
91
        ErrUnmatchedLpar       = Error("regexp: unmatched '('")
 
92
        ErrUnmatchedRpar       = Error("regexp: unmatched ')'")
 
93
        ErrUnmatchedLbkt       = Error("regexp: unmatched '['")
 
94
        ErrUnmatchedRbkt       = Error("regexp: unmatched ']'")
 
95
        ErrBadRange            = Error("regexp: bad range in character class")
 
96
        ErrExtraneousBackslash = Error("regexp: extraneous backslash")
 
97
        ErrBadClosure          = Error("regexp: repeated closure (**, ++, etc.)")
 
98
        ErrBareClosure         = Error("regexp: closure applies to nothing")
 
99
        ErrBadBackslash        = Error("regexp: illegal backslash escape")
100
100
)
101
101
 
102
102
const (
158
158
 
159
159
// Regexp is the representation of a compiled regular expression.
160
160
// The public interface is entirely through methods.
 
161
// A Regexp is safe for concurrent use by multiple goroutines.
161
162
type Regexp struct {
162
163
        expr        string // the original expression
163
164
        prefix      string // initial plain text string