1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00
Commit graph

24 commits

Author SHA1 Message Date
Andy Wingo
6f6abb3bb5 Clean up srcprops implementation
* libguile/deprecated.c (scm_sym_copy, scm_make_srcprops): Deprecate.
* libguile/deprecated.h (scm_tc16_srcprops)
  (SCM_SOURCE_PROPERTY_FLAG_BREAK): Deprecate.
* libguile/private-options.h (SCM_COPY_SOURCE_P): Remove.
* libguile/read.c (struct t_read_opts, scm_read_options): Remove useless
  copy read option.
  (maybe_annotate_source): Change line and column to be tagged, and
  subtract off lookahead here.  Change all callers.
  (READ_OPTION_COPY_SOURCE_P): Remove, renumbering other options.
  (init_read_options): Remove copy option.
* libguile/srcprop.c: Change to put filename inline in source
  properties.  Update private implementation.
* libguile/srcprop.h (SCM_PROCTRACEP): Remove.  Unusable given that
  scm_sym_trace was undefined.
2020-09-03 22:55:08 +02:00
Andy Wingo
1234bb1850 Update license notices in all C files
Update to newest recommended license notices from the FSF.  Everything
stays LGPLv3+ except guile-readline which is GPLv3+.
2018-06-20 20:07:34 +02:00
Andy Wingo
c836c28496 libguile header files have uniform format for copyright declarations 2018-06-20 19:44:45 +02:00
Andy Wingo
791eb0c01a Remove (C) from copyright statements
As the FSF advises, 'There is no legal significance to using the
three-character sequence “(C)”, but it does no harm.'  It does take up
space though!  For that reason, we remove it here from our C files.
2018-06-20 19:17:06 +02:00
Mark H Weaver
6e504a7b44 print: Support R7RS |...| symbol notation.
* libguile/print.c (scm_print_opts): Add 'r7rs-symbols' print option.
  (symbol_has_extended_read_syntax): If the 'r7rs-symbols' option is
  enabled, then disallow '|' and '\' from bare symbols.
  (print_extended_symbol): Use 'scm_lfwrite' and 'scm_putc' instead of
  'display_string' and 'display_character' when printing ASCII literals.
  (print_r7rs_extended_symbol): New static function.
  (scm_i_print_symbol_name): If the 'r7rs-symbols' option is enabled,
  use 'print_r7rs_extended_symbol' instead of 'print_extended_symbol'.

* libguile/private-options.h (SCM_PRINT_R7RS_SYMBOLS_P): New macro.
  (SCM_N_PRINT_OPTIONS): Increment.

* doc/ref/api-evaluation.texi (Scheme Write): Mention 'r7rs-symbols'
  print option.

* test-suite/tests/print.test ("write"): Add tests.
2014-01-14 20:30:24 -05:00
Mark H Weaver
dc59631d30 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.
2014-01-14 20:23:21 -05:00
Mark H Weaver
b6203a189b Increment SCM_N_READ_OPTIONS for 'curly-infix' option.
* libguile/private-options.h (SCM_N_READ_OPTIONS): Increment to 8.
  This should have been done when the 'curly-infix' was added.
2014-01-08 20:56:56 -05:00
Mark H Weaver
bf9eb54aab Implement SRFI-105 curly infix expressions.
* libguile/private-options.h: Add SCM_CURLY_INFIX_P macro, and increment
  SCM_N_READ_OPTIONS.

* libguile/read.c (sym_nfx, sym_bracket_list, sym_bracket_apply): New
  variables.
  (scm_read_opts): Add curly-infix reader option.  Reformat to comply
  with GNU coding standards.
  (scm_t_read_opts): Add curly_infix_p and neoteric_p fields.
  (init_read_options): Initialize new fields.
  (CHAR_IS_DELIMITER): Add '{', '}', '[', and ']' as delimiters if
  curly_infix_p is set.

  (set_port_square_brackets_p, set_port_curly_infix_p): New functions.

  (read_inner_expression): New function which contains the code that was
  previously in 'scm_read_expression'.  Handle curly braces when
  curly_infix_p is set.  If curly_infix_p is set and square_brackets_p
  is unset, follow the Kawa convention: [...] => ($bracket-list$ ...)

  (scm_read_expression): New function body to handle neoteric
  expressions where appropriate.

  (scm_read_shebang): Handle the new reader directives: '#!curly-infix'
  and the non-standard '#!curly-infix-and-bracket-lists'.

  (scm_read_sexp): Handle curly infix lists.

* module/ice-9/boot-9.scm (%cond-expand-features): Add srfi-105 feature
  identifier.

* doc/ref/srfi-modules.texi (SRFI-105): Add stub doc for SRFI-105.

* doc/ref/api-evaluation.texi (Scheme Read): Add documentation for the
  'curly-infix' read option, and the '#!curly-infix' and
  '#!curly-infix-and-bracket-lists' reader directives.

* doc/ref/api-options.texi (Runtime Options): Add 'curly-infix' to the
  list of read options.

