com.google.caja.parser.js.DirectivePrologue

Here are the examples of the java api class com.google.caja.parser.js.DirectivePrologue taken from open source projects.

1. DirectivePrologueQuasiNode#consumeSpecimens()

View license
@Override
protected boolean consumeSpecimens(List<ParseTreeNode> specimens, Map<String, ParseTreeNode> bindings) {
    if (specimens.isEmpty()) {
        return false;
    }
    ParseTreeNode specimen = specimens.get(0);
    if (!(specimen instanceof DirectivePrologue)) {
        return false;
    }
    DirectivePrologue usd = ((DirectivePrologue) specimen);
    if (!usd.getDirectives().containsAll(directives)) {
        return false;
    }
    specimens.remove(0);
    return true;
}