From 641796d38f03f4f4bbcf3e4e6a29c66c8c87606b Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Mon, 5 Jul 2021 20:42:45 +0200 Subject: [PATCH] add kw --- examples/errors.rs | 2 +- src/expr.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/errors.rs b/examples/errors.rs index 6476432..48e394b 100644 --- a/examples/errors.rs +++ b/examples/errors.rs @@ -3,7 +3,7 @@ use eww_config::{config::*, expr::*}; fn main() { let mut files = codespan_reporting::files::SimpleFiles::new(); - let input = "(12 :bar 22 (foo) (baz)"; + let input = "(12 :bar 22 (foo) (baz))"; let file_id = files.add("foo.eww", input); let ast = eww_config::parse_string(file_id, input); diff --git a/src/expr.rs b/src/expr.rs index 7426359..ca67df1 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -66,6 +66,8 @@ impl Expr { as_func!(ExprType::Symbol, as_symbol as_symbol_ref = Expr::Symbol(_, x) => x); + as_func!(ExprType::Keyword, as_keyword as_keyword_ref = Expr::Keyword(_, x) => x); + as_func!(ExprType::List, as_list as_list_ref> = Expr::List(_, x) => x); pub fn expr_type(&self) -> ExprType {