diff options
Diffstat (limited to 'users/glittershark/achilles/src/parser/type_.rs')
-rw-r--r-- | users/glittershark/achilles/src/parser/type_.rs | 2 |
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 1e6e380bb823..8a1081e2521f 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] |