示例#1
0
文件: linelist.go 项目: mm0205/gcasl
func (assembler *LineList) ParseDS(currentLine string) error {
	source := token.NewSource(currentLine)
	temp := line.NewDS()
	err := temp.Parse(source)
	if err != nil {
		return err
	}
	assembler.Lines = append(assembler.Lines, temp)
	return nil
}
示例#2
0
文件: ds_test.go 项目: mm0205/gcasl
func TestDSParse(t *testing.T) {
	testCaseList := []testCaseForTestDSParse{
		{data: `     DS 1234`},
		{data: `     DS #10		; COMMENT`},
		{data: `LABEL     DS #FFFF ; COMMENT`},
	}
	for _, testCase := range testCaseList {
		testData := testCase.data
		ds := line.NewDS()
		source := token.NewSource(testData)
		err := ds.Parse(source)
		if err != nil {
			t.Error(err)
		}
		// t.Error(ds)
	}
}