def _get_description()

in src/grammar.py [0:0]


def _get_description(node):
    description = {
        'type': 'description',
        'content': []
    }
    for children in node:
        token = {}

        if children.tag == 'whiteSpace':
            token['type'] = 'whitespace'
            token['content'] = children.text
        elif children.tag == 'identifier':
            token['type'] = 'identifier'
            token['name'] = children.attrib['name']
        elif children.tag == 'string' or children.tag == 'symbol' or children.tag == 'other':
            token['type'] = children.tag
            token['content'] = children.text

            if children.tag == 'string':
                token['content'] = token['content'].replace('<', '&lt;').replace('>', '&gt;')
        elif 'crlf':
            token['type'] = 'crlf'

        description['content'].append(token)
    return description