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

2484 commits

Author SHA1 Message Date
Andy Wingo
747bd5347d merge stable-2.0
There are some bugs with command-line handling that will be sorted out
with the next commit.
2013-01-23 16:12:08 +01:00
Andy Wingo
a20eb9a39b fix regression in -l
* module/ice-9/command-line.scm (compile-shell-switches): Fix regression
  with -l argument, which was loading arg0 instead.
2013-01-23 16:11:31 +01:00
Andy Wingo
8026a774a9 load files from the command line relative to the cwd
* module/ice-9/command-line.scm (load/lang): Load files from the command
  line relative to the current working directory (fixes regression).
2013-01-23 16:05:13 +01:00
Andy Wingo
faabd16157 add --language argument
* module/ice-9/command-line.scm (*usage*): Make usage of capitalization
  and sentences consistent (lower-case and semicolons, as in ls
  --help).
  Be less specific about languages (Scheme is the default but not the
  only language).
  Document --language.
  (load/lang, eval-string/lang): New helpers.
  (compile-shell-switches): Parse a --language argument, and use it to
  set (current-language).
2013-01-23 09:40:35 +01:00
Andy Wingo
e6f7624ad3 paameterize in read-and-compile
* module/system/base/compile.scm (read-and-compile): Use
  current-language parameter.
2013-01-22 15:40:08 +01:00
Andy Wingo
7ca5500ff3 docstring in rdelim
* module/ice-9/rdelim.scm: Update docstring.
2013-01-22 15:39:37 +01:00
Andy Wingo
5745de9172 current-language is a parameter in boot-9
* module/ice-9/boot-9.scm (current-language): New parameter.

* module/system/base/language.scm (*current-language*): Pull fluid from
  parameter.
  (current-language): Now a re-exported parameter.

* doc/ref/compiler.texi: Update reference from *current-language* fluid
  to current-language parameter.

* module/system/base/compile.scm (compile-and-load):
* module/ice-9/top-repl.scm (top-repl): Default to the current language,
  not to Scheme.

* module/ice-9/eval-string.scm:
* module/system/base/language.scm:
* module/system/repl/command.scm:
* module/system/repl/repl.scm: Update to use current-language parameter
  and parameterize.
2013-01-22 15:38:04 +01:00
Andy Wingo
a6bd32406d add fluid->parameter
* module/ice-9/boot-9.scm (make-parameter): Add a docstring.
  (fluid->parameter): New interface.  Use it when turning port fluids
  into parameters.

* doc/ref/api-scheduling.texi (Parameters): Deffn instead of defun for
  make-parameter documentation.  Add docs for fluid->parameter.
2013-01-22 15:17:50 +01:00
Andy Wingo
5a35d42aa5 add read-string and read-string! to (ice-9 rdelim)
* module/ice-9/rdelim.scm (read-string!, read-string): New functions.
* test-suite/tests/rdelim.test: Add tests.
* doc/ref/api-io.texi: Add docs.

* module/ice-9/iconv.scm:
* module/rnrs/io/ports.scm:
* module/web/uri.scm: Use the new functions.
2013-01-22 15:15:43 +01:00
Andy Wingo
84f5a82517 `include' relative paths relative to including file
* module/ice-9/psyntax.scm (include): Like `load', interpret relative
  paths as being relative to the file that does the `include'.

* doc/ref/api-evaluation.texi: Update docs.
2013-01-22 12:06:59 +01:00
Andy Wingo
776491caa2 fix compilation of glil to assembly
* libguile/vm-i-scheme.c (VM_VALIDATE_STRUCT): Fix the error message if
  the value was not a struct.

* module/system/base/compile.scm (find-language-joint): Default to
  joining at the target language.
  (default-language-joiner): Allow sequences of one compiled expression
  to pass through.  Otherwise error as before.
  (read-and-parse): New helper; actually parses.
  (read-and-compile): Use read-and-parse, and fall back to
  default-language-joiner.

Thanks to Nala Ginrut for the report.
2013-01-22 09:19:55 +01:00
Andy Wingo
170410b607 Fix http-get* deprecation note
* module/web/client.scm (http-get*): Fix deprecation warning.  Thanks to
  Daniel Hartwig for the report.
2013-01-21 22:13:30 +01:00
Andy Wingo
b3219085d9 read-and-compile closes input file after seeing EOF
* module/system/base/compile.scm (read-and-compile): Close the input
  port after we read all of its data.  Perhaps this cleans up some NFS
  ghosts that David Pirotte was seeing.
2013-01-21 19:08:39 +01:00
Andy Wingo
f6fd2c03a5 fix try-module-autoload, which did not detect failure to find the file
* libguile/load.c (scm_primitive_load_path): If the second argument is a
  procedure, call it like a thunk.

* doc/ref/api-evaluation.texi (Load Paths): Update docs.

* module/ice-9/boot-9.scm (resolve-interface): Use `unless'.
  (try-module-autoload): Use the new primitive-load-path to detect
  failure to find an appropriate file.  Fixes a bug reported by Diogo
  F. S. Ramos.  Thanks to Noah Lavine for tracking it down.
