From df6ddfb8b602c4f7bf55a74bfb3cf12cd1883ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Mon, 9 Dec 2013 14:15:30 +0000 Subject: [PATCH] is [] an atom first or a list first? --- C/text.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/C/text.c b/C/text.c index 2be9a9333..9f732ffb7 100644 --- a/C/text.c +++ b/C/text.c @@ -475,7 +475,7 @@ read_Text( void *buf, seq_tv_t *inp, encoding_t *enc, int *minimal USES_REGS) LOCAL_Error_TYPE = gen_type_error( inp->type ); LOCAL_Error_Term = t; } - } else if (IsPairTerm(t) || t == TermNil) { + } else if (IsPairTerm(t) ) { if (inp->type & (YAP_STRING_CODES|YAP_STRING_ATOMS)) { inp->type &= (YAP_STRING_CODES|YAP_STRING_ATOMS); return read_Text( buf, inp, enc, minimal PASS_REGS); @@ -488,6 +488,10 @@ read_Text( void *buf, seq_tv_t *inp, encoding_t *enc, int *minimal USES_REGS) inp->type &= (YAP_STRING_ATOM); inp->val.t = t; return read_Text( buf, inp, enc, minimal PASS_REGS); + // [] is special... + } else if (t == TermNil && inp->type & (YAP_STRING_CODES|YAP_STRING_ATOMS)) { + inp->type &= (YAP_STRING_CODES|YAP_STRING_ATOMS); + return read_Text( buf, inp, enc, minimal PASS_REGS); } else { LOCAL_Error_TYPE = gen_type_error( inp->type ); LOCAL_Error_Term = t;