func (assembler *LineList) ParseDC(currentLine string) error { source := token.NewSource(currentLine) temp := line.NewDC() err := temp.Parse(source) if err != nil { return err } assembler.Lines = append(assembler.Lines, temp) return nil }
func TestDCParse(t *testing.T) { testCaseList := []testCaseForTestDCParse{ {data: ` DC 1234`}, {data: ` DC #10, 1234, '''test''' ; COMMENT`}, {data: `LABEL DC #FFFF, LABEL2, 'string', 10 ; COMMENT`}, } for _, testCase := range testCaseList { testData := testCase.data dc := line.NewDC() source := token.NewSource(testData) err := dc.Parse(source) if err != nil { t.Error(err) } // t.Error(dc.Operands) } }