2013-01-21 11:21:52 +01:00
Andy Wingo
7f420e49e4 Fix attempt to get handle of weak table in (oop goops save)
* module/oop/goops/save.scm (readable?): Fix.  Thanks to Andrew Gaylard
  for the report.
2013-01-20 13:28:31 +01:00
Andy Wingo
36c210d14e trace: limit length of "| | | "... prefix
* module/system/vm/trace.scm (build-prefix): New helper.
  (print-application, print-return): Use the helper.
  (trace-calls-to-procedure, trace-calls-in-procedure):
  (trace-instructions-in-procedure, call-with-trace): Add #:max-indent
  argument, defaulting to the terminal width less 40 characters.

* doc/ref/scheme-using.texi: Update `trace' docs.

Based on a patch by Nala Ginrut.
2013-01-16 18:11:47 +01:00
Andy Wingo
3404ada0a6 peval-introduced gensyms infix " "
* module/language/tree-il/peval.scm (peval): Gensyms use whitespace as
  an infix, not a dash.  Helps gensym?-like procedures like those in the
  unused lexical analysis.
2013-01-16 13:27:55 +01:00
Noah Lavine
94027fe6ec Remove 'define-grammar-f'
* module/ice-9/peg.scm: don't re-export 'define-grammar-f'
* module/ice-9/peg/string-peg.scm: don't export 'define-grammar-f'
2013-01-16 10:11:50 +01:00
Noah Lavine
fee87b821f PEG Renames
* module/ice-9/peg.scm: rename 'peg-sexp-compile' to
 'compile-peg-pattern'
* module/ice-9/peg/codegen.scm: same
* module/ice-9/peg/string-peg.scm: same
* module/ice-9/peg/using-parsers.scm: same
* doc/ref/api-peg.texi: same
2013-01-16 10:11:50 +01:00
Noah Lavine
3ebd578616 PEG Renames
* module/ice-9/peg.scm: rename 'define-grammar' to
 'define-peg-string-patterns'
* module/ice-9/peg/string-peg.scm: same
* doc/ref/api-peg.texi: same
* test-suite/tests/peg.bench: same
* test-suite/tests/peg.test: same
2013-01-16 10:11:49 +01:00
Noah Lavine
40ebbd64c4 PEG Renames
* module/ice-9/peg.scm: rename 'define-nonterm' to 'define-peg-pattern'
* module/ice-9/peg/using-parsers.scm: same
* module/ice-9/peg/string-peg.scm: same
* test-suite/tests/peg.test: same
* doc/ref/api-peg.texi: same
2013-01-16 10:11:49 +01:00
Noah Lavine
8022f5023e PEG Renames
* module/ice-9/peg.scm: rename 'peg-parse' to 'match-pattern'
* module/ice-9/peg/string-peg.scm: same
* module/ice-9/peg/using-parsers.scm: same
* doc/ref/api-peg.texi: same
* test-suite/tests/peg.test: same
* test-suite/tests/peg.bench: same
2013-01-16 10:11:49 +01:00
Noah Lavine
d7e2f5e3c2 PEG Renames
* doc/ref/api-peg.texi: rename 'peg-match' to 'search-for-pattern'
* module/ice-9/peg.scm: same
* module/ice-9/peg/using-parsers.scm: same
* test-suite/tests/peg.test: same
2013-01-16 10:11:48 +01:00
Noah Lavine
680f1dee0c Comments in PEG
module/ice-9/peg/string-peg.scm: add comments explaining the format of some
  of the parsed PEG forms.
2013-01-16 10:11:47 +01:00
Noah Lavine
cdeb5a7826 Remove 'body' PEG
module/ice-9/peg/string-peg.scm: update S-expression generators to use the
  new *, +, ?, followed-by, and not-followed-by forms.
module/ice-9/peg/codegen.scm: remove the 'body' form in the PEG s-expression
  representation.
2013-01-16 10:11:47 +01:00
Noah Lavine
72287411e9 Add 'not-followed-by' PEG
The PEG s-expression syntax now uses '(not-followed-by ...)' instead of
'(body ! ... 1)'.
2013-01-16 10:11:46 +01:00
Noah Lavine
66ba3de0a6 Add 'followed-by' PEG
The PEG s-expression syntax now uses '(followed-by ...)' instead of
'(body & ... 1)'.
2013-01-16 10:11:46 +01:00
Noah Lavine
8e97edd5d3 Add '?' PEG
The PEG s-expression syntax now uses '(? ...)' instead of '(body lit ... ?)'.
2013-01-16 10:11:46 +01:00
Noah Lavine
3d19969d74 Add '+' PEG
The PEG s-expression syntax now uses '(+ ...)' instead of '(body lit ... +)'.
2013-01-16 10:11:46 +01:00
Noah Lavine
f310a111de Add '*' PEG
The s-expression representation of PEG grammars now uses a '(* ...)' form
instead of '(body lit ... *)'.
2013-01-16 10:11:46 +01:00
Noah Lavine
5c3f2da81f Clean Up PEG Codegen
* module/ice-9/peg/codegen.scm: remove unnecessary literals in
  peg-sexp-compile.
2013-01-16 10:11:46 +01:00
Noah Lavine
89c3c9ecf0 Make PEG Files
* module/ice-9/peg/using-parsers.scm: remove unnecessary dependency
* module/ice-9/peg.scm: add comment about string-peg dependency
* module/Makefile.scm: add PEG files to makefile
2013-01-16 10:11:45 +01:00
Noah Lavine
0977b03ef1 Rearrange PEG Modules
* module/ice-9/peg.scm: move code out of here
* module/ice-9/peg/match-records.scm: remove this file
* module/ice-9/peg/using-parsers.scm: make a new module with utilities for
  using parsers. It contains the code from both peg.scm and match-records.scm
* module/ice-9/peg/string-peg.scm: update to use new module
2013-01-16 10:11:45 +01:00
Noah Lavine
22d4c9d99a PEG Cache Module
* module/ice-9/peg/cache.scm: add module to hold cache logic for PEG
   parsers
* module/ice-9/peg.scm: move cache logic out of here
2013-01-16 10:11:45 +01:00
Noah Lavine
172ac609c4 Update String PEGs
* module/ice-9/peg/string-peg.scm: use new interface for extending PEG
   syntax
* module/ice-9/peg.scm: remove peg-extended-compile
2013-01-16 10:11:44 +01:00
Noah Lavine
94e8517c16 Extensible PEG Syntax
* module/ice-9/peg/codegen.scm: Make the PEG syntax extensible, and
    move most of the current code generators to the new interface
* doc/ref/api-peg.texi: Document PEG extensions in the PEG Internals
    section of the manual
2013-01-16 10:11:44 +01:00
Noah Lavine
bbc5564c42 Separate PEG Concerns
* module/ice-9/peg/codegen.scm: peg-sexp-compile no longer knows about
   string PEGs
* module/ice-9/peg.scm: add a new function peg-extended-compile that
   calls peg-sexp-compile or peg-string-compile on its argument as
   appropriate
2013-01-16 10:11:44 +01:00
Noah Lavine
0afaf59982 Move define-nonterm
* module/ice-9/peg/string-peg.scm: remove define-nonterm and make a simpler
   macro called `define-sexp-parser' to make the PEG grammar
