Move 'utils::bytearray' to 'expr/bytearray'

This commit is contained in:
KtorZ
2023-07-05 14:10:47 +02:00
parent 44eb501d78
commit e15cdaf248
4 changed files with 89 additions and 86 deletions

View File

@@ -2,7 +2,7 @@ use chumsky::prelude::*;
use crate::{
ast,
parser::{annotation, error::ParseError, token::Token, utils},
parser::{annotation, error::ParseError, expr::bytearray::bytearray, token::Token, utils},
};
pub fn parser() -> impl Parser<Token, ast::UntypedDefinition, Error = ParseError> {
@@ -48,12 +48,10 @@ pub fn value() -> impl Parser<Token, ast::Constant, Error = ParseError> {
});
let constant_bytearray_parser =
utils::bytearray().map_with_span(|(preferred_format, bytes), span| {
ast::Constant::ByteArray {
location: span,
bytes,
preferred_format,
}
bytearray().map_with_span(|(preferred_format, bytes), span| ast::Constant::ByteArray {
location: span,
bytes,
preferred_format,
});
choice((