nixpkgs/pkgs
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
..
applications Merge pull request #7365 from k0ral/synergy 2015-04-13 22:08:07 +03:00
build-support agda: migrate to haskell-ng, update and cleanup 2015-04-06 21:24:33 +02:00
data Remove mention of monospace from 'fira'. 2015-04-10 23:40:47 +02:00
desktops e19/rage: fixed sha 2015-04-09 18:40:07 +03:00
development python-wrapper: Handle strings at the beginning. 2015-04-14 07:13:15 +02:00
games Merge pull request #7348 from dezgeg/bastet 2015-04-13 11:49:45 +02:00
misc cups-browsed: build with Avahi 2015-04-13 23:21:44 +03:00
os-specific Merge pull request #7186 from arno01/checksecfix 2015-04-13 17:12:41 -05:00
servers nixpkgs: openresty 1.7.7.1 -> 1.7.10.1 2015-04-12 11:35:37 -05:00
shells new package: es 2015-04-11 12:22:43 +08:00
stdenv Set more precise meta.position for Haskell packages 2015-03-27 16:17:48 +01:00
test
tools ceph: 0.94 -> 0.94.1 2015-04-13 18:05:31 -07:00
top-level python-wrapper: Handle strings at the beginning. 2015-04-14 07:13:15 +02:00