added networking to the enviroment

This commit is contained in:
afonya2 2025-06-11 19:43:53 +02:00
parent cca26d9fc3
commit f2220d1014
Signed by: afonya
GPG key ID: EBB9C4CAFAAFB2DC
4 changed files with 267 additions and 25 deletions

View file

@ -835,6 +835,18 @@ fn next_operation(pos: &mut usize, input: &Vec<Token>, op_ends: &Vec<Token>, par
let var = ASTPart::VarRead(AstVarRead { variable: token.value.clone(), pos: token.pos });
let cal = read_call(var, pos, input, ctx);
return check_continue(pos, input, cal, op_ends, parse_ends, ctx)
} else if next_token.typ == TokenType::SEPARATOR && next_token.value == "." {
let var_pos = token.pos;
*pos += 1;
let keyy = &input[*pos];
if keyy.typ != TokenType::IDENTIFIER {
let err = create_error(&format!("Expected identifier after `.`"), keyy.pos, ErrorType::SyntaxError, ErrorSubType::Expected);
print_error(&err, &ctx);
process::exit(1);
}
*pos += 1;
let gt = ASTPart::TableGet(AstTableGet { table: Box::new(ASTPart::VarRead(AstVarRead { variable: token.value.clone(), pos: var_pos })), key: Box::new(ASTPart::String(AstString { value: keyy.value.clone(), pos: keyy.pos })), pos: var_pos+1 });
return check_continue(pos, input, gt, op_ends, parse_ends, ctx);
} else if next_token.typ == TokenType::SEPARATOR && next_token.value == "[" {
*pos += 1;
let key_ends: Vec<Token> = vec![