Beispiel #1
0
func (assembler *LineList) ParseEnd(currentLine string) error {
	source := token.NewSource(currentLine)
	end := line.NewEnd()
	err := end.Parse(source)
	if err != nil {
		return err
	}
	assembler.Lines = append(assembler.Lines, end)
	return nil
}
Beispiel #2
0
func TestEndParse(t *testing.T) {
	testCaseList := []testCaseForTestEndParse{
		{data: `     END`},
		{data: `     END	; COMMENT`},
	}
	for _, testCase := range testCaseList {
		testData := testCase.data
		start := line.NewEnd()
		source := token.NewSource(testData)
		err := start.Parse(source)
		if err != nil {
			t.Error(err)
		}
	}
}