public Integer getLineNumber() { return text != null ? location.getLine() : null; }
ASTNode.Section section = (ASTNode.Section)block; ctx.openSection(section.getType(), section.getBeginPosition()); int lineNumber = section.getBegin().getPosition().getLine(); int colNumber = section.getBegin().getPosition().getCol(); String text = section.getText(); int from = 0; String chunk = text.substring(from, to); ctx.appendText(chunk); ctx.appendLineBreak(new Location(colNumber + (to - from), lineNumber)); from = to + 1; lineNumber++;
public Coordinate(int offset, int col, int line) { this.offset = offset; this.position = new Location(col, line); }
char c = s.charAt(from); if (c == '}') { throw new SyntaxException(CODE_MISSING_EXPR_IDENT, "Missing expression identifier at " + from, Location.at(1 + from)); } else { status = EXPR_IDENT; throw new SyntaxException(CODE_UNCLOSED_EXPR, "Unclosed expression at " + from, Location.at(1 + from)); throw new SyntaxException(CODE_UNCLOSED_EXPR, "Unclosed expression at " + from, Location.at(1 + from));
ASTNode.Section section = (ASTNode.Section)block; ctx.openSection(section.getType(), section.getBeginPosition()); int lineNumber = section.getBegin().getPosition().getLine(); int colNumber = section.getBegin().getPosition().getCol(); String text = section.getText(); int from = 0; String chunk = text.substring(from, to); ctx.appendText(chunk); ctx.appendLineBreak(new Location(colNumber + (to - from), lineNumber)); from = to + 1; lineNumber++;
public static Location at(int col, int line) { return new Location(col, line); }
char c = s.charAt(from); if (c == '}') { throw new SyntaxException(CODE_MISSING_EXPR_IDENT, "Missing expression identifier at " + from, Location.at(1 + from)); } else { status = EXPR_IDENT; throw new SyntaxException(CODE_UNCLOSED_EXPR, "Unclosed expression at " + from, Location.at(1 + from)); throw new SyntaxException(CODE_UNCLOSED_EXPR, "Unclosed expression at " + from, Location.at(1 + from));
public Integer getLineNumber() { return text != null ? location.getLine() : null; }
public static Location at(int index) { return new Location(index, 1); }
int line = error.getLocation().getLine(); int from = line - 2; int to = line + 3;
public Coordinate(int offset, int col, int line) { this.offset = offset; this.position = new Location(col, line); }
private void fail(String route, int expectedCode, int index) { try { RouteParser.parse(route, new Collector()); throw failure("Was expecting route to fail at " + index); } catch (SyntaxException e) { assertEquals(expectedCode, e.getCode()); assertNotNull(e.getLocation()); assertEquals(index, e.getLocation().getCol()); assertEquals(1, e.getLocation().getLine()); } }
int line = error.getLocation().getLine(); int from = line - 2; int to = line + 3;
public static Location at(int index) { return new Location(index, 1); }