vetr icon indicating copy to clipboard operation
vetr copied to clipboard

Provide Context About Vetting Expression in Failure

Open brodieG opened this issue 7 years ago • 0 comments

Ideally would return full vetting expression, and the token that triggered the failure, potentially as an attribute for vet, and as part of the error message for vetr?

For example, in:

a <- quote(integer() && . > 0)
b <- quote(logical(1L) && !is.na(.))
c <- quote(a || b)

vet(c, -1)

The returned attribute might be structured as:

list(
  vet.exp=quote((integer() && . > 0) || (logical(1L) && !is.na(.))),
  fail.tokens=list(vet.exp[[2]][[2]][[3]], vet.exp[[3]][[2]][[2]])
)

although the vet.exp part in fail.tokens may need to be expanded.

brodieG avatar Jun 09 '17 12:06 brodieG