You are here

public function Twig_LexerInterface::tokenize in Translation template extractor 7.3

Same name and namespace in other branches
  1. 6.3 vendor/Twig/LexerInterface.php \Twig_LexerInterface::tokenize()
  2. 7.2 vendor/Twig/LexerInterface.php \Twig_LexerInterface::tokenize()

Tokenizes a source code.

Parameters

string $code The source code:

string $filename A unique identifier for the source code:

Return value

Twig_TokenStream A token stream instance

Throws

Twig_Error_Syntax When the code is syntactically wrong

1 method overrides Twig_LexerInterface::tokenize()
Twig_Lexer::tokenize in vendor/Twig/Lexer.php
Tokenizes a source code.

File

vendor/Twig/LexerInterface.php, line 31

Class

Twig_LexerInterface
Interface implemented by lexer classes.

Code

public function tokenize($code, $filename = null);