skip to navigation
skip to content

elisp 0.5

Emacs Lisp parser

A simple package to parse Emacs Lisp expressions from Python.

Simple Usage

>>> import elisp
>>> numbers = elisp.loads("(1 2 3)")
>>> numbers.car
1
>>> numbers.cdr.cdr.car
3
>>> numbers.cdr.cdr.cdr is elisp.NIL
True

Type Mappings

The following types are supported and are mapped to the respective Python types.

  • integer to int
  • float to float
  • symbol to elisp.ELispSymbol, a subclass of str
  • list, cons to elisp.ELispCons
  • unibyte string to bytearray
  • multibyte string to unicode (without the \C-a syntax)
  • vector to list

Unsupported Types

The following types are not supported:

  • Characters (like ?a or ?\C-f)
  • Char-Table
  • Bool-Vector
  • Hash Table
  • Byte-Code

Grammar

See the file [elisp.ebnf](elisp/elisp.ebnf) for the grammar used by this package.

 
File Type Py Version Uploaded on Size
elisp-0.5-py2-none-any.whl (md5) Python Wheel 2.7 2014-06-27 6KB
elisp-0.5.tar.gz (md5) Source 2014-06-27 6KB