src/Compiler/Compiler.php
private function validateJson(string $str) : array
    {
        $ret = json_decode($str,true);
        if ($ret === null){
            throw new CompileErrorException('invalid json value:' . json_last_error_msg(), $this->state);
        }
        if (!is_array($ret)){
            throw new CompileErrorException('@json immediate must be array value.', $this->state);
        }
        return $ret;
    }
private function validateJson(string $str) : array
    {
        $ret = json_decode($str,true);
        if ($ret === null){
            throw new CompileErrorException('invalid json value:' . json_last_error_msg(), $this->state);
        }
        if (!is_array($ret)){
            throw new CompileErrorException('@json immediate must be array value.', $this->state);
        }
        return $ret;
    }
private function validateJson ( string $ str ) : array { $ ret = json_decode ( $ str , true ) ; if ( $ ret === null ) { throw new CompileErrorException ( 'invalid json value:' . json_last_error_msg ( ) , $ this -> state ) ; } if ( ! is_array ( $ ret ) ) { throw new CompileErrorException ( '@json immediate must be array value.' , $ this -> state ) ; } return $ ret ; }
Validate if expression is json value

@param string $str

@return array

@throws CompileErrorException
Validate if expression is json value