Examples of consumeWhitespace()


Examples of org.jboss.ide.eclipse.freemarker.lang.ParserUtils.consumeWhiteSpace()

  public static Boolean isNestable(String cont, Directive type) throws ParseException {
    ParserUtils parser = new ParserUtils(cont);
    /* the directive name */
    parser.match(type.getKeyword().toString());
    parser.consumeWhiteSpace();
    /* first variable name */
    parser.consumeIdentifierOrStringLiteral();
    parser.consumeWhiteSpace();
    /* lack of an equals sign at this position means that this is a nesting form of assign */
    return Boolean.valueOf(parser.isAtEndOfInput()
View Full Code Here

Examples of org.jboss.ide.eclipse.freemarker.lang.ParserUtils.consumeWhiteSpace()

    /* the directive name */
    parser.match(type.getKeyword().toString());
    parser.consumeWhiteSpace();
    /* first variable name */
    parser.consumeIdentifierOrStringLiteral();
    parser.consumeWhiteSpace();
    /* lack of an equals sign at this position means that this is a nesting form of assign */
    return Boolean.valueOf(parser.isAtEndOfInput()
        || !parser.matches(LexicalConstants.EQUALS, false));

  }
View Full Code Here

Examples of org.jboss.ide.eclipse.freemarker.lang.ParserUtils.consumeWhiteSpace()

  }

  public void testConsumeWhiteSpace() {
    ParserUtils parser = new ParserUtils(" \t\n\r"); //$NON-NLS-1$
    assertEquals(4, parser.consumeWhiteSpace());
    assertEquals(" \t\n\r", parser.getLastToken()); //$NON-NLS-1$

    parser = new ParserUtils(""); //$NON-NLS-1$
    assertEquals(0, parser.consumeWhiteSpace());
    assertEquals("", parser.getLastToken()); //$NON-NLS-1$
View Full Code Here

Examples of org.jboss.ide.eclipse.freemarker.lang.ParserUtils.consumeWhiteSpace()

    ParserUtils parser = new ParserUtils(" \t\n\r"); //$NON-NLS-1$
    assertEquals(4, parser.consumeWhiteSpace());
    assertEquals(" \t\n\r", parser.getLastToken()); //$NON-NLS-1$

    parser = new ParserUtils(""); //$NON-NLS-1$
    assertEquals(0, parser.consumeWhiteSpace());
    assertEquals("", parser.getLastToken()); //$NON-NLS-1$

    parser = new ParserUtils("x"); //$NON-NLS-1$
    assertEquals(0, parser.consumeWhiteSpace());
    assertEquals("", parser.getLastToken()); //$NON-NLS-1$
View Full Code Here

Examples of org.jboss.ide.eclipse.freemarker.lang.ParserUtils.consumeWhiteSpace()

    parser = new ParserUtils(""); //$NON-NLS-1$
    assertEquals(0, parser.consumeWhiteSpace());
    assertEquals("", parser.getLastToken()); //$NON-NLS-1$

    parser = new ParserUtils("x"); //$NON-NLS-1$
    assertEquals(0, parser.consumeWhiteSpace());
    assertEquals("", parser.getLastToken()); //$NON-NLS-1$

    parser = new ParserUtils(" x"); //$NON-NLS-1$
    assertEquals(1, parser.consumeWhiteSpace());
    assertEquals(" ", parser.getLastToken()); //$NON-NLS-1$
View Full Code Here

Examples of org.jboss.ide.eclipse.freemarker.lang.ParserUtils.consumeWhiteSpace()

    parser = new ParserUtils("x"); //$NON-NLS-1$
    assertEquals(0, parser.consumeWhiteSpace());
    assertEquals("", parser.getLastToken()); //$NON-NLS-1$

    parser = new ParserUtils(" x"); //$NON-NLS-1$
    assertEquals(1, parser.consumeWhiteSpace());
    assertEquals(" ", parser.getLastToken()); //$NON-NLS-1$

  }

  public void testIsAtEndOfInput() {
View Full Code Here

Examples of org.jsoup.parser.TokenQueue.consumeWhitespace()

    private Elements byAttribute() {
        TokenQueue cq = new TokenQueue(tq.chompBalanced('[', ']')); // content queue
        String key = cq.consumeToAny("=", "!=", "^=", "$=", "*=", "~="); // eq, not, start, end, contain, match, (no val)
        Validate.notEmpty(key);
        cq.consumeWhitespace();

        if (cq.isEmpty()) {
            return key.startsWith("^") ? root.getElementsByAttributeStarting(key.substring(1)) : root.getElementsByAttribute(key);
        } else {
            if (cq.matchChomp("="))
View Full Code Here

Examples of org.jsoup.parser.TokenQueue.consumeWhitespace()

    private void byAttribute() {
        TokenQueue cq = new TokenQueue(tq.chompBalanced('[', ']')); // content queue
        String key = cq.consumeToAny("=", "!=", "^=", "$=", "*=", "~="); // eq, not, start, end, contain, match, (no val)
        Validate.notEmpty(key);
        cq.consumeWhitespace();

        if (cq.isEmpty()) {
            if (key.startsWith("^"))
                evals.add(new Evaluator.AttributeStarting(key.substring(1)));
            else
View Full Code Here

Examples of org.jsoup.parser.TokenQueue.consumeWhitespace()

    private void byAttribute() {
        TokenQueue cq = new TokenQueue(tq.chompBalanced('[', ']')); // content queue
        String key = cq.consumeToAny("=", "!=", "^=", "$=", "*=", "~="); // eq, not, start, end, contain, match, (no val)
        Validate.notEmpty(key);
        cq.consumeWhitespace();

        if (cq.isEmpty()) {
            if (key.startsWith("^"))
                evals.add(new Evaluator.AttributeStarting(key.substring(1)));
            else
View Full Code Here

Examples of org.jsoup.parser.TokenQueue.consumeWhitespace()

    private void byAttribute() {
        TokenQueue cq = new TokenQueue(tq.chompBalanced('[', ']')); // content queue
        String key = cq.consumeToAny("=", "!=", "^=", "$=", "*=", "~="); // eq, not, start, end, contain, match, (no val)
        Validate.notEmpty(key);
        cq.consumeWhitespace();

        if (cq.isEmpty()) {
            if (key.startsWith("^"))
                evals.add(new Evaluator.AttributeStarting(key.substring(1)));
            else
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.