summaryrefslogtreecommitdiff
path: root/libguile/private-options.h
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2014-01-12 07:55:22 -0500
committerMark H Weaver <mhw@netris.org>2014-01-14 20:23:21 -0500
commitdc59631d3094ad39bba5e40d5c36200fb99023f9 (patch)
tree8448ce41b34541c89edecdee8e841fde77a2b5eb /libguile/private-options.h
parentb306fae0abe38aac6fede98727a47f57a4ba992f (diff)
downloadguile-dc59631d3094ad39bba5e40d5c36200fb99023f9.tar.gz
read: Support R7RS |...| symbol notation.
* libguile/private-options.h (SCM_R7RS_SYMBOLS_P): New macro. (SCM_N_READ_OPTIONS): Increment. * libguile/read.c (scm_read_opts): Add entry for 'r7rs-symbols'. (t_read_opts): Add field for 'r7rs_symbols_p'. (scm_read_string_like_syntax): New function based on earlier 'scm_read_string' that handles either string literals or R7RS quoted symbols (delimited by vertical bars), depending on the value of 'chr'. (scm_read_string): Reimplement based on 'scm_read_string_like_syntax'. (scm_read_r7rs_symbol): New static function. * doc/ref/api-data.texi (Symbol Read Syntax): Briefly describe the R7RS symbol syntax, mention the 'r7rs-symbols' read option, and give some examples. * doc/ref/api-evaluation.texi (Scheme Read): Mention the 'r7rs-symbols' read option. * test-suite/tests/reader.test ("reading"): Add test.
Diffstat (limited to 'libguile/private-options.h')
-rw-r--r--libguile/private-options.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/libguile/private-options.h b/libguile/private-options.h
index 4f580a640..1a4ad0fb4 100644
--- a/libguile/private-options.h
+++ b/libguile/private-options.h
@@ -4,7 +4,7 @@
* We put this in a private header, since layout of data structures
* is an implementation detail that we want to hide.
*
- * Copyright (C) 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+ * Copyright (C) 2007, 2009, 2010, 2011, 2014 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -68,7 +68,8 @@ SCM_INTERNAL scm_t_option scm_read_opts[];
#define SCM_SQUARE_BRACKETS_P scm_read_opts[5].val
#define SCM_HUNGRY_EOL_ESCAPES_P scm_read_opts[6].val
#define SCM_CURLY_INFIX_P scm_read_opts[7].val
+#define SCM_R7RS_SYMBOLS_P scm_read_opts[8].val
-#define SCM_N_READ_OPTIONS 8
+#define SCM_N_READ_OPTIONS 9
#endif /* PRIVATE_OPTIONS */