added tables to the execution part
This commit is contained in:
parent
6caafe77d0
commit
4faabe0d9c
3 changed files with 182 additions and 9 deletions
|
@ -341,6 +341,15 @@ fn read_table(input: &Vec<Token>, pos: &mut usize) -> ASTPart {
|
|||
if input[*pos].typ == TokenType::SEPARATOR && input[*pos].value == "[" {
|
||||
*pos += 1;
|
||||
let keyy = read_exp(pos, input, &key_ends, &key_ends);
|
||||
match keyy {
|
||||
ASTPart::Table(_) => {
|
||||
panic!("Table keys cannot be tables at {}", input[*pos].pos);
|
||||
},
|
||||
ASTPart::Function(_) => {
|
||||
panic!("Table keys cannot be functions at {}", input[*pos].pos);
|
||||
},
|
||||
_ => {}
|
||||
}
|
||||
if input[*pos].typ != TokenType::SEPARATOR || input[*pos].value != "]" {
|
||||
panic!("Unexpected end of key at {}", input[*pos].pos);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue