Change object maps to #{ ... }

This commit is contained in:
Stephen Chung
2020-03-30 17:40:26 +08:00
parent ee18f047b4
commit 01c0b51017
5 changed files with 39 additions and 36 deletions

View File

@@ -368,7 +368,7 @@ pub enum Expr {
/// [ expr, ... ]
Array(Vec<Expr>, Position),
#[cfg(not(feature = "no_object"))]
/// ${ name:expr, ... }
/// #{ name:expr, ... }
Map(Vec<(String, Expr, Position)>, Position),
/// lhs && rhs
And(Box<Expr>, Box<Expr>),
@@ -627,7 +627,7 @@ impl Token {
Comma => ",",
Period => ".",
#[cfg(not(feature = "no_object"))]
MapStart => "${",
MapStart => "#{",
Equals => "=",
True => "true",
False => "false",
@@ -1159,7 +1159,7 @@ impl<'a> TokenIterator<'a> {
// Map literal
#[cfg(not(feature = "no_object"))]
('$', '{') => {
('#', '{') => {
self.eat_next();
return Some((Token::MapStart, pos));
}