fixed some inconsistency in moo_fmt_object_().

changed to handle a symbol with a c-style escape sequences enclosed in #""
This commit is contained in:
hyunghwan.chung
2019-05-30 15:44:24 +00:00
parent 5bf79fb4b5
commit a4c13608ef
7 changed files with 113 additions and 87 deletions

View File

@ -2019,11 +2019,19 @@ retry:
break;
case '\'':
/* quoted symbol literal */
/* #'XXXX' - quoted symbol literal */
if (get_strlit(moo) <= -1) return -1; /* reuse the string literal tokenizer */
SET_TOKEN_TYPE (moo, MOO_IOTOK_SYMLIT); /* change the symbol type to symbol */
break;
case '"':
/* #"XXXX" - quoted symbol literal with C-style escape sequences.
* if MOO_PRAGMA_QC is set, this part should never be reached */
MOO_ASSERT (moo, !(moo->c->pragma_flags & MOO_PRAGMA_QC));
if (get_string(moo, '"', '\\', 0, 0) <= -1) return -1;
SET_TOKEN_TYPE (moo, MOO_IOTOK_SYMLIT); /* change the symbol type to symbol */
break;
case '\\':
ADD_TOKEN_CHAR (moo, c);
GET_CHAR_TO (moo, c);