Beispiel #1
0
func (assembler *LineList) ParseStart(currentLine string) error {
	source := token.NewSource(currentLine)
	start := line.NewStart()
	err := start.Parse(source)
	if err != nil {
		return err
	}
	assembler.Lines = append(assembler.Lines, start)
	return nil
}
Beispiel #2
0
func TestStartParse(t *testing.T) {
	testCaseList := []testCaseForTestStartParse{
		{data: `EX11     START`},
		{data: `EX11     START SLABEL`},
		{data: `EX11     START SLABEL ; COMMENt`},
	}
	for _, testCase := range testCaseList {
		testData := testCase.data
		start := line.NewStart()
		source := token.NewSource(testData)
		err := start.Parse(source)
		if err != nil {
			t.Error(err)
		}
	}
}