tr_lang/bytecode/
bytecode.rs

1use crate::token::ParserToken;
2use bincode;
3
4pub fn to_bytecode(parsed: Vec<ParserToken>) -> Vec<u8> {
5    bincode::serialize(&parsed).unwrap()
6}
7
8pub fn from_bytecode(bytecode: &[u8]) -> Vec<ParserToken> {
9    bincode::deserialize(bytecode).unwrap()
10}