3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/top-level
aszlig 311aa5d8d9
python-wrapper: Handle strings at the beginning.
This should fix #7366 for now, but using the (IMHO) pragmatic approach
of extending the sed expression to recognize strings.

However, this approach is obviously not parsing the full AST, nor does
it wrap Python itself (as pointed out by @spwhitt in #7366) but tries to
match Python strings as best as possible without getting TOO unreadable.

We also use a little bit of Nix to help generating the SED expression,
because doing the whole quote matching block over and over again would
be quite repetitious and error-prone to change. The reason why I'm using
imap here is that we need to have unique labels to avoid jumping into
the wrong branch.

So the new expression is not only able to match continous regions of
triple-quoted strings, but also regions with only one quote character
(even with escaped inner quotes) and empty strings.

However, what it doesn't correctly recognize is something like this:

"string1" "string2" "multi
line
string"

Which is very unlikely that we'll find something like this in the wild.
Of course, we could handle it as well, but it would mean that we need to
substitute the current line into hold space until we're finished parsing
the strings, branch off to another label where we match multiline
strings of all sorts and swap hold/pattern space and finally print the
result. So to summarize: The SED expression would be 3 to 4 times bigger
than now and we gain very little from that.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-04-14 07:13:15 +02:00
..
all-packages.nix Merge pull request #7159 from codyopel/libvpx-cleanup 2015-04-13 21:38:07 -07:00
emacs-packages.nix emacs-packages: update haskell-mode to 13.12 2015-04-09 07:59:26 -05:00
go-packages.nix Whoops, spurious dependency 2015-03-26 23:40:40 -04:00
guile-2-test.nix
haskell-defaults.nix ghcjs: support for Haskell-NG 2015-03-29 03:34:04 +02:00
haskell-ng.nix ghcjs: support for Haskell-NG 2015-03-29 03:34:04 +02:00
haskell-packages.nix fix eval 2015-04-02 22:30:28 +02:00
lua-packages.nix prosody: add dependency on zlib (close #6894) 2015-04-09 18:40:20 +02:00
make-tarball.nix Only test evaluation on supported platforms 2015-03-06 14:07:45 +01:00
node-packages-generated.nix nodePackages: add a few packages, remove deprecated, regenerate, fix them 2015-02-23 13:29:50 +01:00
node-packages.json nodePackages: add a few packages, remove deprecated, regenerate, fix them 2015-02-23 13:29:50 +01:00
node-packages.nix nodePackages: add a few packages, remove deprecated, regenerate, fix them 2015-02-23 13:29:50 +01:00
perl-packages.nix Merge pull request #7194 from nslqqq/i3update 2015-04-11 07:36:12 -04:00
php-packages.nix
platforms.nix Add comment explaining the rpi2 gcc flags. 2015-03-05 10:00:21 +00:00
python-packages-generated.nix
python-packages.json
python-packages.nix python-wrapper: Handle strings at the beginning. 2015-04-14 07:13:15 +02:00
release-cross.nix
release-lib.nix Rename scrubDrv -> hydraJob and make it more effective 2015-03-20 19:46:18 +01:00
release-python.nix
release-small.nix mysql51: Remove from the small release 2015-04-01 13:24:29 -07:00
release.nix pinentry: fix build /cc wkennington 2015-03-26 10:07:05 +01:00