Examples of consumeIdentifierOrStringLiteral()


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

    }
  }

  public void testConsumeIdentifierOrStringLiteral() throws ParseException {
    ParserUtils parser = new ParserUtils("'val'"); //$NON-NLS-1$
    assertEquals(5, parser.consumeIdentifierOrStringLiteral());
    assertEquals("'val'", parser.getLastToken()); //$NON-NLS-1$

    parser = new ParserUtils("'val val'"); //$NON-NLS-1$
    assertEquals(9, parser.consumeIdentifierOrStringLiteral());
    assertEquals("'val val'", parser.getLastToken()); //$NON-NLS-1$
View Full Code Here

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

    ParserUtils parser = new ParserUtils("'val'"); //$NON-NLS-1$
    assertEquals(5, parser.consumeIdentifierOrStringLiteral());
    assertEquals("'val'", parser.getLastToken()); //$NON-NLS-1$

    parser = new ParserUtils("'val val'"); //$NON-NLS-1$
    assertEquals(9, parser.consumeIdentifierOrStringLiteral());
    assertEquals("'val val'", parser.getLastToken()); //$NON-NLS-1$

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

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

    parser = new ParserUtils("'val val'"); //$NON-NLS-1$
    assertEquals(9, parser.consumeIdentifierOrStringLiteral());
    assertEquals("'val val'", parser.getLastToken()); //$NON-NLS-1$

    parser = new ParserUtils("''"); //$NON-NLS-1$
    assertEquals(2, parser.consumeIdentifierOrStringLiteral());
    assertEquals("''", parser.getLastToken()); //$NON-NLS-1$

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

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

    parser = new ParserUtils("''"); //$NON-NLS-1$
    assertEquals(2, parser.consumeIdentifierOrStringLiteral());
    assertEquals("''", parser.getLastToken()); //$NON-NLS-1$

    parser = new ParserUtils("var"); //$NON-NLS-1$
    assertEquals(3, parser.consumeIdentifierOrStringLiteral());
    assertEquals("var", parser.getLastToken()); //$NON-NLS-1$

    parser = new ParserUtils(""); //$NON-NLS-1$
    try {
      parser.consumeIdentifierOrStringLiteral();
View Full Code Here

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

    assertEquals(3, parser.consumeIdentifierOrStringLiteral());
    assertEquals("var", parser.getLastToken()); //$NON-NLS-1$

    parser = new ParserUtils(""); //$NON-NLS-1$
    try {
      parser.consumeIdentifierOrStringLiteral();
      fail("ParseException expected"); //$NON-NLS-1$
    } catch (ParseException expected) {
    }

    parser = new ParserUtils("123"); //$NON-NLS-1$
View Full Code Here

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

    } catch (ParseException expected) {
    }

    parser = new ParserUtils("123"); //$NON-NLS-1$
    try {
      parser.consumeIdentifierOrStringLiteral();
      fail("ParseException expected"); //$NON-NLS-1$
    } catch (ParseException expected) {
    }

    parser = new ParserUtils(" "); //$NON-NLS-1$
View Full Code Here

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

    } catch (ParseException expected) {
    }

    parser = new ParserUtils(" "); //$NON-NLS-1$
    try {
      parser.consumeIdentifierOrStringLiteral();
      fail("ParseException expected"); //$NON-NLS-1$
    } catch (ParseException expected) {
    }

  }
View Full Code Here

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

    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()
        || !parser.matches(LexicalConstants.EQUALS, false));

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.