about summary refs log tree commit diff
path: root/users/glittershark/achilles/src/parser/type_.rs
diff options
context:
space:
mode:
Diffstat (limited to 'users/glittershark/achilles/src/parser/type_.rs')
-rw-r--r--users/glittershark/achilles/src/parser/type_.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/users/glittershark/achilles/src/parser/type_.rs b/users/glittershark/achilles/src/parser/type_.rs
index 1e6e380bb8..8a1081e252 100644
--- a/users/glittershark/achilles/src/parser/type_.rs
+++ b/users/glittershark/achilles/src/parser/type_.rs
@@ -29,6 +29,7 @@ named!(pub type_(&str) -> Type, alt!(
     tag!("float") => { |_| Type::Float } |
     tag!("bool") => { |_| Type::Bool } |
     tag!("cstring") => { |_| Type::CString } |
+    tag!("()") => { |_| Type::Unit } |
     function_type => { |ft| Type::Function(ft) }|
     ident => { |id| Type::Var(id) } |
     delimited!(
@@ -51,6 +52,7 @@ mod tests {
         assert_eq!(test_parse!(type_, "float"), Type::Float);
         assert_eq!(test_parse!(type_, "bool"), Type::Bool);
         assert_eq!(test_parse!(type_, "cstring"), Type::CString);
+        assert_eq!(test_parse!(type_, "()"), Type::Unit);
     }
 
     #[test]