package asm
import (
- "bytes"
"fmt"
"strconv"
+ "strings"
"text/scanner"
"cmd/asm/internal/arch"
// TODO: configure the architecture
-var testOut *bytes.Buffer // Gathers output when testing.
+var testOut *strings.Builder // Gathers output when testing.
// append adds the Prog to the end of the program-thus-far.
// If doLabel is set, it also defines the labels collect for this Prog.
parser := NewParser(ctxt, architecture, lexer, false)
pList := new(obj.Plist)
var ok bool
- testOut = new(bytes.Buffer) // The assembler writes test output to this buffer.
+ testOut = new(strings.Builder) // The assembler writes test output to this buffer.
ctxt.Bso = bufio.NewWriter(os.Stdout)
ctxt.IsAsm = true
defer ctxt.Bso.Flush()
parser := NewParser(ctxt, architecture, lexer, false)
pList := new(obj.Plist)
var ok bool
- testOut = new(bytes.Buffer) // The assembler writes test output to this buffer.
+ testOut = new(strings.Builder) // The assembler writes test output to this buffer.
ctxt.Bso = bufio.NewWriter(os.Stdout)
ctxt.IsAsm = true
defer ctxt.Bso.Flush()
package asm
import (
- "bytes"
"strings"
"testing"
// Note these errors should be independent of the architecture.
// Just run the test with amd64.
parser := newParser("amd64")
- var buf bytes.Buffer
+ var buf strings.Builder
parser.errorWriter = &buf
for _, cat := range testcats {
package lex
import (
- "bytes"
"strings"
"testing"
"text/scanner"
// drain returns a single string representing the processed input tokens.
func drain(input *Input) string {
- var buf bytes.Buffer
+ var buf strings.Builder
for {
tok := input.Next()
if tok == scanner.EOF {