Skip to content

Commit

Permalink
Rename Token#mathcedItems to Token#matchedItems. Fixes #1687
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakhellesoy committed Sep 1, 2021
1 parent 34866aa commit 50c4636
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions gherkin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt

### Changed

* [Java] Renamed `Token#mathcedItems` to `Token#matchedItems`
([#1687](https://github.com/cucumber/common/issues/1687)
[aslakhellesoy])
* [Perl] Minimum Perl version upgraded to 5.12 (from 5.10.1)
([#1665](https://github.com/cucumber/common/pull/1665) [ehuelsmann])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ private void ensureCellCount(List<TableRow> rows) {

private List<TableCell> getCells(Token token) {
List<TableCell> cells = new ArrayList<>();
for (GherkinLineSpan cellItem : token.mathcedItems) {
for (GherkinLineSpan cellItem : token.matchedItems) {
TableCell tableCell = new TableCell(
getLocation(token, cellItem.column),
cellItem.text
Expand Down Expand Up @@ -304,7 +304,7 @@ private List<Tag> getTags(AstNode node) {
List<Token> tokens = tagsNode.getTokens(TokenType.TagLine);
List<Tag> tags = new ArrayList<>();
for (Token token : tokens) {
for (GherkinLineSpan tagItem : token.mathcedItems) {
for (GherkinLineSpan tagItem : token.matchedItems) {
tags.add(new Tag(getLocation(token, tagItem.column), tagItem.text, idGenerator.newId()));
}
}
Expand Down
2 changes: 1 addition & 1 deletion gherkin/java/src/main/java/io/cucumber/gherkin/Token.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class Token {
public Parser.TokenType matchedType;
public String matchedKeyword;
public String matchedText;
public List<GherkinLineSpan> mathcedItems;
public List<GherkinLineSpan> matchedItems;
public int matchedIndent;
public GherkinDialect matchedGherkinDialect;
public Location location;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public String formatToken(Token token) {
toString(token.matchedType),
toString(token.matchedKeyword),
toString(token.matchedText),
toString(token.mathcedItems == null ? "" : token.mathcedItems.stream()
toString(token.matchedItems == null ? "" : token.matchedItems.stream()
.map(o -> o.column + ":" + o.text)
.collect(joining(",")))
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private void setTokenMatched(Token token, TokenType matchedType, String text, St
token.matchedType = matchedType;
token.matchedKeyword = keyword;
token.matchedText = text;
token.mathcedItems = items;
token.matchedItems = items;
token.matchedGherkinDialect = getCurrentDialect();
token.matchedIndent = indent != null ? indent : (token.line == null ? 0 : token.line.indent());
token.location = new Location(token.location.getLine(), token.matchedIndent + 1);
Expand Down

0 comments on commit 50c4636

Please sign in to comment.