Example #1
0
func (assembler *LineList) ParseAdrX(currentLine string) error {
	source := token.NewSource(currentLine)
	temp := line.NewAdrX()
	err := temp.Parse(source)
	if err != nil {
		return err
	}
	assembler.Lines = append(assembler.Lines, temp)
	return nil
}
Example #2
0
func TestAdrXParse(t *testing.T) {
	testCaseList := []testCaseForTestAdrXParse{
		{data: `     JPL ADR1,GR0`},
		{data: `     JMI ADR1		, GR1 ; COMMENT`},
		{data: `LABEL     JNZ  ADR1 	,			GR7	; COMMENT`},
	}
	for _, testCase := range testCaseList {
		testData := testCase.data
		adrx := line.NewAdrX()
		source := token.NewSource(testData)
		err := adrx.Parse(source)
		if err != nil {
			t.Error(err)
		}
		// t.Error(adrx)
	}
}