xonsh/peg-parser

Add `@` as alternative to `__xonsh__`

Opened this issue · 2 comments

It will be cool to have this:

@
# <xonsh.built_ins.XonshSession at 0x1064fd9a0>

@?
# XonshSession doc string with description @.env, @.imp, @.last, @.history, etc.

@.env                                    # instead of `__xonsh__.env` and forget about `${...}`
@.history                                # instead of `__xonsh__.history`
@.imp.json.loads('{}')                   # https://github.com/xonsh/xonsh/pull/5595

with @.env.swap(SOMEVAR='foo'):
     echo $SOMEVAR

@jnoortheen is it possible to implement this in the current version of parser as well with minimal changes?
It will be super awesome and support xonsh/xonsh#5595