Пример #1
0
func (assembler *LineList) ParseInOut(currentLine string) error {
	source := token.NewSource(currentLine)
	temp := line.NewInOut()
	err := temp.Parse(source)
	if err != nil {
		return err
	}
	assembler.Lines = append(assembler.Lines, temp)
	return nil
}
Пример #2
0
func TestInOutParse(t *testing.T) {
	testCaseList := []testCaseForTestInOutParse{
		{data: `         IN      BUFF, LEN`},
		{data: `         OUT     MSG2, MLEN		; COMMENT`},
		{data: `OK       OUT     MSG1, MLEN ; COMMENT`},
	}
	for _, testCase := range testCaseList {
		testData := testCase.data
		inout := line.NewInOut()
		source := token.NewSource(testData)
		err := inout.Parse(source)
		if err != nil {
			t.Error(err)
		}
		// t.Error(inout)
	}
}