protected void pop_source() throws IOException { pop_source(false); }
@Override protected void pop_source() throws IOException { if (getSource() instanceof FileLexerSource) { } super.pop_source(); }
@Override protected void pop_source() throws IOException { if (getSource() instanceof FileLexerSource) { } super.pop_source(); }
protected void pragma_once(@Nonnull Token name) throws IOException, LexerException { Source s = this.source; if (!onceseenpaths.add(s.getPath())) { Token mark = pop_source(true); // FixedTokenSource should never generate a linemarker on exit. if (mark != null) push_source(new FixedTokenSource(Arrays.asList(mark)), true); } }
pop_source(false);
/** * Returns an NL or an EOF token. * * The metadata on the token will be correct, which is better * than generating a new one. * * This method can, as of recent patches, return a P_LINE token. */ private Token source_skipline(boolean white) throws IOException, LexerException { // (new Exception("skipping line")).printStackTrace(System.out); Source s = getSource(); Token tok = s.skipline(white); /* XXX Refactor with source_token() */ if (tok.getType() == EOF && s.isAutopop()) { // System.out.println("Autopop " + s); Token mark = pop_source(true); if (mark != null) return mark; } return tok; }
Token mark = pop_source(true); if (mark != null) return mark;
pop_source(); Source t = getSource(); if (getFeature(Feature.LINEMARKERS)
pop_source(); Source t = getSource(); if (getFeature(Feature.LINEMARKERS)
/** * Returns an NL or an EOF token. * * The metadata on the token will be correct, which is better * than generating a new one. * * This method can, as of recent patches, return a P_LINE token. */ private Token source_skipline(boolean white) throws IOException, LexerException { // (new Exception("skipping line")).printStackTrace(System.out); Source s = getSource(); Token tok = s.skipline(white); /* XXX Refactor with source_token() */ if (tok.getType() == EOF && s.isAutopop()) { // System.out.println("Autopop " + s); pop_source(); Source t = getSource(); if (getFeature(Feature.LINEMARKERS) && s.isNumbered() && t != null) { /* We actually want 'did the nested source * contain a newline token', which isNumbered() * approximates. This is not perfect, but works. */ return line_token(t.getLine() + 1, t.getName(), " 2"); } } return tok; }
/** * Returns an NL or an EOF token. * * The metadata on the token will be correct, which is better * than generating a new one. * * This method can, as of recent patches, return a P_LINE token. */ private Token source_skipline(boolean white) throws IOException, LexerException { // (new Exception("skipping line")).printStackTrace(System.out); Source s = getSource(); Token tok = s.skipline(white); /* XXX Refactor with source_token() */ if (tok.getType() == EOF && s.isAutopop()) { // System.out.println("Autopop " + s); pop_source(); Source t = getSource(); if (getFeature(Feature.LINEMARKERS) && s.isNumbered() && t != null) { /* We actually want 'did the nested source * contain a newline token', which isNumbered() * approximates. This is not perfect, but works. */ return line_token(t.getLine() + 1, t.getName(), " 2"); } } return tok; }