Ejemplo n.º 1
0
def prase_text_complete(text):
    status = ffi.new("ParseStatus[1]")
    s = rstring_p(text)
    orig_stderr = sys.stderr
    sys.stderr = None
    with protected(s):
        lib.R_ParseVector(s, -1, status, lib.R_NilValue)
        sys.stderr = orig_stderr
    return status[0] != 2
Ejemplo n.º 2
0
 def prase_text_complete(text):
     status = c_int()
     s = Rf_protect(rstring_p(text))
     try:
         orig_stderr = sys.stderr
         sys.stderr = None
         rexec_p(R_ParseVector, s, -1, status, R_NilValue)
     except Exception:
         return True
     finally:
         sys.stderr = orig_stderr
         Rf_unprotect(1)
     return status.value != 2