Skip to content

Commit c8e4d67

Browse files
committed
Convert mapping objects to elisp as alists
1 parent 704bf19 commit c8e4d67

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

emacs/elisp/ast.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import re
44
from functools import singledispatch
5+
from collections.abc import Mapping
56

67

78
__all__ = ['ElispAstNode', 'Form', 'Literal', 'Symbol', 'Cons', 'List', 'Quote',
@@ -283,6 +284,9 @@ def make_alist(pairs, quote=False):
283284
alist = List([Cons(key, value) for key, value in _convert_pairs(pairs)])
284285
return Quote(alist) if quote else alist
285286

287+
# Convert mapping objects to alists
288+
to_elisp.register(Mapping, make_alist)
289+
286290

287291
def make_plist(pairs, quote=False):
288292
"""Create a plist from a set of key-value pairs.

0 commit comments

Comments
 (0)