diff options
| author | Joel Martin <github@martintribe.org> | 2014-10-27 22:39:31 -0500 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2015-01-06 21:59:00 -0600 |
| commit | bd3067230dcbd18fb1f0db7abb52c4ea1c2e227b (patch) | |
| tree | 08c01aaacbc469ea4d1ad950852bf67aeb4cdcae /rust/src/reader.rs | |
| parent | 06fef9b51830a2aa696f3e108c56f306967ce465 (diff) | |
| download | mal-bd3067230dcbd18fb1f0db7abb52c4ea1c2e227b.tar.gz mal-bd3067230dcbd18fb1f0db7abb52c4ea1c2e227b.zip | |
rust: add metadata support.
Diffstat (limited to 'rust/src/reader.rs')
| -rw-r--r-- | rust/src/reader.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/rust/src/reader.rs b/rust/src/reader.rs index e3ec55e..af496ff 100644 --- a/rust/src/reader.rs +++ b/rust/src/reader.rs @@ -166,6 +166,18 @@ fn read_form(rdr : &mut Reader) -> MalRet { Err(e) => Err(e), } }, + "^" => { + let _ = rdr.next(); + match read_form(rdr) { + Ok(meta) => { + match read_form(rdr) { + Ok(f) => Ok(list(vec![symbol("with-meta"), f, meta])), + Err(e) => Err(e), + } + }, + Err(e) => Err(e), + } + }, "@" => { let _ = rdr.next(); match read_form(rdr) { |
