nix_expr: Create a preliminary nix2py().

Although I'd love to use Haskell's Parsec or at least some lightweight
implementation of it (I even started one, consisting of a few hundred
lines of code), I decided to go to for a "poor mans parser combinator"
iplementation. Currently it's just able to parse strings, which is done
with a single regular expression for both string forms (well, the third
form would be an URI, but let's leave that out until we really need it).

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
nix_expr: Implement lists/integers/bools/nulls.

Now we should have parsing for everything but attribute sets, functions
and raw values. Although the implementation is still a bit ugly
(especially hard-coding "builtins.sub 0 " for negative numbers), but
we're going to change this soon.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
nix_expr: Implement parsing of attribute sets.

So, this is the most important datatype we need to have, because it's
the most essential one in Nix. Due to the postprocessing of the parsed
list of nested dictionaries, we now also have a function called
merge_dicts() which will come in handy when we implement it for the
physical specification.

What's still missing are functions and "all other kinds of raw values".

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
nix_expr: Implement parsing of functions.

The parsing of the function isn't done on a complete basis, as we're not
interested in any details of the function head. So parsing the function
head is done entirely via a regular expression and provided as-is to the
Function constructor.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
nix_expr: Implement parsing of RawValue's.

This is rather fragile and might cause parsing to fail for example if
the expression has nested parentheses. But in our case we prefer failing
instead of consuming too much input.

And of course, our goal is to implement only a subset of the Nix
expression language, so we don't need to aim for completeness in any
way.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
test_nix_expr: Implement tests for nix2py().

These tests actually are just the same tests used for py2nix() but
reversed.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>