AddFile adds a new file with the given filename and src. This an internal method, but exported for cross-package use.
(filename, src string)
| 65 | // |
| 66 | // This an internal method, but exported for cross-package use. |
| 67 | func (self *FileSet) AddFile(filename, src string) int { |
| 68 | base := self.nextBase() |
| 69 | file := &File{ |
| 70 | name: filename, |
| 71 | src: src, |
| 72 | base: base, |
| 73 | } |
| 74 | self.files = append(self.files, file) |
| 75 | self.last = file |
| 76 | return base |
| 77 | } |
| 78 | |
| 79 | func (self *FileSet) nextBase() int { |
| 80 | if self.last == nil { |