Search in sources :

Example 1 with FunctionMacroToken

use of org.develnext.jphp.core.tokenizer.token.expr.value.macro.FunctionMacroToken in project jphp by jphp-compiler.

the class TokenizerTest method testMacro.

@Test
public void testMacro() throws IOException {
    Tokenizer tokenizer = new Tokenizer(new Context("__LINE__ __FILE__ __DIR__ __METHOD__ __FUNCTION__ __CLASS__ __NAMESPACE__ __TRAIT__"));
    assertTrue(tokenizer.nextToken() instanceof LineMacroToken);
    assertTrue(tokenizer.nextToken() instanceof FileMacroToken);
    assertTrue(tokenizer.nextToken() instanceof DirMacroToken);
    assertTrue(tokenizer.nextToken() instanceof MethodMacroToken);
    assertTrue(tokenizer.nextToken() instanceof FunctionMacroToken);
    assertTrue(tokenizer.nextToken() instanceof ClassMacroToken);
    assertTrue(tokenizer.nextToken() instanceof NamespaceMacroToken);
    assertTrue(tokenizer.nextToken() instanceof TraitMacroToken);
}
Also used : Context(php.runtime.env.Context) NamespaceMacroToken(org.develnext.jphp.core.tokenizer.token.expr.value.macro.NamespaceMacroToken) LineMacroToken(org.develnext.jphp.core.tokenizer.token.expr.value.macro.LineMacroToken) FileMacroToken(org.develnext.jphp.core.tokenizer.token.expr.value.macro.FileMacroToken) DirMacroToken(org.develnext.jphp.core.tokenizer.token.expr.value.macro.DirMacroToken) FunctionMacroToken(org.develnext.jphp.core.tokenizer.token.expr.value.macro.FunctionMacroToken) TraitMacroToken(org.develnext.jphp.core.tokenizer.token.expr.value.macro.TraitMacroToken) MethodMacroToken(org.develnext.jphp.core.tokenizer.token.expr.value.macro.MethodMacroToken) Tokenizer(org.develnext.jphp.core.tokenizer.Tokenizer) ClassMacroToken(org.develnext.jphp.core.tokenizer.token.expr.value.macro.ClassMacroToken) Test(org.junit.Test)

Aggregations

Tokenizer (org.develnext.jphp.core.tokenizer.Tokenizer)1 ClassMacroToken (org.develnext.jphp.core.tokenizer.token.expr.value.macro.ClassMacroToken)1 DirMacroToken (org.develnext.jphp.core.tokenizer.token.expr.value.macro.DirMacroToken)1 FileMacroToken (org.develnext.jphp.core.tokenizer.token.expr.value.macro.FileMacroToken)1 FunctionMacroToken (org.develnext.jphp.core.tokenizer.token.expr.value.macro.FunctionMacroToken)1 LineMacroToken (org.develnext.jphp.core.tokenizer.token.expr.value.macro.LineMacroToken)1 MethodMacroToken (org.develnext.jphp.core.tokenizer.token.expr.value.macro.MethodMacroToken)1 NamespaceMacroToken (org.develnext.jphp.core.tokenizer.token.expr.value.macro.NamespaceMacroToken)1 TraitMacroToken (org.develnext.jphp.core.tokenizer.token.expr.value.macro.TraitMacroToken)1 Test (org.junit.Test)1 Context (php.runtime.env.Context)1