New features:
- New parser option
racket_hash_percent_symbols
, implemented in PR #90 by @andrew-pa. - New parser option
leading_digit_symbols
(PR #106). This should now allow parsing files produced by recent KiCad versions, thus closing #64. - Accept symbols starting with an alphabetical unicode codepoint, fixing #112.
Fixes:
- The
Cons
type now has a customDrop
implementation which avoids recursion on the "cdr" field. This allows for dropping long lists without overflowing the stack (#104).
Changes:
- The
sexp!
macro is now only included when specifying the non-default featuresexp-macro
. This makes the crate a bit more lightweight for users who don't need that macro. - The
sexp!
macro now recognizes keywords without a leading octothorpe, as in Emacs Lisp and Common Lisp, allowing for a less-noisy spelling; e.g.::foo
instead of#:foo
. Feature request (#99) and initial implementation (#96) by @samuel-jimenez. - The
parser::Options::elisp
constructor now enables theleading_digit_symbols
option, as that's what's appropriate for Emacs Lisp.
Maintenance-related changes:
- The MSRV is now 1.56 and specified in
Cargo.toml
and the Rust edition has been updated to "2021".
New features:
- The
sexp
macro now accepts unquoted symbols made up of Rust punctuation characters, as long as they also comply with the R7RS syntax.
Fixes:
- The parser now copes better with symbols which are delimited with a non-space character (issue #40).
Maintenance-related changes:
- The dependency on
proc-macro-hack
is now gone; this required bumping the MSRV to 1.45 (issue #78). - The dependency on
iota
and the dev-dependencies oncriterion
,quickcheck
andrand
have been updated.
This is a maintenance and bugfix release:
- Fix reading close square delimiter when interpreting square brackets as list delimiters. Issue reported and fixed by @raffalevy.
New features:
- An additional API that allows obtaining source location information
is now available, thanks to the request of @emoon, who opened the
very first issue on lexpr. The central point of the new API is the
new
Datum
type, which combines aValue
with location information. - The iterators for cons cell chains now have a
peek
method. - Number literals with R7RS radix prefixes are now understood. This
allows for parsing of binary, octal, hexidecimal, and
explicitly-decimal literals, e.g.,
#b10101110
.#o0777
,#xDEADBEEF
and#d42
. A sign is allowed to follow the radix prefix, as per R7RS formal syntax.
Besides some CI churn, the quickcheck_macros
dev-dependency has been
updated, which eliminates old versions of syn
and quote
from the
transitive development build dependencies.
This is dependency-update release:
- The procedural
sexp
macro is now implemented on top ofproc-macro2
1.0 andquote
1.0. lexpr
now uses newer versions ofcriterion
,quickcheck
andrand
in itsdev-dependencies
.
In addition, some minor code cleanups have been done, including slight simplification of some doctest examples.
New features:
- Line comments are now recognized (and ignored) by the parser.
- The
Parser
type now implementsIterator
. This should make reading multiple S-expressions from a single source considerably more ergonomic.
New features:
- The
Value
type now implementsFromStr
using the default syntax.
Parser bugfixes:
-
"Peculiar identifiers", i.e. those starting with "+", "-" or ".", should now be handled properly.
-
Number literals that start with a "+" are no longer erroneously parsed as symbols.
-
The handling of dots inside lists should now be more robust, detecting invalid syntax that was accepted before.
Fix version number in README; no other changes.
Incompatible changes:
- The
Atom
enum no longer exists. All its variants are now part of theValue
enum itself. - List values are no longer represented as
List
andImproperList
variants, but are more faithfully modeled as chains of "cons" cells. See theValue::Cons
variant and the newCons
data type. Conversion to vectors and iteration over cons cell chains is supported. - The
String
,Symbol
andKeyword
variants no longer contain aString
, but aBox<str>
to reduce the memory footprint ofValue
. As in-place modification of these variants is expected to be a seldom-required operation, the ergonomic impact is deemed acceptable. - The
Error
type, as it currently only relates to S-expression parsing, is now found in thelexpr::parse
module.
New features:
- Serde support is now available via the companion crate
serde-lexpr
, which is developed in parallel withlexpr
, sharing the same git repository. - There is now the
Value::Vector
variant for representing Lisp vectors. Vectors can be constructed via thesexp!
macro using Scheme syntax, e.g.sexp!(#(1 2 3))
. Both Emacs Lisp and Scheme syntax is supported for reading and printing. - Characters are now supported with the
Value::Char
variant. Both Emacs Lisp and Scheme syntax is supported. - Byte vectors are now supported with the
Value::Bytes
variant. This is supported for Scheme R6RS and R7RS syntax. For Emacs Lisp, this data type maps to unibyte strings. - Escapes sequences in string literals now support the appropriate syntax for the selected Lisp dialect, instead of using JSON syntax.
- There is now a
Number::visit
method, which can be used to dispatch on the internal type of the number.
Noteworthy changes:
- Initial parsing and printing support.
Noteworthy changes:
- New constructors
Value::list()
,Value::improper_list()
, andValue::empty_list()
. - New predicates
Value::is_symbol()
,Value::is_list()
, andValue::is_improper_list()
. - New accessor
Value::as_symbol()
. - New conversions using the
From
/Into
traits:Value
can now additionally be constructed fromAtom
andCow<str>
.Atom
can now additionally be constructed fromCow<str>
.
- A few initial, basic API tests added.
Noteworthy changes:
- Fix in
Atom::keyword()
- More accesor functions for
Value
andAtom
- Documentation expanded a bit
- We now build on travis-ci
Initial release, features:
Value
type andsexp
macro and corresponding documentation.