func (assembler *LineList) ParseR(currentLine string) error { source := token.NewSource(currentLine) temp := line.NewR() err := temp.Parse(source) if err != nil { return err } assembler.Lines = append(assembler.Lines, temp) return nil }
func TestRParse(t *testing.T) { testCaseList := []testCaseForTestRParse{ {data: ` POP GR0`}, {data: ` POP GR1 ; COMMENT`}, {data: `LABEL POP GR5 ; COMMENT`}, } for _, testCase := range testCaseList { testData := testCase.data adr := line.NewR() source := token.NewSource(testData) err := adr.Parse(source) if err != nil { t.Error(err) } // t.Error(adr) } }