Commit e6ae070f authored by Radford Neal's avatar Radford Neal

show length and truelength for CHARSXP

parent e09c0173
The "inspect" .Internal function was changed to show some details of
pairlist nodes, if SHOW_PAIRLIST_NODES is defined as 1 in inspect.c.
Also, it no longer produces output with tabs (spaces instead).
It also shows length and truelength (the hash) for CHARSXP nodes.
Finally, it no longer produces output with tabs (spaces instead).
......@@ -139,7 +139,7 @@ static void inspect_tree(int pre, SEXP v, int deep, int pvec) {
Rprintf("] ");
switch (TYPEOF(v)) {
case VECSXP: case STRSXP: case LGLSXP: case INTSXP: case RAWSXP:
case REALSXP: case CPLXSXP: case EXPRSXP:
case REALSXP: case CPLXSXP: case EXPRSXP: case CHARSXP:
Rprintf("(len=%d, tl=%d)", LENGTH(v), TRUELENGTH(v));
}
if (TYPEOF(v) == ENVSXP) /* NOTE: this is not a trivial OP since it involves looking up things
......@@ -147,11 +147,11 @@ static void inspect_tree(int pre, SEXP v, int deep, int pvec) {
avoid it .. */
PrintEnvironment(v);
if (TYPEOF(v) == CHARSXP) {
if (IS_BYTES(v)) Rprintf("[bytes] ");
if (IS_LATIN1(v)) Rprintf("[latin1] ");
if (IS_UTF8(v)) Rprintf("[UTF8] ");
if (IS_ASCII(v)) Rprintf("[ASCII] ");
if (IS_CACHED(v)) Rprintf("[cached] ");
if (IS_BYTES(v)) Rprintf(" [bytes]");
if (IS_LATIN1(v)) Rprintf(" [latin1]");
if (IS_UTF8(v)) Rprintf(" [UTF8]");
if (IS_ASCII(v)) Rprintf(" [ASCII]");
if (IS_CACHED(v)) Rprintf(" [cached]");
Rprintf("\"%s\"", CHAR(v));
}
if (TYPEOF(v) == SYMSXP)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment