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

Allow multi-line \ separator for **value groups** as a last character #714

Merged
merged 1 commit into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- Added support of the multi-line ` \ ` separator for **macro values** [#678](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/678)
- Added support of the multi-line ` \ ` separator for **header parameters** [#679](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/679)
- Added support of the multi-line ` \ ` separator for **value groups** [#680](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/680)
- Allow multi-line ` \ ` separator for **value groups** as a last character [#714](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/714)
- Adjusted Table selection logic [#689](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/689)
- Improved Column highlighting logic [#690](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/690)
- Added folding for `zip:` file load translator prefix [#692](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/692)
Expand Down
12 changes: 10 additions & 2 deletions gen/com/intellij/idea/plugin/hybris/impex/ImpexParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -1605,15 +1605,16 @@ static boolean value_dec(PsiBuilder b, int l) {
}

/* ********************************************************** */
// FIELD_VALUE_SEPARATOR value?
// FIELD_VALUE_SEPARATOR value? MULTILINE_SEPARATOR?
public static boolean value_group(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "value_group")) return false;
if (!nextTokenIs(b, FIELD_VALUE_SEPARATOR)) return false;
boolean r, p;
Marker m = enter_section_(b, l, _NONE_, VALUE_GROUP, null);
r = consumeToken(b, FIELD_VALUE_SEPARATOR);
p = r; // pin = 1
r = r && value_group_1(b, l + 1);
r = r && report_error_(b, value_group_1(b, l + 1));
r = p && value_group_2(b, l + 1) && r;
exit_section_(b, l, m, r, p, null);
return r || p;
}
Expand All @@ -1625,6 +1626,13 @@ private static boolean value_group_1(PsiBuilder b, int l) {
return true;
}

// MULTILINE_SEPARATOR?
private static boolean value_group_2(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "value_group_2")) return false;
consumeToken(b, MULTILINE_SEPARATOR);
return true;
}

/* ********************************************************** */
// (sub_type_name value_group*) | (value_group+)
public static boolean value_line(PsiBuilder b, int l) {
Expand Down
2 changes: 1 addition & 1 deletion src/com/intellij/idea/plugin/hybris/impex/Impex.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ value_line ::= (sub_type_name value_group*) | (value_group+) {
methods=[getHeaderLine getValueGroup addValueGroups]
}

value_group ::= FIELD_VALUE_SEPARATOR value?
value_group ::= FIELD_VALUE_SEPARATOR value? MULTILINE_SEPARATOR?
{
pin=1
methods=[getFullHeaderParameter getColumnNumber getValueLine computeValue]
Expand Down