summaryrefslogtreecommitdiff
path: root/module/ice-9/read.scm
Commit message (Collapse)AuthorAgeFilesLines
* ice-9/read: Parse #{}}# properly.Maxime Devos2021-08-021-2/+5
| | | | | | | | | | | This is a regression since Guile 3.0.2 and breaks compilation of a Guile library. * module/ice-9/read.scm (%read)[read-parenthesized]: When SAW-BRACE? is #t but CH isn't #\#, don't eat CH. * test-suite/tests/reader.test ("#{}#): Add four test cases.
* Fix bug for read-syntax on ( . args)Andy Wingo2021-05-011-3/+13
| | | | | | * module/ice-9/boot-9.scm: Capture syntax?. * module/ice-9/read.scm (read-syntax): Avoid re-annotating objects. * test-suite/tests/reader.test ("read-syntax"): Add test.
* Fix line and column for read errorsAndy Wingo2021-04-291-1/+2
| | | | | | * module/ice-9/read.scm (%read): Add 1 to both line and column: the former to make 1-based user lines instead of 0-based Guile lines, and the latter because apparently that's how we always did it :) Fixes
* Fix reading #!!#Andy Wingo2021-03-071-8/+10
| | | | | * module/ice-9/read.scm (%read): Fix reading #!!#. * test-suite/tests/reader.test ("reading"): Add some test cases.
* tweak unknown hash object error in readerMichael Gran2021-03-051-1/+1
| | | | | | | This makes it match the other species of unknown hash object error when reading number with radix. * module/ice-9/read.scm (read-sharp): modified
* print token in error msg for unknown hash objectMichael Gran2021-03-051-1/+1
| | | | * module/ice-9/read.scm (read-number-and-radix): modified
* Handle <eof> in reader's character escape sequencesMichael Gran2021-03-051-0/+6
| | | | | * module/ice-9/read.scm (read-r6rs-hex-escape, read-fixed-hex-escape): modified
* Fix reading "#;", "'", and similar premature-EOF situationsAndy Wingo2021-03-051-24/+24
| | | | | | * module/ice-9/read.scm (%read): Adjust how subexpressions are read to error on EOF. Improve the error message. * test-suite/tests/reader.test ("#;"): Adapt expectation.
* Fix reading of #true / #falseAndy Wingo2021-03-051-1/+1
| | | | * module/ice-9/read.scm (%read): Fix bad argument order to unread-char.
* Fix reading improper curly-infix expressionsAndy Wingo2021-03-041-3/+3
| | | | | * module/ice-9/read.scm (%read): A fix to last night's fix, to make srfi-105.test pass.
* Fix reading #c32 vectorsAndy Wingo2021-03-031-1/+1
| | | | * module/ice-9/read.scm (%read): Fix a wee typo.
* Fix some srfi-105 parsing errorsAndy Wingo2021-03-031-7/+8
| | | | * module/ice-9/read.scm (%read): Fix parsing errors.
* Fix length of \U hex escape in new readerAndy Wingo2021-03-031-1/+1
| | | | * module/ice-9/read.scm (%read): \U escape is 6 digits long.
* Fix bug in new array readerDaniel Llorens2021-03-031-4/+2
| | | | | | * module/ice-9/read.scm (read-array): Return pair for dimension when len is given; single number is lbnd for list->typed-array. * test-suite/tests/arrays.test: More test cases for the reader.
* Read-in-scheme replaces boot "read" definitionAndy Wingo2021-03-031-23/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of defining a separate module, given that "read" calls are quite all over the place, we're just going to replace the boot "read" binding with read.scm. This way, we'll be able to remove support for reader options in the boot reader, as it will only ever be used for a finite set of files. * NEWS: Update. * module/Makefile.am (ice-9/boot-9.go): Depend on read.scm. (SOURCES): * am/bootstrap.am (SOURCES): Don't build a ice-9/read.go, as we include it. * module/ice-9/boot-9.scm (read-syntax): Define here, as "include" now uses it. (read-hash-procedures, read-hash-procedure, read-hash-extend): New procedures. Will replace C variants. (read, read-syntax): Include read.scm to define these. * module/ice-9/psyntax-pp.scm (include): Regenerate. * module/ice-9/psyntax.scm (include): Use read-syntax, so we get better source information. * module/ice-9/read.scm (let*-values): New local definition, to avoid loading srfi-11. (%read): Use list->typed-array instead of u8-list->bytevector. * module/language/scheme/spec.scm: Remove (ice-9 read) import; read-syntax is there in the boot environment
* Fix unterminated #!...!# error message in Scheme readerAndy Wingo2021-03-031-1/+1
| | | | | * module/ice-9/read.scm (%read): Tweak "unterminated block constant" error to be more compatible with C reader.
* Fix reading neoteric exprs in Scheme readerAndy Wingo2021-03-031-1/+1
| | | | | * module/ice-9/read.scm (%read): Call the inner reader, not the outer reader.
* Fix reader extensions in Scheme readerAndy Wingo2021-03-031-1/+1
| | | | * module/ice-9/read.scm (%read): Fix invocation of hash procedure.
* Remove textual-ports include from (ice-9 read)Andy Wingo2021-03-031-2/+1
| | | | | * module/ice-9/read.scm: We'll be loading this file early, so avoid extraneous deps.
* Fix another typo in routine reading arraysDaniel Llorens2021-03-021-1/+1
| | | | | * module/ice-9/read.scm: As stated. * test-suite/tests/arrays.test: Test a fixed case.
* Fix bug reading arrays with lengthsAndy Wingo2021-03-021-1/+1
| | | | * module/ice-9/read.scm (%read): Fix typo.
* Fix Scheme read without source positionsAndy Wingo2021-02-281-1/+2
| | | | | * module/ice-9/read.scm (read): Fix annotate when positions are disabled.
* read-syntax uses vector source representationAndy Wingo2021-02-251-3/+1
| | | | * module/ice-9/read.scm (read-syntax): Switch to sourcev format.
* Fix read-syntax on vectors and arraysAndy Wingo2021-02-251-3/+3
| | | | | * module/ice-9/read.scm (%read): Strip annotations from reading the array elements.
* Implement read-syntaxAndy Wingo2021-02-211-27/+42
| | | | | | | | | | | * doc/ref/api-macros.texi (Syntax Case): Update documentation for datum->syntax. * module/ice-9/psyntax.scm (datum->syntax): Use #:source keyword for source location info instead of an optional, and allow an alist. * module/ice-9/psyntax-pp.scm: Regenerate. * module/ice-9/read.scm (%read, read): Refactor to allow read and read-syntax to share an implementation. (read-syntax): New function.
* Use lists instead of string ports to accumulate resultsAndy Wingo2021-02-171-70/+61
| | | | | * module/ice-9/read.scm (read): Use lists, like read-delimited does. About 30% faster.
* Fix read.scm bugs related to nonstandard reader optionsAndy Wingo2021-02-171-12/+10
| | | | | * module/ice-9/read.scm (compute-reader-options): Fix handling of reader options, inline and otherwise.
* Improve read error reportingAndy Wingo2021-02-171-43/+50
| | | | | * module/ice-9/read.scm (read): Issue properly formatted read-errors, as users expect.
* Scheme read respects "positions" reader optionAndy Wingo2021-02-171-1/+2
| | | | | * module/ice-9/read.scm (read): Don't add source positions if the option is off.
* More read micro-optimizationsAndy Wingo2021-02-171-3/+3
| | | | | | * module/ice-9/read.scm (read): Use R5RS read-char, peek-char, write-char rather than (ice-9 textual-ports) wrappers, because the latter are expressed in terms of the former.
* Micro-optimization to delimiter?Andy Wingo2021-02-171-4/+5
| | | | | * module/ice-9/read.scm (read): Make sure we hit the "case" optimization.
* Re-use string output port within readAndy Wingo2021-02-171-64/+69
| | | | | * module/ice-9/read.scm (read): Just have one string output port during the read.
* Fix (ice-9 read) for #\"Andy Wingo2021-02-141-0/+2
| | | | * module/ice-9/read.scm (read): Fix #\ followed by a delimiter.
* Fix (ice-9 read) for #!r6rsAndy Wingo2021-02-141-1/+3
| | | | * module/ice-9/read.scm (read): Fix read-directive.
* Add "read" implementation in SchemeAndy Wingo2021-02-131-0/+866
* module/Makefile.am (SOURCES): Add ice-9/read. * module/ice-9/read.scm: New file. The idea is to move the compiler to use this "read", after proving that it does the same as C. Then we can switch to read-syntax that returns syntax objects with source locations, allowing us to annotate any datum.