Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#973: Support new lines and white spaces at the beginning in script options values #457

Merged

Conversation

tomuben
Copy link
Collaborator

@tomuben tomuben commented Oct 9, 2024

@tomuben tomuben force-pushed the refactoring/973_support_new_lines_in_ctpg_script_options branch from 0268a87 to 987b1cf Compare October 10, 2024 11:53
option_value(option_value, not_semicolon)
>= [](auto&& ov, auto v) { return std::move(ov.append(v.get_value())); },
option_value(option_value, semicolon_escape)
>= [](auto&& ov, auto v) { return std::move(ov.append(";")); },
option_value(option_value, whitespace_escape_seq)
Copy link
Collaborator

Choose a reason for hiding this comment

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

in theory, only the first whitespace needs escaping what are we doing now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

YEs, that's the implementation. But as the lexer will detect the escaped white spaces, I need to handle this case here, so that the escaped white spaces are added "as is" to the option value. Please have a look to the test:

std::make_pair("-Dhttp.agent=ABC\\ DEF", "-Dhttp.agent=ABC\\ DEF"), //escaped white space in middle of string must stay as is

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah, overlooked that, you are right

@tkilias tkilias changed the title #973: Support new lines in script options values #973: Support new lines and white spaces at the begining in script options values Oct 10, 2024
@tkilias tkilias changed the title #973: Support new lines and white spaces at the begining in script options values #973: Support new lines and white spaces at the beginning in script options values Oct 10, 2024
@tomuben tomuben merged commit c52fc44 into master Oct 10, 2024
8 of 9 checks passed
@tomuben tomuben deleted the refactoring/973_support_new_lines_in_ctpg_script_options branch October 10, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants