about summary refs log tree commit diff
path: root/src/parser/type_.rs
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2021-03-14T15·53-0400
committerGriffin Smith <root@gws.fyi>2021-03-14T15·53-0400
commit39656a3801bb311edd9ebb65e92a24fc48f69ec7 (patch)
treed408937901c7789c033373019a94e014a03522a8 /src/parser/type_.rs
parent32a5c0ff0fc58aa6721c1e0ad41950bde2d66744 (diff)
Add string support to the frontend
Diffstat (limited to 'src/parser/type_.rs')
-rw-r--r--src/parser/type_.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/parser/type_.rs b/src/parser/type_.rs
index 076df7d6bd..66b4f9f72c 100644
--- a/src/parser/type_.rs
+++ b/src/parser/type_.rs
@@ -27,6 +27,7 @@ named!(pub type_(&str) -> Type, alt!(
     tag!("int") => { |_| Type::Int } |
     tag!("float") => { |_| Type::Float } |
     tag!("bool") => { |_| Type::Bool } |
+    tag!("cstring") => { |_| Type::CString } |
     function_type |
     delimited!(
         tuple!(tag!("("), multispace0),
@@ -44,6 +45,7 @@ mod tests {
         assert_eq!(test_parse!(type_, "int"), Type::Int);
         assert_eq!(test_parse!(type_, "float"), Type::Float);
         assert_eq!(test_parse!(type_, "bool"), Type::Bool);
+        assert_eq!(test_parse!(type_, "cstring"), Type::CString);
     }
 
     #[test]