BF code is now Vec<u8>
This commit is contained in:
parent
711ad27e00
commit
3bcef28843
|
@ -66,7 +66,7 @@ pub enum StmtKind {
|
||||||
BfFunctio {
|
BfFunctio {
|
||||||
iden: Iden,
|
iden: Iden,
|
||||||
tape_len: Option<Expr>,
|
tape_len: Option<Expr>,
|
||||||
code: String,
|
code: Vec<u8>,
|
||||||
},
|
},
|
||||||
Call {
|
Call {
|
||||||
iden: Iden,
|
iden: Iden,
|
||||||
|
|
|
@ -402,9 +402,8 @@ impl<'source> Parser<'source> {
|
||||||
_ => todo!(),
|
_ => todo!(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut code = String::new();
|
let mut code: Vec<u8> = vec![];
|
||||||
loop {
|
loop {
|
||||||
code.push_str(
|
|
||||||
match self
|
match self
|
||||||
.lexer
|
.lexer
|
||||||
.next()
|
.next()
|
||||||
|
@ -417,11 +416,10 @@ impl<'source> Parser<'source> {
|
||||||
| Token::LeftBracket
|
| Token::LeftBracket
|
||||||
| Token::RightBracket
|
| Token::RightBracket
|
||||||
| Token::LessThan
|
| Token::LessThan
|
||||||
| Token::GreaterThan => self.lexer.slice(),
|
| Token::GreaterThan => code.push(self.lexer.slice().as_bytes()[0]),
|
||||||
Token::RightCurly => break,
|
Token::RightCurly => break,
|
||||||
_ => "",
|
_ => (),
|
||||||
},
|
}
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(StmtKind::BfFunctio {
|
Ok(StmtKind::BfFunctio {
|
||||||
|
|
Loading…
Reference in a new issue