Commit 9ca0721
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.h1 parent 6f24219 commit 9ca0721
2 files changed
Lines changed: 43 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
521 | 521 | | |
522 | 522 | | |
523 | 523 | | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
529 | 528 | | |
530 | | - | |
531 | | - | |
| 529 | + | |
532 | 530 | | |
533 | 531 | | |
534 | 532 | | |
| 533 | + | |
| 534 | + | |
535 | 535 | | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
| 536 | + | |
545 | 537 | | |
546 | 538 | | |
547 | 539 | | |
548 | | - | |
| 540 | + | |
549 | 541 | | |
550 | 542 | | |
551 | 543 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
12 | 21 | | |
13 | 22 | | |
14 | 23 | | |
| |||
21 | 30 | | |
22 | 31 | | |
23 | 32 | | |
24 | | - | |
| 33 | + | |
25 | 34 | | |
26 | 35 | | |
27 | 36 | | |
28 | 37 | | |
29 | 38 | | |
30 | 39 | | |
31 | 40 | | |
32 | | - | |
| 41 | + | |
33 | 42 | | |
34 | 43 | | |
35 | | - | |
| 44 | + | |
36 | 45 | | |
37 | 46 | | |
38 | | - | |
| 47 | + | |
39 | 48 | | |
40 | 49 | | |
41 | 50 | | |
42 | | - | |
| 51 | + | |
43 | 52 | | |
44 | 53 | | |
45 | 54 | | |
46 | 55 | | |
47 | | - | |
| 56 | + | |
48 | 57 | | |
49 | 58 | | |
50 | 59 | | |
51 | | - | |
| 60 | + | |
52 | 61 | | |
53 | 62 | | |
54 | | - | |
| 63 | + | |
55 | 64 | | |
56 | 65 | | |
57 | | - | |
| 66 | + | |
58 | 67 | | |
59 | 68 | | |
60 | 69 | | |
61 | | - | |
| 70 | + | |
62 | 71 | | |
63 | | - | |
| 72 | + | |
64 | 73 | | |
65 | 74 | | |
66 | 75 | | |
| |||
69 | 78 | | |
70 | 79 | | |
71 | 80 | | |
72 | | - | |
| 81 | + | |
73 | 82 | | |
74 | 83 | | |
75 | | - | |
| 84 | + | |
76 | 85 | | |
77 | 86 | | |
78 | 87 | | |
79 | 88 | | |
80 | | - | |
| 89 | + | |
81 | 90 | | |
82 | 91 | | |
83 | 92 | | |
84 | 93 | | |
85 | 94 | | |
86 | 95 | | |
87 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
88 | 108 | | |
89 | 109 | | |
90 | 110 | | |
| |||
0 commit comments