public void setFileAndLine(ISourcePosition position) { BacktraceElement b = backtrace[backtraceIndex]; b.filename = position.getFile(); b.line = position.getStartLine(); }
public void setFileAndLine(ISourcePosition position) { BacktraceElement b = backtrace[backtraceIndex]; b.filename = position.getFile(); b.line = position.getStartLine(); }
private static void processMethod(StringBuilder sb, String methodName, Node argsNode, Node body) { sb.append("(method ").append(methodName).append(' '); // JRUBY-4301, include filename and line in sexp sb.append("(file ").append(new File(body.getPosition().getFile()).getName()).append(") "); sb.append("(line ").append(body.getPosition().getStartLine()).append(") "); process(sb, argsNode); sb.append(' '); process(sb, body); sb.append(')'); }
@Deprecated @Override public void warning(ID id, ISourcePosition position, String message, Object... data) { warning(id, position.getFile(), position.getStartLine() + 1, message, data); }
@Deprecated @Override public void warn(ID id, ISourcePosition position, String message, Object... data) { warn(id, position.getFile(), position.getStartLine() + 1, message, data); }
/** * Wraps node with NEWLINE node. * *@param node *@return a NewlineNode or null if node is null. */ public Node newline_node(Node node, ISourcePosition position) { if (node == null) return null; configuration.coverLine(position.getStartLine()); return node instanceof NewlineNode ? node : new NewlineNode(position, node); }
/** * Wraps node with NEWLINE node. * *@param node *@return a NewlineNode or null if node is null. */ public Node newline_node(Node node, ISourcePosition position) { if (node == null) return null; configuration.coverLine(position.getStartLine()); return node instanceof NewlineNode ? node : new NewlineNode(position, node); }
public void lineNumber(ISourcePosition position) { int thisLine = position.getStartLine(); // No point in updating number if last number was same value. if (thisLine != lastLine) { lastLine = thisLine; } else { return; } Label line = new Label(); method.label(line); method.visitLineNumber(thisLine + 1, line); }
/** * Prints a warning, only in verbose mode. */ @Override public void warning(ID id, ISourcePosition position, String message) { if (!runtime.warningsEnabled()) return; warning(id, position.getFile(), position.getStartLine() + 1, message); }
/** * Prints a warning, unless $VERBOSE is nil. */ public void warn(ID id, ISourcePosition position, String message) { if (!runtime.warningsEnabled()) return; warn(id, position.getFile(), position.getStartLine(), message); }
/** * Prints a warning, only in verbose mode. */ public void warning(ID id, ISourcePosition position, String message) { if (!runtime.warningsEnabled()) return; warning(id, position.getFile(), position.getStartLine(), message); }
public void lineNumber(ISourcePosition position) { int thisLine = position.getStartLine(); // No point in updating number if last number was same value. if (thisLine != lastLine) { lastLine = thisLine; } else { return; } Label line = new Label(); method.label(line); method.visitLineNumber(thisLine + 1, line); }
/** * Prints a warning, unless $VERBOSE is nil. */ @Override public void warn(ID id, ISourcePosition position, String message) { if (!runtime.warningsEnabled()) return; warn(id, position.getFile(), position.getStartLine() + 1, message); }
public ISourcePosition getPosition() { if (lastPosition.getStartLine() == source.getVirtualLine()) return lastPosition; lastPosition = new SimpleSourcePosition(source.getFilename(), source.getVirtualLine()); return lastPosition; } }
public ISourcePosition getPosition() { if (lastPosition.getStartLine() == source.getVirtualLine()) return lastPosition; lastPosition = new SimpleSourcePosition(source.getFilename(), source.getVirtualLine()); return lastPosition; } }
private static void processMethod(Builder sb, String methodName, Node argsNode, Node body) { sb.append("(method ").append(methodName).append(' '); // JRUBY-4301, include filename and line in sexp sb.append("(file ").append(new File(body.getPosition().getFile()).getName()).append(") "); sb.append("(line ").append(body.getPosition().getStartLine()).append(") "); process(sb, argsNode); sb.append(' '); process(sb, body); sb.append(')'); }
public Operand buildPostExe(PostExeNode postExeNode, IRScope s) { IRClosure endClosure = new IRClosure(manager, s, false, postExeNode.getPosition().getStartLine(), postExeNode.getScope(), Arity.procArityOf(postExeNode.getVarNode()), postExeNode.getArgumentType(), !is1_9() && !is2_0()); // Set up %current_scope and %current_module endClosure.addInstr(new CopyInstr(endClosure.getCurrentScopeVariable(), new CurrentScope(endClosure))); endClosure.addInstr(new CopyInstr(endClosure.getCurrentModuleVariable(), new ScopeModule(endClosure))); build(postExeNode.getBodyNode(), endClosure); // Add an instruction to record the end block at runtime s.addInstr(new RecordEndBlockInstr(s, endClosure)); return manager.getNil(); }
public Operand buildPostExe(PostExeNode postExeNode, IRScope s) { IRClosure endClosure = new IRClosure(manager, s, false, postExeNode.getPosition().getStartLine(), postExeNode.getScope(), Arity.procArityOf(postExeNode.getVarNode()), postExeNode.getArgumentType(), !is1_9() && !is2_0()); // Set up %current_scope and %current_module endClosure.addInstr(new CopyInstr(endClosure.getCurrentScopeVariable(), new CurrentScope(endClosure))); endClosure.addInstr(new CopyInstr(endClosure.getCurrentModuleVariable(), new ScopeModule(endClosure))); build(postExeNode.getBodyNode(), endClosure); // Add an instruction to record the end block at runtime s.addInstr(new RecordEndBlockInstr(s, endClosure)); return manager.getNil(); }
public Operand buildPreExe(PreExeNode preExeNode, IRScope s) { IRClosure beginClosure = new IRClosure(manager, s, false, preExeNode.getPosition().getStartLine(), preExeNode.getScope(), Arity.procArityOf(preExeNode.getVarNode()), preExeNode.getArgumentType(), !is1_9() && !is2_0()); // Set up %current_scope and %current_module beginClosure.addInstr(new CopyInstr(beginClosure.getCurrentScopeVariable(), new CurrentScope(beginClosure))); beginClosure.addInstr(new CopyInstr(beginClosure.getCurrentModuleVariable(), new ScopeModule(beginClosure))); build(preExeNode.getBodyNode(), beginClosure); // Record the begin block at IR build time s.getTopLevelScope().recordBeginBlock(beginClosure); return manager.getNil(); }
public Operand buildPreExe(PreExeNode preExeNode, IRScope s) { IRClosure beginClosure = new IRClosure(manager, s, false, preExeNode.getPosition().getStartLine(), preExeNode.getScope(), Arity.procArityOf(preExeNode.getVarNode()), preExeNode.getArgumentType(), !is1_9() && !is2_0()); // Set up %current_scope and %current_module beginClosure.addInstr(new CopyInstr(beginClosure.getCurrentScopeVariable(), new CurrentScope(beginClosure))); beginClosure.addInstr(new CopyInstr(beginClosure.getCurrentModuleVariable(), new ScopeModule(beginClosure))); build(preExeNode.getBodyNode(), beginClosure); // Record the begin block at IR build time s.getTopLevelScope().recordBeginBlock(beginClosure); return manager.getNil(); }