Re: [Rd] Inconsistent behavior for the C AP's R_ParseVector() ?

2019-11-30 Thread Laurent Gautier
Hi again, Beside R_ParseVector()'s possible inconsistent behavior, R's handling of zero-length named elements does not seem consistent either: ``` > lst <- list() > lst[[""]] <- 1 > names(lst) [1] "" > list("" = 1) Error: attempt to use zero-length variable name ``` Should the parser be made to

Re: [Rd] Inconsistent behavior for the C AP's R_ParseVector() ?

2019-11-30 Thread Laurent Gautier
I found the following code comment in `src/main/gram.c`: ``` /* Memory leak yyparse(), as generated by bison, allocates extra space for the parser stack using malloc(). Unfortunately this means that there is a memory leak in case of an R error (long-jump). In principle, we could define yyoverflo

[Rd] Inconsistent behavior for the C AP's R_ParseVector() ?

2019-11-30 Thread Laurent Gautier
Hi, The behavior of ``` SEXP R_ParseVector(SEXP, int, ParseStatus *, SEXP); ``` defined in `src/include/R_ext/Parse.h` appears to be inconsistent depending on the string to be parsed. Trying to parse a string such as `"list(''=1+"` sets the `ParseStatus` to incomplete parsing error but trying to