Move parsing of literals under new 'literal' parser module group
Also moved the logic for 'int' and 'string' there though it is trivial. Yet, for bytearray, it tidies things nicely by removing them from the 'utils' module.
This commit is contained in:
@@ -2,7 +2,9 @@ use chumsky::prelude::*;
|
||||
|
||||
use crate::{
|
||||
ast,
|
||||
parser::{annotation, error::ParseError, expr::bytearray::bytearray, token::Token, utils},
|
||||
parser::{
|
||||
annotation, error::ParseError, literal::bytearray::parser as bytearray, token::Token, utils,
|
||||
},
|
||||
};
|
||||
|
||||
pub fn parser() -> impl Parser<Token, ast::UntypedDefinition, Error = ParseError> {
|
||||
@@ -48,7 +50,7 @@ pub fn value() -> impl Parser<Token, ast::Constant, Error = ParseError> {
|
||||
});
|
||||
|
||||
let constant_bytearray_parser =
|
||||
bytearray().map_with_span(|(preferred_format, bytes), span| ast::Constant::ByteArray {
|
||||
bytearray(|bytes, preferred_format, span| ast::Constant::ByteArray {
|
||||
location: span,
|
||||
bytes,
|
||||
preferred_format,
|
||||
|
||||
Reference in New Issue
Block a user