From 06798d622327707ca3f3b42d65fc3d1a25ae3c57 Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Sun, 10 Aug 2025 18:38:49 +0300 Subject: Added term level type literals (for function type signatures) --- src/parse/parsetree.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/parse/parsetree.rs') 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) => { -- cgit v1.2.3