private void processStyleSheet(VirtualFile cssFile) { implicitIncludes.add(cssFile); try { FontManager fontManager = configuration.getFontsConfiguration().getTopLevelManager(); StyleSheet styleSheet = new StyleSheet(); styleSheet.checkDeprecation(configuration.showDeprecationWarnings()); styleSheet.parse( cssFile.getName(), cssFile.getInputStream(), ThreadLocalToolkit.getLogger(), fontManager); extractStyles(styleSheet, false); } catch (Exception exception) { CompilerMessage m = new ParseError(exception.getLocalizedMessage()); m.setPath(cssFile.getName()); ThreadLocalToolkit.log(m); } }
/** * only allow MetaDataNode in the specified ranges. * * @param unit * @param map * @param beginLines * @param endLines */ public static void metaDataOnly( CompilationUnit unit, LineNumberMap map, int[] beginLines, int[] endLines) { ProgramNode node = (ProgramNode) unit.getSyntaxTree(); Context cx = node.cx; StatementListNode stmts = node.statements; for (int i = 0, length = stmts.items == null ? 0 : stmts.items.size(); i < length; i++) { Node n = stmts.items.get(i); if (n instanceof DocCommentNode || !(n instanceof MetaDataNode)) { int line = map.get(cx.input.getLnNum(n.pos())); for (int j = 0, count = line == 0 ? 0 : beginLines.length; j < count; j++) { if (line >= beginLines[j] && line <= endLines[j]) { CompilerMessage m = new OnlyMetadataIsAllowed(); m.setPath(cx.input.origin); m.setLine(cx.input.getLnNum(n.pos())); ThreadLocalToolkit.log(m); break; } } } } }