package api

import (

	"github.com/jorenchik/mdemory/src/compiler/lexer"
	"github.com/jorenchik/mdemory/src/compiler/parser"
)

func Compile(fileContents string) ([]parser.Question, error) {
	tokens, err := lexer.TokenizeMdem([]rune(fileContents))
	if err != nil {
		return nil, err
	}
    questions, err := parser.ParseQuestions(tokens)
	if (err != nil) {
        return nil, err
	}
    return questions, err
}

