/** * Return the line number recorded for this node. * If no line number was recorded, searches the parent chain. * @return the nearest line number, or -1 if none was found */ @Override public int getLineno() { if (lineno != -1) return lineno; if (parent != null) return parent.getLineno(); return -1; }
/** * Return the line number recorded for this node. * If no line number was recorded, searches the parent chain. * @return the nearest line number, or -1 if none was found */ @Override public int getLineno() { if (lineno != -1) return lineno; if (parent != null) return parent.getLineno(); return -1; }
/** * Return the line number recorded for this node. * If no line number was recorded, searches the parent chain. * @return the nearest line number, or -1 if none was found */ @Override public int getLineno() { if (lineno != -1) return lineno; if (parent != null) return parent.getLineno(); return -1; }
/** * Return the line number recorded for this node. * If no line number was recorded, searches the parent chain. * @return the nearest line number, or -1 if none was found */ @Override public int getLineno() { if (lineno != -1) return lineno; if (parent != null) return parent.getLineno(); return -1; }
/** * Helper to report error for given node position in ast tree. */ private RuntimeException reportError(final AstNode node, final String message, Object... params) { throw Context.reportRuntimeError(String.format(message, params), source.getAbsolutePath(), node.getLineno(), // seems to always be the line before? node.debugPrint(), 0 // line-offset is unknown? ); }
/** * Sets the wrapped expression, and sets its parent to this node. * @throws IllegalArgumentException} if expression is {@code null} */ public void setExpression(AstNode expression) { assertNotNull(expression); expr = expression; expression.setParent(this); setLineno(expression.getLineno()); }
/** * Sets the wrapped expression, and sets its parent to this node. * @throws IllegalArgumentException} if expression is {@code null} */ public void setExpression(AstNode expression) { assertNotNull(expression); expr = expression; expression.setParent(this); setLineno(expression.getLineno()); }
/** * Sets the wrapped expression, and sets its parent to this node. * @throws IllegalArgumentException} if expression is {@code null} */ public void setExpression(AstNode expression) { assertNotNull(expression); expr = expression; expression.setParent(this); setLineno(expression.getLineno()); }
/** * Sets the left-hand side of the expression, and sets its * parent to this node. * @param left the left-hand side of the expression * @throws IllegalArgumentException} if left is {@code null} */ public void setLeft(AstNode left) { assertNotNull(left); this.left = left; // line number should agree with source position setLineno(left.getLineno()); left.setParent(this); }
/** * Sets the wrapped expression, and sets its parent to this node. * @throws IllegalArgumentException} if expression is {@code null} */ public void setExpression(AstNode expression) { assertNotNull(expression); expr = expression; expression.setParent(this); setLineno(expression.getLineno()); }
/** * Sets the left-hand side of the expression, and sets its * parent to this node. * @param left the left-hand side of the expression * @throws IllegalArgumentException} if left is {@code null} */ public void setLeft(AstNode left) { assertNotNull(left); this.left = left; // line number should agree with source position setLineno(left.getLineno()); left.setParent(this); }
/** * Sets the left-hand side of the expression, and sets its * parent to this node. * @param left the left-hand side of the expression * @throws IllegalArgumentException} if left is {@code null} */ public void setLeft(AstNode left) { assertNotNull(left); this.left = left; // line number should agree with source position setLineno(left.getLineno()); left.setParent(this); }
/** * Sets the left-hand side of the expression, and sets its * parent to this node. * @param left the left-hand side of the expression * @throws IllegalArgumentException} if left is {@code null} */ public void setLeft(AstNode left) { assertNotNull(left); this.left = left; // line number should agree with source position setLineno(left.getLineno()); left.setParent(this); }
protected CAstNode noteSourcePosition(WalkContext context, CAstNode n, AstNode p) { if (p.getLineno() != -1 && context.pos().getPosition(n) == null) { pushSourcePosition(context, n, makePosition(p)); } return n; }
private Position makePosition(AstNode n) { if (n != null) { URL url = ((SourceModule)sourceModule).getURL(); int line = n.getLineno(); Position pos = new RangePosition(url, line, n.getAbsolutePosition(), n.getAbsolutePosition()+n.getLength()); if (sourceModule instanceof MappedSourceModule) { Position np = ((MappedSourceModule) sourceModule).getMapping().getIncludedPosition(pos); if (np != null) { return np; } } return pos; } else { return null; } }
throw new IllegalArgumentException("Exception while parsing for exports in file " + root.getSourceName() + " on line " + node.getLineno(), ex);
fn.removeProp(Node.DESTRUCTURING_PARAMS); int lineno = fn.getBody().getLineno();
fn.removeProp(Node.DESTRUCTURING_PARAMS); int lineno = fn.getBody().getLineno();
fn.removeProp(Node.DESTRUCTURING_PARAMS); int lineno = fn.getBody().getLineno();
fn.removeProp(Node.DESTRUCTURING_PARAMS); int lineno = fn.getBody().getLineno();