func (assembler *LineList) ParseAdr(currentLine string) error { source := token.NewSource(currentLine) temp := line.NewAdr() err := temp.Parse(source) if err != nil { return err } assembler.Lines = append(assembler.Lines, temp) return nil }
func TestAdrParse(t *testing.T) { testCaseList := []testCaseForTestAdrParse{ {data: ` JPL ADR1`}, {data: ` JMI ADR1 ; COMMENT`}, {data: `LABEL JNZ ADR1 ; COMMENT`}, } for _, testCase := range testCaseList { testData := testCase.data adr := line.NewAdr() source := token.NewSource(testData) err := adr.Parse(source) if err != nil { t.Error(err) } // t.Error(adr) } }