package parser

func ParseInstruction(instruction string) ([]Instruction, error) {

	l := lexer{}
	tokens, err := l.lex([]byte(instruction))
	if err != nil {
		return nil, err
	}

	p := parser{}
	instructions, err := p.parse(tokens)
	if err != nil {
		return nil, err
	}

	return instructions, nil
}

package parser

import (
	"errors"
)

func ParseInstruction(instruction string) ([]Instruction, error) {

	l := lexer{}
	tokens, err := l.lex([]byte(instruction))
	if err != nil {
		return nil, err
	}

	p := parser{}
	instructions, err := p.parse(tokens)
	if err != nil {
		return nil, err
	}

	if len(instructions) == 0 {
		return nil, errors.New("Error in syntax near " + instruction)
	}

	return instructions, nil
}

Fix deadlock when no instructions are parsed
Fix deadlock when no instructions are parsed
