示例#1
0
文件: linelist.go 项目: mm0205/gcasl
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
}
示例#2
0
文件: r_test.go 项目: mm0205/gcasl
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)
	}
}