You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes parsing of [default: x] in some cases on Win.
If the option definition spans over multiple lines, then
parsing of the [default: x] was not working on Windows -
tested on MS Visual Studio 2015.
This is due to the differences in regex's multiline property
implementation.
On some platforms - Linux libstd++ the multiline property is off,
on some platforms - msvc2015 the multiline property is on.
It cannot be changed programmatically AFAIK.
I was not able to come up with a regex expression which
would work on Linux and on Windows as well. So I tried to be
smart and replace '\n' by '\f' in the string beforehand.
The regex was easy and worked on Linux and Windows just fine
- up until I tried a longer option definition.
Then the msvc2015 regex failed with 'stack' exception. Hence
this change.
It splits the option definition section by a simple regex
which does not use the problematic '$'.
modified: docopt.cpp
modified: docopt_util.h
0 commit comments