* module/ice-9/peg.scm: move define-nonterm macro to this file
* module/ice-9/peg/codegen.scm: move code to wrap a parser result nicely to
   this file, under name `wrap-parser-for-users'
2013-01-16 10:11:44 +01:00
Noah Lavine
74393a53cf Remove eval-when
* module/ice-9/peg.scm: remove the eval-when statement
2013-01-16 10:11:43 +01:00
Noah Lavine
44bd21ae7b Factor PEG Structure
* modules/ice-9/peg.scm: remove the part that defines a match structure
 * modules/ice-9/peg/match-record.scm: and put it here
2013-01-16 10:11:43 +01:00
Noah Lavine
f3f41b9226 Factor PEG Functions
* module/ice-9/peg.scm: take out the functions for simplifying trees
 * module/ice-9/peg/simplify-tree.scm: and put them here
2013-01-16 10:11:43 +01:00
Noah Lavine
5e16c41703 Separate PEG Strings
* module/ice-9/peg.scm: remove functions dealing with PEGs as strings
 * module/ice-9/peg/string-peg.scm: and put them here
2013-01-16 10:11:43 +01:00
Noah Lavine
00923497d2 Make Macros Hygienic
* modules/ice-9/peg.scm: convert the unhygienic macros that generate code
    for string PEGs to use hygiene.
2013-01-16 10:11:43 +01:00
Noah Lavine
86849e2c19 Rename in peg.scm
* module/ice-9/peg.scm: rename peg-parse-* functions to avoid confusion
    with what PEGs do.
2013-01-16 10:11:42 +01:00
Noah Lavine
bff3ccd957 Split peg.scm
* module/ice-9/peg.scm: move code generators to new module
 * module/ice-9/peg/codegen.scm: new module for PEG code generators
2013-01-16 10:11:42 +01:00
Andy Wingo
c7ed2190cf peg: remove error-val
* module/ice-9/peg.scm (error-val): Remove needless definition.
2013-01-16 10:11:42 +01:00
Andy Wingo
3be2799eaf peg: refactor peg-sexp-compile to operate on syntax directly
* module/ice-9/peg.scm (cg-generic-ret): Remove unused for-syntax
  argument.
  (peg-sexp-compile): Take the pattern as syntax directly, and use
  syntax-case to destructure it and dispatch to the code generators.
  (cg-and, cg-and-int, cg-or, cg-or-int): Refactor to operate on syntax
  instead of on s-expressions.
  (cg-body): Likewise; though this was a larger refactor.
  (define-nonterm, peg-match): Adapt to peg-sexp-compile calling
  convention change.
  (peg-string-compile): Likewise, and just take the grammar as a syntax
  object.
2013-01-16 10:11:41 +01:00
Andy Wingo
5041b82067 peg: cg-string, cg-peg-any, cg-range: remove needless for-syntax arg
* module/ice-9/peg.scm (cg-string, cg-peg-any, cg-range): Remove
  unnecessary for-syntax arg.
  (peg-sexp-compile): Adapt.
2013-01-16 10:11:41 +01:00
Andy Wingo
c5b85eceba peg: change some instances of "match" to "pat"
* module/ice-9/peg.scm (cg-string): Rename "match" to "pat".
  (peg-sexp-compile, cg-body-test, cg-body, define-nonterm): Likewise.
2013-01-16 10:11:40 +01:00
Andy Wingo
63a1336de7 remove cggl, cg-generic-lambda
* module/ice-9/peg.scm (cg-generic-lambda, cggl): Remove these helpers,
  they are no longer needed.
  (cg-generic-ret): Remove optimization for particular cg- routines, as
  it's no longer needed.
2013-01-16 10:11:40 +01:00