diff options
author | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-08-10 18:38:49 +0300 |
---|---|---|
committer | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-08-10 18:38:49 +0300 |
commit | 06798d622327707ca3f3b42d65fc3d1a25ae3c57 (patch) | |
tree | c230f8ffc43f34a4077cf71b480e93357dbb24b1 /src/parse | |
parent | 2274a96d1cbd7a5b89bb6b5f51f6bbb0a0513587 (diff) | |
download | myslip-06798d622327707ca3f3b42d65fc3d1a25ae3c57.tar.gz myslip-06798d622327707ca3f3b42d65fc3d1a25ae3c57.zip |
Added term level type literals (for function type signatures)
Diffstat (limited to 'src/parse')
-rw-r--r-- | src/parse/parsetree.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/parse/parsetree.rs b/src/parse/parsetree.rs index 28e5044..6dd4e01 100644 --- a/src/parse/parsetree.rs +++ b/src/parse/parsetree.rs @@ -10,6 +10,7 @@ use nom::{ }; use crate::sexp::{SExp, SExp::*, SLeaf::*, util::*}; +use crate::r#type::{Type::*}; #[derive(Debug,PartialEq,Clone)] @@ -113,8 +114,11 @@ fn tokens_to_ast_inner( Some(Sym(s)) if s == "false" => Ok(Atom(False)), Some(Sym(s)) if s == "quote" => Ok(Atom(Quote)), Some(Sym(s)) if s == "vector" => Ok(Atom(Vector)), - Some(Sym(s)) if s == "print" => Ok(Atom(Print)), + Some(Sym(s)) if s == "print" => Ok(Atom(Print)), Some(Sym(s)) if s == "let" => Ok(Atom(Let)), + Some(Sym(s)) if s == "->" => Ok(Atom(Arr)), + Some(Sym(s)) if s == "int" => Ok(Atom(Ty(Integer))), + Some(Sym(s)) if s == "bool" => Ok(Atom(Ty(Boolean))), Some(Sym(s)) => Ok(Atom(Var(s))), Some(ParClose) => break, Some(ParOpen) => { |