* test-suite/Makefile.am: Add tests/srfi-105.test.

* test-suite/tests/srfi-105.test: New file.
2012-10-26 19:52:32 -04:00
Andy Wingo
8500b18696 new print option escape-newlines, defaults to #t
* libguile/private-options.h (SCM_PRINT_ESCAPE_NEWLINES_P):
* libguile/print.c: Add new escape-newlines print option, defaulting to
  on.
  (write_character): For newlines, if SCM_PRINT_ESCAPE_NEWLINES_P, then
  print them as \n.
  (scm_init_print): Refactor print options initialization.
2011-12-04 22:37:27 +01:00
Andy Wingo
684d664e39 implement r6rs hungry escaped EOL
* libguile/private-options.h (SCM_HUNGRY_EOL_ESCAPES_P): New private
  option.
* libguile/read.c: Define SCM_HUNGRY_EOL_ESCAPES_P, defaulting to #f.
  (skip_intraline_whitespace): New helper.
  (scm_read_string): If SCM_HUNGRY_EOL_ESCAPES_P,
  skip_intraline_whitespace after an escaped EOL.

* test-suite/tests/reader.test ("read-options"): Add test.
2011-01-21 09:24:32 +01:00
Andy Wingo
ab9c9100d2 scm_debug_opts to debug.c, backtrace on by default, scm_*_opts internal linkage
* libguile/eval.c:
* libguile/debug.c (scm_debug_opts): Move here, from eval.c. Change
  SCM_BACKTRACE_P to 1, initially.

* libguile/private-options.h: Make all options vars private.
2010-10-01 13:11:51 +02:00
Andy Wingo
24259edb8b remove elisp-strings and elisp-vectors read options
* libguile/private-options.h (SCM_ELISP_VECTORS_P, SCM_ESCAPED_PARENS_P):
* libguile/read.c (scm_read_opts): Remove unused elisp-vectors option,
  and the elisp-strings option (which allowed \( and \) escapes in
  strings).
  (scm_read_string): Remove the elisp-strings case.

* doc/ref/api-options.texi (Reader options): Update, and update wording
  of the case-insensitive bit.
2010-10-01 10:20:54 +02:00
Andy Wingo
4272304761 remove unused print-options
* libguile/private-options.h (SCM_PRINT_CLOSURE, SCM_PRINT_SOURCE_P):
* libguile/print.c (scm_print_opts):
* doc/ref/api-options.texi (Printing options): Remove source and
  closure-hook print options.
2010-10-01 09:56:15 +02:00
Andy Wingo
3932bdb3af remove a number of debug options
* libguile/private-options.h (SCM_BREAKPOINTS_P, SCM_TRACE_P)
  (SCM_REC_PROCNAMES_P, SCM_BACKTRACE_INDENT, SCM_N_FRAMES)
  (SCM_BACKTRACE_MAXDEPTH, SCM_DEVAL_P): Remove these internal names.

* libguile/eval.c (scm_debug_opts): Remove the corresponding debug
  options -- breakpoints, trace, procnames, indent, frames, maxdepth,
  and debug.

* libguile/debug.c (scm_debug_options): Remove SCM_N_FRAMES check.

* test-suite/lib.scm (with-debugging-evaluator*):
* module/scripts/summarize-guile-TODO.scm:
* module/statprof.scm (statprof-reset):
* module/ice-9/boot-9.scm (turn-on-debugging): Remove useless
  debug-enable 'debug calls.

* module/ice-9/deprecated.scm (debug-enable): As it seems that 'debug is
  a particulatly common option that we just removed, add a deprecation
  shim.

* doc/ref/api-options.texi (Debugger options): Update the set of debug
  options.
