# Path: textplusstuff/parser/tokens.py
# TOKEN_NODE_MAPPING = {
#     'MARKDOWNTEXT': MarkdownFlavoredTextNode,
#     'MODELSTUFF': ModelStuffNode
# }


from .tokens import TOKEN_NODE_MAPPING
from __future__ import unicode_literals



class TextPlusStuffParser(object):
    def __init__(self, tokens):
        self.tokens = tokens

    def next_token(self):
        return self.tokens.pop(0)

    def extend_nodelist(self, nodelist, node, token):
        nodelist.append(node)

    def parse(self):
        nodelist = []

        while self.tokens:
            token = self.next_token()


# Path: textplusstuff/parser/tokens.py
# TOKEN_NODE_MAPPING = {
#     'MARKDOWNTEXT': MarkdownFlavoredTextNode,
#     'MODELSTUFF': ModelStuffNode
# }


# Path: textplusstuff/parser/parser.py
from .tokens import TOKEN_NODE_MAPPING

from __future__ import unicode_literals



class TextPlusStuffParser(object):
    def __init__(self, tokens):
        self.tokens = tokens

    def next_token(self):
        return self.tokens.pop(0)

    def extend_nodelist(self, nodelist, node, token):
        nodelist.append(node)

    def parse(self):
        nodelist = []

        while self.tokens:
            token = self.next_token()


            node_class = TOKEN_NODE_MAPPING[token.token_type]