QuackCompiler\Parser\TokenReader::format PHP Method

format() public method

public format ( )
    public function format()
    {
        echo $this->beautify();
    }

Usage Example

示例#1
0
文件: Quack.php 项目: quack/quack
 public function read()
 {
     $files = $this->getFileNames();
     $this->inArguments('-v', '--version') && (print $this->getVersionContent());
     $this->inArguments('-h', '--help') && (print $this->getHelpContent());
     array_walk($files, function ($file) {
         if (!file_exists($file)) {
             echo "File [{$file}] not found";
             exit(1);
         }
         try {
             $lexer = new Tokenizer(file_get_contents($file));
             $parser = new TokenReader($lexer);
             $parser->parse();
             echo $parser->format();
         } catch (SyntaxError $e) {
             echo $e;
             exit(1);
         }
     });
 }
All Usage Examples Of QuackCompiler\Parser\TokenReader::format