Code returns the current transpiled lines, split into chunks that should be compiled separately.
()
| 264 | // Code returns the current transpiled lines, |
| 265 | // split into chunks that should be compiled separately. |
| 266 | func (sh *Shell) Code() string { |
| 267 | sh.AddChunk() |
| 268 | if len(sh.Chunks) == 0 { |
| 269 | return "" |
| 270 | } |
| 271 | return strings.Join(sh.Chunks, "\n") |
| 272 | } |
| 273 | |
| 274 | // AddChunk adds current lines into a chunk of code |
| 275 | // that should be compiled separately. |