Skip to content

Commit

Permalink
#714 | Allow multi-line \ separator for **value groups** as a las…
Browse files Browse the repository at this point in the history
…t character
  • Loading branch information
mlytvyn authored Sep 13, 2023
1 parent 839af10 commit 389da5d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
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

0 comments on commit 389da5d

Please sign in to comment.