hy.lex.parser.parser.parse

Here are the examples of the python api hy.lex.parser.parser.parse taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

Example 1

Project: hy Source File: __init__.py
Function: tokenize
def tokenize(buf):
    """
    Tokenize a Lisp file or string buffer into internal Hy objects.
    """
    try:
        return parser.parse(lexer.lex(buf))
    except LexingError as e:
        pos = e.getsourcepos()
        raise LexException("Could not identify the next token.",
                           pos.lineno, pos.colno)
    except LexException as e:
        if e.source is None:
            e.source = buf
        raise