diff options
Diffstat (limited to 'sloth/src/parser')
| -rw-r--r-- | sloth/src/parser/ast.rs | 1 | ||||
| -rw-r--r-- | sloth/src/parser/mod.rs | 11 | ||||
| -rw-r--r-- | sloth/src/parser/stmt.rs | 4 |
3 files changed, 1 insertions, 15 deletions
diff --git a/sloth/src/parser/ast.rs b/sloth/src/parser/ast.rs index 66bf851..00719e7 100644 --- a/sloth/src/parser/ast.rs +++ b/sloth/src/parser/ast.rs @@ -255,7 +255,6 @@ pub struct FunctionInput { pub struct TypeIdentifier { pub name: String, pub is_list: bool, - pub list_len: u32, } impl Display for TypeIdentifier { diff --git a/sloth/src/parser/mod.rs b/sloth/src/parser/mod.rs index 6dd534a..a1f251e 100644 --- a/sloth/src/parser/mod.rs +++ b/sloth/src/parser/mod.rs @@ -126,20 +126,11 @@ impl<'a> AstParser<'a> { let name = self.consume_identifier()?; - let mut list_len = 0; if is_list { - if let Literal::Integer(i) = self.consume_literal()? { - list_len = i as u32; - } - self.consume(TokenType::ClosingBracket, "Expected ']'")?; } - Ok(TypeIdentifier { - name, - is_list, - list_len, - }) + Ok(TypeIdentifier { name, is_list }) } pub fn reserve_id(&mut self) -> i32 { diff --git a/sloth/src/parser/stmt.rs b/sloth/src/parser/stmt.rs index d8c091d..d8a0509 100644 --- a/sloth/src/parser/stmt.rs +++ b/sloth/src/parser/stmt.rs @@ -311,7 +311,6 @@ mod tests { typ: TypeIdentifier { name: "Int".to_string(), is_list: false, - list_len: 0, }, })); @@ -346,13 +345,11 @@ mod tests { typ: TypeIdentifier { name: "Int".to_owned(), is_list: false, - list_len: 0, }, }], output: Some(TypeIdentifier { name: "Int".to_owned(), is_list: false, - list_len: 0, }), kind: FunctionKind::Normal { body: Box::new(Stmt::without_table( @@ -374,7 +371,6 @@ mod tests { typ: TypeIdentifier { name: "Int".to_owned(), is_list: false, - list_len: 0, }, }), Stmt::without_table(7, StmtKind::AssignVariable { |
