Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fixes option parsing on C++ libs that match EOL differently#136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ttuggle wants to merge2 commits intodocopt:master
base:master
Choose a base branch
Loading
fromttuggle:master

Conversation

@ttuggle
Copy link

The following fragment does not match between docopt.cpp and docopt:

Usage:    myprog [options] <command> <arguments>...Options:  --reallylongoption <super_long_argument_description>                This option fails to capture the argument on some                C++ libs where $ does not match EOL.                See https://stackoverflow.com/questions/39645660/stdregex-to-match-begin-end-of-string                For some discussion and the inspiration to fix it by adding the \n.

@ttugglettuggle marked this pull request as ready for reviewJuly 27, 2020 21:45
@ttuggle
Copy link
Author

FYI, this does include the code from#109

@ttuggle
Copy link
Author

The pull request in#109 fixes problems parsing something like this, which does parse in Python.

usage:    myprog [options] <file>options:    --fail      This arg unfortunately fails to process                because there are two newlines preceeding                the options section.

"(?:^|\\n)"// anchored at a linebreak (or start of string)
"("
"[^\\n]*" + name +"[^\\n]*(?=\\n?)"// a line that contains the name
"(?:\\n[\\t].*?(?=\\n|$))*"// followed by any number of lines that are indented
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Is the issue that it won't matchjust a newline (without spaces)?

}

staticconst std::regex pattern {"(-{1,2})?(.*?)([,= ]|$)"};
staticconst std::regex pattern {"(-{1,2})?(.*?)([,= ]|$|\n)"};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The|$ should match a newline right?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@jaredgrubbjaredgrubbjaredgrubb left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@ttuggle@jaredgrubb

[8]ページ先頭

©2009-2025 Movatter.jp