fastr icon indicating copy to clipboard operation
fastr copied to clipboard

Error Message bei Syntax Error

Open hpb-htw opened this issue 3 years ago • 0 comments

Lexer/Parser does not give as much information as GNU-R. For example GNU-R:

> parseCode <- function(code) tryCatch(parse(text=code), error=function(x) return(x));
> .r.code <- "mean(c(1, 2, %3))"
> parseCode(.r.code)
<simpleError in parse(text = code): <text>:1:14: unexpected input
1: mean(c(1, 2, %3))
                 ^>
>

Same code by FastR:

> parseCode <- function(code) tryCatch(parse(text=code), error=function(x) return(x));
> .r.code <- "mean(c(1, 2, %3))"
> parseCode(.r.code)
<simpleError in parse(text = code): parse error>
> 

FastR does not report line of error. R-User might not expected exactly the same error message as GNU-R, but more information is better, at least where error happens.

hpb-htw avatar Mar 31 '21 14:03 hpb-htw