From cf2adc79f5ae5e701942aa02f447303ceccec188 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Mon, 23 May 2011 04:49:35 -0700 Subject: [PATCH] adding #![no-]fold-case syntax --- sexp.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/sexp.c b/sexp.c index d3361e4f..1e53a6ba 100755 --- a/sexp.c +++ b/sexp.c @@ -1902,10 +1902,23 @@ sexp sexp_read_raw (sexp ctx, sexp in) { goto scan_loop; break; case '!': - while ((c1 = sexp_read_char(ctx, in)) != EOF) - if (c1 == '\n') - break; - sexp_port_line(in)++; +#if SEXP_USE_FOLD_CASE_SYMS + res = sexp_read_symbol(ctx, in, '!', 0); + if (sexp_stringp(res) + && strcmp("!fold-case", sexp_string_data(res)) == 0) { + sexp_port_fold_casep(in) = 1; + } else if (sexp_stringp(res) + && strcmp("!no-fold-case", sexp_string_data(res)) == 0) { + sexp_port_fold_casep(in) = 0; + } else { +#endif + while ((c1 = sexp_read_char(ctx, in)) != EOF) + if (c1 == '\n') + break; + sexp_port_line(in)++; +#if SEXP_USE_FOLD_CASE_SYMS + } +#endif goto scan_loop; case '\\': c1 = sexp_read_char(ctx, in);