@@ 2656-2661 (lines=6) @@ | ||
2653 | ||
2654 | return new AST\Literal(AST\Literal::STRING, $this->lexer->token['value']); |
|
2655 | case Lexer::T_INTEGER: |
|
2656 | case Lexer::T_FLOAT: |
|
2657 | $this->match( |
|
2658 | $this->lexer->isNextToken(Lexer::T_INTEGER) ? Lexer::T_INTEGER : Lexer::T_FLOAT |
|
2659 | ); |
|
2660 | ||
2661 | return new AST\Literal(AST\Literal::NUMERIC, $this->lexer->token['value']); |
|
2662 | case Lexer::T_TRUE: |
|
2663 | case Lexer::T_FALSE: |
|
2664 | $this->match( |
|
@@ 2663-2668 (lines=6) @@ | ||
2660 | ||
2661 | return new AST\Literal(AST\Literal::NUMERIC, $this->lexer->token['value']); |
|
2662 | case Lexer::T_TRUE: |
|
2663 | case Lexer::T_FALSE: |
|
2664 | $this->match( |
|
2665 | $this->lexer->isNextToken(Lexer::T_TRUE) ? Lexer::T_TRUE : Lexer::T_FALSE |
|
2666 | ); |
|
2667 | ||
2668 | return new AST\Literal(AST\Literal::BOOLEAN, $this->lexer->token['value']); |
|
2669 | default: |
|
2670 | $this->syntaxError('Literal'); |
|
2671 | } |