Ejemplo n.º 1
0
function throws_ok($content, $message = '')
{
    global $t;
    $parser = new SCSS_Parser();
    $lexer = new SCSS_Lexer();
    $lexer->setBuffer($content);
    $t->throws_ok(array($lexer, $parser), '$p[1]->yyparse($p[0]);', $message);
}
Ejemplo n.º 2
0
function throws_ok($content, $message = '', $debug = false)
{
    global $t;
    $parser = new SCSS_Parser();
    $lexer = new SCSS_Lexer($parser);
    $lexer->setBuffer($content);
    if ($debug) {
        $lexer->debug = true;
        $parser->debug = true;
    }
    $t->throws_ok(array($lexer, $parser), '$p[1]->yyparse($p[0]);', $message);
}
Ejemplo n.º 3
0
function isToken($buffer, $tokenstr, $diag = null)
{
    global $t;
    $lexer = new SCSS_Lexer();
    $lexer->setBuffer($buffer);
    $results = array();
    $tokens = array();
    foreach (explode(' ', $tokenstr) as $token) {
        $tokens[] = $token;
    }
    while ($result = $lexer->analyze($yylval)) {
        $results[] = is_numeric($result) ? chr($result) : $result;
    }
    if (is_null($diag)) {
        $diag = "token: {$tokenstr}";
    }
    $t->is($results, $tokens, $diag);
}