step_p21/parser/exchange/
header.rs1use crate::{
2 ast::*,
3 parser::{combinator::*, exchange::*},
4};
5use nom::Parser;
6
7pub fn header_section(input: &str) -> ParseResult<'_, Vec<Record>> {
10 tuple_((tag_("HEADER;"), header_entity_list, tag_("ENDSEC;")))
11 .map(|(_start, entities, _close)| entities)
12 .parse(input)
13}
14
15pub fn header_entity_list(input: &str) -> ParseResult<'_, Vec<Record>> {
17 many1_(header_entity).parse(input)
18}
19
20pub fn header_entity(input: &str) -> ParseResult<'_, Record> {
28 tuple_((simple_record, char_(';')))
29 .map(|(record, _semicolon)| record)
30 .parse(input)
31}