< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java

Print this page

        

*** 90,99 **** --- 90,102 ---- private Source source; /** The name table. */ private Names names; + /** The lint settings. */ + private Lint lint; + /** End position mappings container */ protected final AbstractEndPosTable endPosTable; // Because of javac's limited lookahead, some contexts are ambiguous in // the presence of type annotations even though they are not ambiguous
*** 184,193 **** --- 187,197 ---- this.parseModuleInfo = parseModuleInfo; docComments = newDocCommentTable(keepDocComments, fac); this.keepLineMap = keepLineMap; this.errorTree = F.Erroneous(); endPosTable = newEndPosTable(keepEndPositions); + this.lint = fac.lint; } protected AbstractEndPosTable newEndPosTable(boolean keepEndPositions) { return keepEndPositions ? new SimpleEndPosTable(this)
*** 637,647 **** --- 641,654 ---- nextToken(); return names.error; } } else if (token.kind == UNDERSCORE) { if (allowUnderscoreIdentifier) { + if (lint.isEnabled(Lint.LintCategory.FUTURE) && + !lint.isSuppressed(Lint.LintCategory.FUTURE)) { warning(token.pos, "underscore.as.identifier"); + } } else { error(token.pos, "underscore.as.identifier"); } Name name = token.name(); nextToken();
< prev index next >