Skip to content

Commit

Permalink
fix: :xxx should be parsed as keyword instead of symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
blahgeek committed Jan 6, 2024
1 parent d138e01 commit 72d718e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/bytecode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl FromStr for LispObject {
} else if s == "t" {
Ok(Self::T)
} else if s.starts_with(":") {
Ok(Self::Symbol(s[1..].to_string()))
Ok(Self::Keyword(s[1..].to_string()))
} else {
bail!("Supported LispObject: {}", s)
}
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@ fn test_parse_args() {
assert_eq!(cli.verbose.log_level_filter(), log::LevelFilter::Debug);
assert_eq!(cli.server_cmd, vec!["server_cmd", "arg1"]);
assert_eq!(cli.json_object_type, bytecode::ObjectType::Hashtable);
assert_eq!(cli.json_null_value, bytecode::LispObject::Symbol("null".into()));
assert_eq!(cli.json_false_value, bytecode::LispObject::Symbol("json-false".into()));
assert_eq!(cli.json_null_value, bytecode::LispObject::Keyword("null".into()));
assert_eq!(cli.json_false_value, bytecode::LispObject::Keyword("json-false".into()));
}

0 comments on commit 72d718e

Please sign in to comment.