use of org.develnext.jphp.core.tokenizer.token.expr.DollarExprToken in project jphp by jphp-compiler.
the class TokenizerTest method testVarVar.
@Test
public void testVarVar() throws IOException {
Tokenizer tokenizer = new Tokenizer(new Context("$$foo $ $bar $$$foobar"));
assertTrue(tokenizer.nextToken() instanceof DollarExprToken);
assertTrue(tokenizer.nextToken() instanceof VariableExprToken);
assertTrue(tokenizer.nextToken() instanceof DollarExprToken);
assertTrue(tokenizer.nextToken() instanceof VariableExprToken);
assertTrue(tokenizer.nextToken() instanceof DollarExprToken);
assertTrue(tokenizer.nextToken() instanceof DollarExprToken);
assertTrue(tokenizer.nextToken() instanceof VariableExprToken);
tokenizer = new Tokenizer(new Context("${'foo;6bar'}"));
assertTrue(tokenizer.nextToken() instanceof DollarExprToken);
assertTrue(tokenizer.nextToken() instanceof BraceExprToken);
assertTrue(tokenizer.nextToken() instanceof StringExprToken);
assertTrue(tokenizer.nextToken() instanceof BraceExprToken);
}
Aggregations