-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathlisthell.py
More file actions
27 lines (21 loc) · 1019 Bytes
/
listhell.py
File metadata and controls
27 lines (21 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# -*- coding: utf-8 -*-
"""Listhell: It's not Lisp, it's not Python, it's not Haskell.
Powered by `mcpyrate` and `unpythonic`.
"""
__all__ = ["Listhell"]
__version__ = '2.0.0'
from mcpyrate.quotes import macros, q # noqa: F401
from mcpyrate.dialects import Dialect
from mcpyrate.splicing import splice_dialect
class Listhell(Dialect):
def transform_ast(self, tree): # tree is an ast.Module
with q as template:
__lang__ = "Listhell" # noqa: F841, just provide it to user code.
from unpythonic.syntax import macros, prefix, q, u, kw, autocurry # noqa: F401, F811
# Auxiliary syntax elements for the macros
from unpythonic import apply # noqa: F401
from unpythonic import composerc as compose # compose from Right, Currying # noqa: F401
with prefix, autocurry:
__paste_here__ # noqa: F821, just a splicing marker.
tree.body = splice_dialect(tree.body, template, "__paste_here__")
return tree