private static String getMessage(String message, Location location) { return String.format("(%s:%s): %s", location.getLine(), location.getColumn(), message); }
private PickleLocation pickleLocation(Location location) { return new PickleLocation(location.getLine(), location.getColumn()); }
private static Location getLocation(Token receivedToken) { return receivedToken.location.getColumn() > 1 ? receivedToken.location : new Location(receivedToken.location.getLine(), receivedToken.line.indent() + 1); } }
private Map<String, String> parametersMap(TableRow header, TableRow row) { List<TableCell> headerCells = header.getCells(); List<TableCell> rowCells = row.getCells(); if (headerCells.size() == rowCells.size()) { Map<String, String> parameters = new LinkedHashMap<>(); for (int i = 0; i < headerCells.size(); i++) { TableCell headerCell = headerCells.get(i); TableCell rowCell = rowCells.get(i); parameters.put(headerCell.getValue(), rowCell.getValue()); } return parameters; } else { throw new InvalidExampleException(header.getLocation().getLine(), header.getLocation().getColumn()); } }
private void addErrorAttachment(List<CucumberEvent> cucumberEvents, ParserException e, String uri) { cucumberEvents.add(new AttachmentEvent( new AttachmentEvent.SourceRef( uri, new AttachmentEvent.Location( e.location.getLine(), e.location.getColumn() ) ), e.getMessage() )); } }
public String formatToken(Token token) { if (token.isEOF()) return "EOF"; return String.format("(%s:%s)%s:%s/%s/%s", toString(token.location.getLine()), toString(token.location.getColumn()), toString(token.matchedType), toString(token.matchedKeyword), toString(token.matchedText), toString(token.mathcedItems == null ? "" : StringUtils.join(SPAN_TO_STRING, ",", token.mathcedItems)) ); }
private PickleLocation pickleStepLocation(Step step) { return new PickleLocation( step.getLocation().getLine(), step.getLocation().getColumn() + (step.getKeyword() != null ? SymbolCounter.countSymbols(step.getKeyword()) : 0) ); }