2010-09-24 20:57:01 +02:00
Andy Wingo
925c1bae1f remove evaluator-traps-interface
* libguile/debug.h:
* libguile/debug.c (scm_with_traps):
* libguile/eval.c (scm_evaluator_traps, scm_evaluator_trap_table):
  Remove these procedures. Note that scm_evaluator_traps was known in
  Scheme as `evaluator-traps-interface'.

* libguile/private-options.h (SCM_TRAPS_P, SCM_ENTER_FRAME_P)
  (SCM_APPLY_FRAME_P, SCM_EXIT_FRAME_P, SCM_ENTER_FRAME_HDLR)
  (SCM_APPLY_FRAME_HDLR, SCM_EXIT_FRAME_HDLR, SCM_MEMOIZE_P)
  (SCM_MEMOIZE_HDLR): Remove these private interfaces.

* module/ice-9/boot-9.scm (traps, trap-enable, trap-disable, trap-set!):
  Remove.

* module/ice-9/scm-style-repl.scm (error-catching-loop): Remove
  with-traps wrap.

* doc/ref/api-options.texi (Low level options interfaces):
  (User level options interfaces, Evaluator trap options)
* doc/ref/api-evaluation.texi (Evaluator Behavior): Remove references to
  the evaluator traps interface.
2010-09-24 18:44:21 +02:00
Andy Wingo
3b494f511a remove eval-options
* libguile/eval.c:
* libguile/private-options.h (scm_eval_opts, scm_eval_options_interface)
  (SCM_EVAL_STACK): Remove these private interfaces.

* module/ice-9/boot-9.scm (eval-options, eval-enable, eval-disable)
  (eval-set!): Remove these procedures.

* doc/ref/api-evaluation.texi:
* doc/ref/api-options.texi: Remove references to eval options.
2010-09-24 18:11:27 +02:00
Andy Wingo
c1b7c940ec lisp nil always enabled
* configure.ac: Remove --disable-elisp option. Lisp nil is always
  enabled.

* libguile/boolean.h:
* libguile/gen-scmconfig.c:
* libguile/gen-scmconfig.h.in:
* libguile/init.c:
* libguile/lang.c:
* libguile/lang.h:
* libguile/pairs.h:
* libguile/private-options.h:
* libguile/read.c: Remove conditionals for disabling elisp.
2010-04-09 14:03:02 +02:00
Michael Gran
870d7a2b4f reader options macros incorrect when SCM_ENABLE_ELISP undefined
When compiled with SCM_ENABLE_ELISP undefined, the reader options
macros SCM_R6RS_ESCAPES_P and SCM_SQUARE_BRACKETS_P point past
the end of the scm_read_opts struct.

*libguile/private-options.h (SCM_R6RS_ESCAPES_P) [!SCM_ENABLE_ELISP]: modified
 (SCM_SQUARE_BRACKETS_P) [!SCM_ENABLE_ELISP]: modified
 (SCM_N_READ_OPTIONS): modified
2010-01-17 13:40:18 -08:00
Andy Wingo
5afa815c9c add reader option for parsing [] as ().
* libguile/private-options.h:
* libguile/read.c (scm_read_opts, SCM_SQUARE_BRACKETS_P): Add an option
  for treating [ and ] as parentheses, on by default. Note that this
  makes them delimiters also, so [ and ] cannot appear in a symbol name,
  with this read option on.
  (scm_read_sexp): If we start with [, we end with ].
  (scm_read_expression): Add case for [.
2010-01-15 22:31:23 +01:00
Michael Gran
dea901d66e Reader option for R6RS hex escapes
This adds a reader option 'r6rs-hex-escapes that modifies the
behavior of numeric escapes in characters and strings.  When enabled,
variable-length character hex escapes (#\xNNN) are allowed and become
the default output format for numerically-escaped characters.  Also,
string hex escapes switch to a semicolon terminated hex escape (\xNNNN;).

* libguile/print.c (PRINT_CHAR_ESCAPE): new macro
  (iprin1): use new macro PRINT_CHAR_ESCAPE

* libguile/private-options.h (SCM_R6RS_ESCAPES_P): new #define

* libguile/read.c (scm_read_opts): add new option r6rs-hex-escapes
  (SCM_READ_HEX_ESCAPE): modify to take a terminator parameter
  (scm_read_string): parse R6RS hex string escapes
  (scm_read_character): parse R6RS hex character escapes

* test-suite/tests/chars.test (with-read-options): new procedure
  (R6RS hex escapes): new tests

* test-suite/tests/strings.test (with-read-options): new procedure
  (R6RS hex escapes): new tests
2010-01-12 21:02:41 -08:00
Andy Wingo
504864b79f remove unused scm_eval_stack var
* libguile/private-options.h:
* libguile/eval.c (scm_eval_stack): Remove declaration and definition of
  unused scm_eval_stack variable.
2009-12-01 21:00:26 +01:00
Neil Jerram
53befeb700 Change Guile license to LGPLv3+
(Not quite finished, the following will be done tomorrow.
   module/srfi/*.scm
   module/rnrs/*.scm
   module/scripts/*.scm
   testsuite/*.scm
   guile-readline/*
)
2009-06-17 00:22:09 +01:00
Han-Wen Nienhuys
243ebb6113 * private-options.h: idem.
* eval.i.c: copyright nitpicking.

* eval.c: distangle. move duplicate code to eval.i.c and include
twice.

* eval.i.c: new file.

* backtrace.c, debug.c, debug.h, deprecation.c, eq.c, eval.c
eval.h, gsubr.c, init.c, macros.c, print.c, print.h, read.c,
read.h, stacks.c, symbols.c, throw.c: use private-options.h

* private-options.h: new file: contain hardcoded option
definitions.
2007-01-22 15:20:35 +00:00
Han-Wen Nienhuys
22fc179acd * backtrace.c, debug.c, debug.h, deprecation.c, eq.c, eval.c
eval.h, gsubr.c, init.c, macros.c, print.c, print.h, read.c,
read.h, stacks.c, symbols.c, throw.c: use private-options.h

* private-options.h: new file: contain hardcoded option
definitions.
2007-01-22 15:14:40 +00:00